我第一次使用 CentOS 6.6 来部署 Rails 4 应用程序。我已经安装了所有必要的软件,如 MySQL、Ruby、Rails、Passenger、Apache2 等。我已经在 /var/www/html/index.html 中的 index.html 页面上对其进行了测试,并将其设置为 Apache 配置并完美运行。
当我部署 Rails 应用程序时,它确实在服务器上运行,但显示如下面的屏幕截图所示。
以下是我到目前为止所做的 Apache 配置设置。
/etc/httpd/conf/httpd.conf
LoadModule passenger_module /home/user/.rvm/gems/ruby-2.1.2/gems/passenger-5.0.6/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerDefaultRuby /home/user/.rvm/wrappers/ruby-2.1.2/ruby
PassengerRoot /home/user/.rvm/gems/ruby-2.1.2/gems/passenger-5.0.6
</IfModule>
我在 /etc/httpd/conf.d/ 中创建了一个文件 vhost.conf
<VirtualHost *:80>
ServerName myipaddress
DocumentRoot /var/www/html/projectname/public_html/current/public
<Directory /var/www/html/projectname/public_html/current/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
</Directory>
我在命令下面运行命令
service httpd restart
service httpd reload
Rails 应用程序既没有在服务器中运行,也没有显示任何错误。
任何解决方案将不胜感激。提前致谢。