我正在使用apache在单个服务器上设置一对redmine实例.
第一个工作正常,我有一个虚拟主机为它配置以下vhost配置:
<VirtualHost *:80> ServerName tickets.domain.com DocumentRoot /var/www/redmine RailsEnv production RailsBaseURI / PassengerResolveSymlinksInDocumentRoot on </VirtualHost>
Alias /ops/ "/var/www/ops/" <Directory "/var/www/ops/"> RailsEnv ops RailsBaseURI /ops PassengerResolveSymlinksInDocumentRoot on </Directory>
所以server / ops是第二个实例的url.
我遇到的麻烦是当我重新启动apache时,你先点击的那个url似乎“赢了”并且它打破了网站的另一个实例.如果我点击/ ops url然后它加载很好,但去票.将导致我获得权限被拒绝错误,因为所有的URL都有/ ops(对于JS和其他文件)
如果我重启apache并点击门票.站点首先,它加载很好,但后来我从/ ops网址上的Redmine得到404错误.
这是在Ubuntu上使用redmine PPA,并且/ var / www / ops和/ var / www / redmine都是共享redmine源代码的符号链接,并且定义了自己的环境(生产和操作).
有关如何使这两个人成功并存的任何提示?
谢谢
解决方法
这是我的apache配置托管多个redmine实例(domain.tld / dev1,domain.tld / dev2,…).
您还必须在每个redmine设置的config / initializers / session_store.rb中更改:key和:session_path.
<IfModule mod_ssl.c> <VirtualHost _default_:443> Servername domain.tld ServerAdmin webmaster@domain.tld DefaultinitEnv RAILS_ENV production DefaultinitEnv GEM_PATH /var/lib/gems/1.8 DocumentRoot /var/www/default-ssl <Directory /var/www/default-ssl> AuthType Basic AuthName "secure section" AuthUserFile /etc/apache2/htpasswd Require valid-user Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteRule ^$index.html [QSA] RewriteRule ^([^.]+)$$1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$dispatch.fcgi [QSA,L] ErrorDocument 500 "Application error Rails application Failed to start properly" AllowOverride None Order allow,deny allow from all </Directory> LogLevel warn ErrorLog /ssl_error.log CustomLog /ssl_access.log combined ServerSignature Off SSLEngine on SSLCertificateFile /etc/ssl/certs/domain.tld.crt SSLCertificateKeyFile /etc/ssl/private/domain.tld.key SSLCACertificateFile /etc/ssl/certs/domain.tld.ca <FilesMatch "\.(cgi|shtml|phtml|PHP)$"> SSLOptions +StdEnvVars </FilesMatch> browserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 browserMatch "MSIE [17-9]" ssl-unclean-shutdown Alias /dev1 /var/www/default-ssl/dev1/public <Directory /var/www/default-ssl/dev1/public> PassengerAppRoot /var/www/default-ssl/dev1 RailsBaseURI /dev1 Require user user1 user2 </Directory> Alias /dev2 /var/www/default-ssl/dev2/public <Directory /var/www/default-ssl/dev2/public> PassengerAppRoot /var/www/default-ssl/dev2 RailsBaseURI /dev2 Require user user1 </Directory> ... </VirtualHost> </IfModule>