redmine 安装不正确

incorrect redmine installation

我正在尝试安装 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.confsudo 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/).

我的 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>

我解决了这个问题:

我做到了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>

自 2018 年 1 月发布的 passenger 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/