1. 程式人生 > >nginx-nginx叢集配置詳解

nginx-nginx叢集配置詳解

tomcat專案下配置nginx叢集步驟詳解:

1.複製nginx-1.6.0資料夾到指定目錄,例D:\nginx\nginx-1.6.0。

2.修改E:\apache-tomcat-6.0.36\conf\server.xml,在源註釋的<Cluster>標籤下,增加<Cluster></Cluster>標籤,修改<Receive>標籤address屬性值為本機ip,其他叢集tomcat配置不同port埠號。

 

3.修改E:\apache-tomcat-6.0.36\webapps\commonApp\WEB-INF\web.xml在</web-app>前加上<distributable/>

 

4.配置nginx.conf

         4.1配置需要搭建叢集的服務的ip和埠號

         4.2複製專案pages和resources資料夾到D:\nginx\nginx-1.6.0\html\commonApp下,

做為快取檔案,可以自定義修改快取檔案類別。

         4.3修改nginx對外訪問的ip與埠號

5.cmd定位中到nginx目錄,輸入startnginx啟動服務。

6.關閉其他服務的定時器功能,保證一個服務啟動即可