我剛纔用的Nginx設置乘客,它似乎安裝罰款,但是當我運行它,我嘗試啓動它:問題開始客運nginx的
passenger start -e production
我得到:
=============== Phusion Passenger Standalone web server started ===============
PID file: /root/rails_apps/myapp/tmp/pids/passenger.3000.pid
Log file: /root/rails_apps/myapp/log/passenger.3000.log
Environment: production
Accessible via: http://0.0.0.0:3000/
You can stop Phusion Passenger Standalone by pressing Ctrl-C.
===============================================================================
2011/04/18 07:17:27 [error] 9125#0: *4 "/root/rails_apps/myapp/public/index.html" is forbidden (13: Permission denied), client: 127.0.0.1, server: _, request: "HEAD/HTTP/1.1", host: "0.0.0.0"
當我嘗試在瀏覽器中訪問我的網站時,我收到「無法連接」。
這裏是nginx.conf
server {
listen 80;
server_name myapp.com;
root /root/rails_apps/myapp/public; # <--- be sure to point to 'public'!
passenger_enabled on;
}
任何想法配置?
我以root身份運行 – Tam 2011-04-18 21:38:41
嘗試改變'/根/ rails_apps/MYAPP/public'目錄的權限爲755 – Surya 2011-04-19 12:14:19
@Surya它改爲755是一個壞主意,這是可行的,但它不是理想的生產環境。您可能只需將有問題的文件翻譯成nginx:nginx或使用nginx運行nginx,同時保留文件644。 – Alfie 2015-02-10 06:37:30