2011-08-10 56 views
0

我有一個關於爲我安裝的Redmine配置apache的問題。用於在URL子目錄中安裝Redmine的Apache配置

我已經成功安裝了Redmine(v 1.2.1)目錄,併成功運行了/usr/local/lib/目錄。我想配置apache,以便通過http://myhost/redmine訪問Redmine,而我已經安裝了一個基於wordpress的網站/var/www綁定到http://myhost/。我該怎麼辦?

這裏我目前的Apache配置(/etc/apache2/sites-enabled/001-redmine):

<VirtualHost *:80> 
     ServerName myhost 
     DocumentRoot /usr/local/lib/redmine-1.2.1/public 
     ServerSignature off 

     <Directory /> 
       Order Deny,Allow 
       Deny from all 
     </Directory> 
     <Directory /usr/local/lib/redmine-1.2.1/public> 
       AllowOverride None 
       Order allow,deny 
       Allow from all 
       Options Indexes ExecCGI FollowSymLinks 
       Options -MultiViews 
     </Directory> 
     ErrorLog /var/log/apache2/redmine-error.log 
     CustomLog /var/log/apache2/redmine-access.log combined 
</VirtualHost> 

感謝。

回答

0

我用Ruby插件的Phusion Passenger。然後我將公共文件夾鏈接到/ var/www/redmine。

我的Apache配置有:

RailsBaseURI /redmine 
<Directory /var/www/redmine> 
    Options -MultiViews 
</Directory> 
0

我前一陣子有同樣的問題,並保持一些注意事項。根據我的想法,將Redmine雜種隱藏在myhost/redmine dir後面並不是完全可能的。誠然,Apache可以通過設置它下面的方式作爲一個網關作用:

ProxyPass /redmine/ http://myhost:4000/ 
ProxyPassReverse /redmine http://myhost:4000 
ProxyPreserveHost on 

但是,如果通過管理平臺返回的HTML包含相對路徑,而不是一個單一的絕對路徑,這隻會工作。假設一個Redmine頁面/dir1/whatever.html引用了一個CSS文件/resources/styles.css。客戶端將HTML頁面視爲/redmine/dir1/whatever.html。如果CSS引用是相對的,則客戶端請求/redmine/css/styles.css,Apache會將其作爲/css/styles.css轉發給代理。但是,如果引用是絕對的,那麼客戶端會請求/css/styles.css,並且Apache不會爲其執行代理。故事結局。

注意:有一個第三方模塊mod_proxy_html解析HTML並重寫引用。但它不會出現在大多數服務器上。

解決方案似乎是301將/ redmine目錄中的任何請求明確地重定向到http://myhost:4000(應該可以使用mod_rewrite)的Mongrel。