我有一个项目被从github拉到我的/ home分区,并按照惯例做了/ var分区的符号链接。
它看起来如何:
/ home / vagrant / github / whois-dreyfus – >回购实际项目
/ var / www / whois-dreyfus – >符号链接我用于Apache
我有Apache 2.2.22和Passenger 4.0.56安装在一个stream浪者的箱子里,并运行在远处的服务器上。 问题是,当通过我的私人networking访问它时,整个资源库都显示而不是索引。 这意味着如果说我有192.100.93.88指向Apache的索引页面 , 192.100.93.88/whois-dreyfus另一方面显示回购而不是项目的索引页。
此外,我已经使用Webrick在本地机器上testing了这个项目,所以我相信这个问题是来自web服务器。
那么,我如何运行我的rails应用程序?
这个问题是类似的这个线程,但我找不到任何答案导致我的问题。
这是我的configuration文件:
/etc/apache2/apache2.conf中
# Load the passenger module for Apache LoadModule passenger_module /opt/passenger/passenger-4.0.56/buildout/apache2$ <IfModule mod_passenger.c> PassengerRoot /opt/passenger/passenger-4.0.56 PassengerDefaultRuby /home/vagrant/.rvm/gems/ruby-2.2.0/wrappers/ruby </IfModule>
在/ etc / apache2的/启用的站点- /
<VirtualHost *:80> DocumentRoot /home/vagrant/github/whois-dreyfus/public RailsBaseURI /whois-dreyfus <Directory /home/vagrant/github/whois-dreyfus/public> # This relaxes Apache security settings. AllowOverride all # MultiViews must be turned off. Options -MultiViews # Uncomment this if you're on Apache >= 2.4: #Require all granted PassengerEnabled on Allow from all </Directory> </VirtualHost>
/ etc / hosts文件
192.168.100.88 app app whois-dreyfus
请告诉我,如果有什么不清楚和/或需要更好的解释。 谢谢。
我的猜测是,您仍然在/ etc / apache2 / sites-enabled中启用了默认站点,该站点具有/ var / www的DocumentRoot,这就是目前向您提供的内容。