Apache2 Ruby on Rails和Redmine改变铁路应用程序的url

你好我成功地设置了我的Redmine服务器(Ubuntu 12.04LTS,Apache2,Passenger,Mysql使用指南在http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu )。 但是我遇到了一个小问题。 我很想进入我的服务器的内部IP地址到浏览器的地址栏,并访问该网站,但我必须inputip_address / redmine,我不能portfoward到路由器。 目前,如果我在浏览器中使用我的网站www.example.net或ip_address,我将得到默认的apache2“it works”(index.html)页面。

我包括我的configuration文件,因为我还没有find其他使用相同的设置的例子,只需要更多的configuration文件,如果你需要它们。 另外,如果有任何额外的不必要的东西,请告诉我,所以我可以删除它

这是我的ports.conf文件:

NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to <VirtualHost *:443> # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> 

这是我在/ etc / apache2 / sites-enabled /

 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /var/www/redmine> RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on </Directory> <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 ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> 

由于某种原因httpd.conf是空的

您正在使用Passenger来服务Rails应用程序。

试着改变你的文档根目录:

 DocumentRoot /var/www/redmine/public <Directory /var/www/redmine/public> Allow from all Options -MultiViews </Directory> 

当然重新加载Apache服务。

如果这还不够,请阅读Passenger文档以在虚拟主机根目录上发布: http : //www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_to_a_virtual_host_8217_s_root