我正在尝试安装redmine 3.2.0
,例如以下article。
点2.4 Test Redmine
工作正常,即我可以使用http://MY_IP:3000打开redmine。
在此之后,我做了:
sudo chown -R www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
sudo ln -s /opt/redmine/redmine-3.2.2/public/ /var/www/html/redmine
将Listen 89
添加到/etc/apache2/ports.conf
。
创建了以下sudo vim /etc/apache2/sites-available/redmine.conf
:
<VirtualHost MY_IP:89>
ServerAdmin email@example
DocumentRoot /var/www/html/
<Location /redmine>
RailsEnv production
RackBaseURI /redmine
Options -MultiViews
</Location>
</VirtualHost>
已启用redmine.conf
:sudo a2ensite redmine.conf
。
将PassengerUser www-data
添加到/etc/apache2/mods-available/passenger.conf
。现在passenger.conf
包含以下内容:
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby
PassengerUser www-data
</IfModule>
重新启动apache:sudo service apache2 restart
。
所以/var/www/html/
包含:
drwxr-xr-x 2 root root 4096 Jan 25 09:32 .
drwxr-x--x 7 root root 4096 Jan 22 07:21 ..
-rw-r--r-- 1 root root 11104 Jan 22 02:57 index.html
lrwxrwxrwx 1 root root 34 Jan 25 09:32 redmine -> /opt/redmine/redmine-3.2.0/public/
现在,如果我要前往http://MY_IP:89
,则会打开/var/www/html/index.html
而不是redmine home page
。
你能告诉我哪里出错吗?
提前致谢!
更新
如果我使用以下redmine.conf
:
<VirtualHost MY_IP:89>
DocumentRoot /var/www/html/redmine
<Directory /var/www/html/redmine>
RailsBaseURI /
PassengerResolveSymlinksInDocumentRoot on
AllowOverride None
RailsEnv production
Options -MultiViews
</Directory>
</VirtualHost>
Redmine不会开始,只显示index of
(/var/www/html/redmine/
)。
答案 0 :(得分:2)
我解决了问题:
我做了gem install passenger
。我使用以下redmine.conf
:
<VirtualHost MY_IP:89>
DocumentRoot /var/www/html/redmine
<Directory /var/www/html/redmine>
RailsBaseURI /
PassengerResolveSymlinksInDocumentRoot on
AllowOverride None
RailsEnv production
Options -MultiViews
</Directory>
</VirtualHost>
答案 1 :(得分:1)
2018年1月发布的乘客5.2.0不再支持“PassengerResolveSymlinksInDocumentRoot on”
在/etc/apache2/sites-available/xxx.conf中 进行以下更改:
# Not supported from passenger 5.2.0 on wards
# PassengerResolveSymlinksInDocumentRoot on
PassengerAppRoot /opt/redmine/redmine-3.2.0/public/
答案 2 :(得分:0)
我的redmine使用此配置处理apache。
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21
PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby
</IfModule>
<VirtualHost redmine.domain:80>
ServerName redmine.domain
ServerAlias redmine
DocumentRoot /opt/redmine/redmine-3.2.0/public/
<Directory /opt/redmine/redmine-3.2.0/public/>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
allow from all
</Directory>