Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何在CentOs上使用Passenger和Apache激活Rails_Ruby On Rails_Apache_Passenger - Fatal编程技术网

Ruby on rails 如何在CentOs上使用Passenger和Apache激活Rails

Ruby on rails 如何在CentOs上使用Passenger和Apache激活Rails,ruby-on-rails,apache,passenger,Ruby On Rails,Apache,Passenger,我已经为此挣扎了好几个小时了。这是我第一次尝试建立服务器 我安装了rails、passenger和apache。 在httpd.conf中,我写道: ServerRoot "/etc/httpd" # Here I wrote the IP address, since I still did not manage the DNS Listen ##.##.##.94:80 ServerAdmin root@localhost ServerName ##.##.##.94:80 # Do I n

我已经为此挣扎了好几个小时了。这是我第一次尝试建立服务器

我安装了rails、passenger和apache。 在httpd.conf中,我写道:

ServerRoot "/etc/httpd"
# Here I wrote the IP address, since I still did not manage the DNS
Listen ##.##.##.94:80
ServerAdmin root@localhost
ServerName ##.##.##.94:80 # Do I need this?

<Directory />
    AllowOverride none
    Require all denied
    Options Indexes FollowSymLinks Includes ExecCGI
</Directory>

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-4.0.59/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-4.0.59
     PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby
   </IfModule>

<VirtualHost *:80>
      ServerName ##.##.##.##
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /var/www/blah_blah/public_html/public
      <Directory  /var/www/blah_blah/public_html>
         # 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>
</VirtualHost>
我得到一个200的回复,这意味着它是好的


故障在哪里?

我认为您应该更改端口:

<VirtualHost *:3000>


因为当您运行rails s时,它会在端口3000上运行。

这两个文件夹需要相同。DocumentRoot/var/www/blah_blah/public_html/public我也试过了。无效。请尝试删除服务器名。因为它是空白的,如果没有就更好了。
<VirtualHost *:3000>