我有问题让rails运行。我第一次使用nginx乘客而且无法正常工作。
无法访问此网站
我在phusionpassenger上关注tutorial,并检查了3次。而不是拉他们的demoapp我做了一个新的。
乘客安装:
sudo /usr/bin/passenger-config validate-install
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓
内存统计:
---------- Nginx processes -----------
PID PPID VMSize Private Name
--------------------------------------
28956 1 174.3 MB 0.5 MB nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
28961 28956 174.3 MB 0.6 MB nginx: worker process
### Processes: 2
### Total private dirty RSS: 1.16 MB
----- Passenger processes -----
PID VMSize Private Name
-------------------------------
28936 441.1 MB 1.2 MB Passenger watchdog
28939 654.1 MB 2.9 MB Passenger core
28945 449.3 MB 1.3 MB Passenger ust-router
### Processes: 3
### Total private dirty RSS: 5.43 MB
passenger.conf
passenger_ruby /usr/local/rvm/gems/ruby-2.4.0/wrappers/ruby;
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
添加了一行到nginx.conf
http {
...
include /etc/nginx/passenger.conf;
...
}
nginx应用设置:(quant.conf)
server {
listen 80;
server_name (AWS PUBLIC IP);
# Tell Nginx and Passenger where your app's 'public' directory is
root /home/ubuntu/quant/public;
rails_env production;
# Turn on Passenger
passenger_enabled on;
passenger_ruby /usr/local/rvm/gems/ruby-2.4.0/wrappers/ruby;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
感谢您提供任何帮助。