- 论坛徽章:
- 17
|
供各位新手参考:
①、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 racle: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脚本中。 |
|