2012-09-14 29 views
0

我正在與rstudio EC2遠程服務器nginx的啓動,並尋求建立一個反向代理nginx的使用無法在ubuntu12.04(精確)與rstudio

當我開始文檔here中所示或者重新啓動nginx我會得到如下所示的錯誤信息。顯然,沒有其他任何東西在端口80上運行。我沒有安裝Apache或任何其他Web服務器。

[email protected]:~$ sudo fuser -k 80/tcp ; sudo /etc/init.d/nginx restart 
Restarting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 
nginx: [emerg] still could not bind() 
nginx. 

我加入ngnix.conf模塊是推薦的片段:

http { 
    server { 
    listen 80; 

    location/{ 
     proxy_pass http://localhost:8787; 
     proxy_redirect http://localhost:8787/ $scheme://$host/; 
    } 
    } 
} 

我曾嘗試用8080的代替80和ngnix開始罰款,但沒有連接到rstudio。 rstudio同時在8787上可用。感覺就像我在這裏錯過了一些非常簡單的事情。請幫助!!

回答

0

Aww快照。打完整個問題後才知道。 conf文件有一個包含不得不被註釋掉

include /etc/nginx/sites-enabled/*; 

完全變爲現在

#include /etc/nginx/sites-enabled/*; 

作品。有人@rstudio請更新我上面顯示的鏈接中的文檔

更新:請在下面的評論中查看@DirkEddelbuettel的回覆。正確的方法是將此代碼片段添加到「啓用網站」目錄中的相應文件中。

+2

我認爲你這樣做是錯誤的 - 我認爲你添加的配置應該在'sites-enabled'子目錄中的文件中。 –

+0

@DirkEddelbuettel你是對的。應該在啓用的網站文件夾中。更新我的答案。 – Generalenthu