简体   繁体   中英

redmine and mod_vhost_dbd

I've problem to run redmine with vhost_dbd_module from apache. Redmine was installed under /var/www/redmine/ directory. My apache config look:

<VirtualHost *:80>
    ServerName HOSTNAME
    DocumentRoot "/var/www/" # THIS IS NOT WORKING
    # DocumentRoot "/var/www/redmine/public" # THIS WORKS WITH REDMINE
    <Directory />
        Options FollowSymLinks -MultiViews -Indexes
        AllowOverride All
    </Directory>
    DBDriver mysql
    DBDParams host=localhost,user=test,pass=test,dbname=test
    DBDocRoot "SELECT document_root FROM vhosts WHERE server_name = %s"  HOSTNAME
</VirtualHost>

Field from database return '/var/www/redmain/public' - so it should works. 返回'/ var / www / redmain / public'-因此它应该可以工作。 It works for php projects where index file is under '/var/www/project/public'. Besides the page return 404 because in /var/www/redmain/public there is no index file. I want universal config

Any suggestions? Best regards, Peter

Not havng a index.html is ok :) Check your config/routes.rb . If rails service is running then your redmine rails check your routes.rb and deliver the default page there (view).

Passenger as an apache module is not compatible with about all modules used to define "dynamic" document roots (including mod_vhost_dbd ). For passenger, you have to statically configure your apps in the Apache configuration.

Generally, you will have a hard time emulating your PHP setup with any Ruby app server, as they expect to be started once and run continuously, unlike PHP "apps" which act as scripts resolved and started new for each request. You should rethink your setup for persistent application server processes.

I created .htaccess with content below and it working :)

RailsBaseURI /
PassengerAppRoot /var/www/redmine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM