我正在尝试使用apache2和mod_rails(Phusion Passenger)在ubuntu10.10上的rails服务器上设置ruby.
我已经安装了ruby 1.9.2-p0和rails 3.0.8,并使用passenger-install-apache2-module和passenger gem(v3.0.7)安装了Passenger.
然后它告诉我在我的Apache配置文件中添加3行.所以我将这些行添加到'/etc/apache2/apache2.conf'中:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/gems/1.9.1/gems/passenger-3.0.7
PassengerRuby /usr/local/bin/ruby
Run Code Online (Sandbox Code Playgroud)
我编辑了我的'/etc/apache2/httpd.conf'并添加了:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName 192.168.0.2
DocumentRoot /var/www/webop/public
<Directory /var/www/webop/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我还发现/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/ext/apache2/中的文件mod_passenger.so实际上不存在,其名称为mod_passenger.c.但我没有从中得到任何错误.
服务器只能通过LAN访问.当我访问服务器时,我看到我的应用程序的公共文件夹中的所有文件和目录,但应用程序本身没有开始.
当我重新启动apache它告诉我mod_rails已经加载所以我猜这个乘客正在运行,但我无法弄清楚为什么它不启动我的应用程序!
提前致谢!