如何使用Apache和Passenger在子域根目录上部署Rails应用程序

Don*_*lie 1 ruby apache deployment ruby-on-rails passenger

我在sub-uri redmine.example.org/redmine上有Rails应用程序,我想在redmine.example.org找到

/var/www/work/redmine.src is approot
/var/www/work/redmine is symlink to /var/www/work/redmine.src/public

<VirtualHost *:80>
    DocumentRoot /var/www/work
    ServerName redmine.example.org

    ErrorLog /var/log/apache2/redmine-error_log
    CustomLog /var/log/apache2/redmine-access_log combined

    <Directory /var/www/work/redmine>
            AllowOverride all
            Options -MultiViews
            Order allow,deny
            allow from all
    </Directory>

    RackBaseURI /redmine
    <Directory /var/www/work/redmine.src>
            Options -MultiViews
            Order allow,deny
            allow from all
    </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

我尝试了很多组合和googled小时,但没有任何作用.

我应该如何更改此配置以在子域根上部署redmine?

提前致谢.

Don*_*lie 5

嗯,这比我想象的要容易.

当我一次又一次地阅读本手册时,我找到了解决方案: 链接到手册

现在我的配置文件如下所示:

<VirtualHost *:80>
    DocumentRoot /var/www/work/redmine.src/public
    ServerName redmine.example.org

    <Directory /var/www/work/redmine.src/public>
        AllowOverride all
        Options -MultiViews
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)