歡迎您光臨本站 註冊首頁

apache +resin cluster配置文檔

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

apache +resin cluster配置文檔

供各位新手參考:



①、apache的安裝
建議不要採取拷貝的方式安裝apache,要在伺服器上重新進行編譯安裝。
I、下載APACHE安裝包
可以從以下地址獲取httpd-2.0.59.tar.gz:http://httpd.apache.org/download.cgi
II、解壓
tar –zxvf httpd-2.0.59.tar.gz
III、編譯安裝
./configure --prefix=/usr/webserver/apache --enable-module=so DFLAGS="-L/usr/lib64 -L/lib64"
LDFLAGS="-L/usr/lib64 -L/lib64"(64位操作系統需要添加該參數)
make
make install
編譯安裝apache至/usr/webserver/apache 並配置apache支持dso方式
②、resin的安裝
I、下載resin安裝包
可以從以下地址獲取resin-3.0.27:http://www.caucho.com/download/
II、解壓並安裝
Resin安裝包解壓完成後即可使用。
tar –zxvf resin-3.0.27.tgz
III、編譯生成mod_caucho.so
cd resin-3.0.27
./configure --with-apxs=/usr/webserver/apache/bin/apxs
(/usr/webserver/apache為apache的安裝路徑)
make
make install
說明:resin編譯完成後,/usr/webserver/apache/modules必須生成mod_caucho.so文件。

③、resin、apache配置
I、resin配置
Resin安裝完成後,編輯conf/resin.conf文件配置數據源。如下例所示:
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>
…… ……
<bind-ports-after-start/>
<http server-id="a" host="*" port="8065"/>
<http server-id="b" host="*" port="8066"/>
<http server-id="c" host="*" port="8067"/>
<http server-id="d" host="*" port="8068"/>
////// 這是resin集群的配置方式 ;此處是resin的HTTP訪問埠,埠號和id可自行定義 (埠號不能重複) //////
<cluster>
<srun server-id="a" host="192.168.1.17" port="6805"/>
<srun server-id="b" host="192.168.1.17" port="6806"/>
<srun server-id="c" host="192.168.1.17" port="6807"/>
<srun server-id="d" host="192.168.1.17" port="6808"/>
////// 這是resin集群的配置方式 ;此處是apache 和resin內部交互埠,埠號可自行定義,id保持和http的id相同(埠號不能重複) //////
</cluster>
…… ……
<database>
<jndi-name>jdbc/eesdb</jndi-name>
<driver type="oracle.jdbc.OracleDriver">
<url>jdbc:oracle:thin:@192.168.1.110:1521:appdb</url>
////// 數據源配置:192.168.1.110是資料庫伺服器IP;appdb是資料庫sid //////
<user>user</user> ///資料庫用戶名///
<password>pass </password> ///資料庫用戶密碼///
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>1000</max-connections>
<max-idle-time>130s</max-idle-time>
</database>
…… ……
<resin:set var="resin_admin_localhost" default="true"/>
<web-app id="/" document-directory="/usr/webserver/resin-3.0.27/webapps/"/>
////// 應用網上程序路徑 //////
</resin:if>
</host>
</server>
</resin>
II、安裝jdbc驅動

將資料庫伺服器$ORACLE_HOME/jdbc/lib/ojdbc14.jar拷貝到$RESIN_HOME/lib目錄
III、apache配置
Apache編譯完成後,編輯apache/conf/httpd.conf文件進行配置,如下例所示:
ServerRoot "/usr/webserver/apache"
PidFile logs/httpd.pid
Timeout 60
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 8
…… ……
Listen 80 //////配置apache監聽埠
User nobody
Group #-1
…… ……
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
LoadModule caucho_module /usr/webserver/apache/modules/mod_caucho.so
//////載入對resin的支持
#ResinConfigServer 192.168.1.68 16082
#ResinConfigServer 192.168.1.68 16083
#CauchoConfigCacheDirectory /tmp
CauchoHost 192.168.1.17 6805 ////配置部署resin伺服器IP和resin srun port下同////
CauchoHost 192.168.1.17 6806
CauchoHost 192.168.1.17 6807
CauchoHost 192.168.1.17 6808
CauchoStatus yes
…… ……
IV、apache、resin啟動
Resin的啟動與關閉
在/usr/webserver/resin-3.0.27/bin(假如resin安裝在這個目錄)下執行下面的命令,請注意resin文件目錄的所屬於的用戶組。
啟動:./httpd.sh  –server a start
關閉:./httpd.sh –server a stop
 可以將-Djava.awt.headless=true –server a參數添加到httpd.sh腳本中。

[火星人 ] apache +resin cluster配置文檔已經有448次圍觀

http://coctec.com/docs/service/show-post-18170.html