2012-01-20 81 views
-3

我在ubuntu 10.04上安裝了passenger和nginx。Nginx的乘客重啓問題

這就是我的虛擬主機配置的外觀。

server { 
listen 80 default; 
server_name www.domain.com; 
root /rails_app/public; 
passenger_enabled on; 
} 

當我嘗試啓動nginx時出現以下錯誤。

/etc/nginx/sites-available $ 
=>sudo service nginx restart 
Restarting nginx: nginx: [emerg] unknown directive "passenger_enabled" in /etc/nginx/sites-enabled/001admin.domain.com:5 

我在這裏錯過了什麼。什麼是問題?

感謝 nginx的:配置文件/etc/nginx/nginx.conf測試失敗

回答

3

這只是意味着nginx的未經乘客的Phusion編譯支持。您需要重新編譯它,或爲您的發行版找到RPM/Deb數據包並將其安裝到系統中。

請按照下列指示安裝乘客模塊http://www.modrails.com/install.html

+0

多數民衆贊成在我做的第一個地方。 passenger-install-nginx-module後出現此錯誤。這個錯誤是否有其他可能的原因? 謝謝 – Prashanth

+0

您能提供命令「nginx -V」的輸出嗎? –

+0

我應該改變/etc/nginx/nginx.conf中的內容嗎? – Prashanth

-3
nginx version: nginx/0.7.65 
TLS SNI support enabled 
configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6 --add-module=/build/buildd/nginx-0.7.65/modules/nginx-upstream-fair 
+0

@Sergei Lomakov這是nginx -v – Prashanth

+0

這是什麼?這不是一個答案。 – holaSenor

0

你安裝乘客之前安裝nginx的?我在16.04遇到此問題,並通過sudo apt-get purge nginx後跟sudo apt-get install nginx解決。之後,我只需要取消註釋/etc/nginx/nginx.conf中的# include /etc/nginx/passenger.conf;