apache 2 + Passenger + Redmine 映射问题

apache 2 + Passenger + Redmine 映射问题

我在我的 apache2 服务器中定义了这两个站点。

Redmine 服务器

#REDMINE SITE (/etc/apache2/sites-available/redmine)
<VirtualHost *:8080>
        # this is the passenger config
        RailsEnv production
        RailsBaseURI /redmine
        SetEnv X_DEBIAN_SITEID "default"
        Alias "/redmine/plugin_assets/" /var/cache/redmine/default/plugin_asset$
        DocumentRoot /usr/share/redmine/public
        <Directory "/usr/share/redmine/public">
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

还有一个 tomcat 服务器

#TOMCAT (/etc/apache2/sites-available/default)
<VirtualHost *:8080>
  JkMount /* worker1
  JkUnMount /redmine worker1
</VirtualHost>

我的问题是,redmine 站点似乎被映射到 apache 服务器的根目录/,而不是/redmine我该如何解决这个问题?

答案1

这是我最终得到的工作配置。

<VirtualHost *:8080>

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        LogLevel warn

       <Directory /var/www/redmine>
                   RailsBaseURI /redmine
                   PassengerResolveSymlinksInDocumentRoot on
      </Directory>

  JkMount /* worker1
  JkUnMount /redmine worker1
  JkUnMount /redmine/* worker1


</VirtualHost>

答案2

您的网站的文档根目录已映射到公共文件夹。请将 DocumentRoot 设置为其他位置Alias /redmine /usr/share/redmine/public

相关内容