[root@resin-server ~]# cp /usr/local/resin/contrib/init.resin.in /etc/init.d/resin [root@resin-server ~]# vim /etc/init.d/resin
修改前:修改后:
注:引入java变量和指定sever名称
[root@resin-server ~]# chmod +x /etc/init.d/resin [root@resin-server ~]# killall java [root@resin-server ~]# /etc/init.d/resin start
四、安装httpd[root@httpd-server ~]#yum install -y zlib libmxl libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel ng-devel gd-devel curl-devel [root@httpd-server~]#wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.34.tar.gz [root@httpd-server ~]#tar xf httpd-2.2.34.tar.gz [root@httpd-server ~]#cd httpd-2.2.34 [root@httpd-server httpd-2.2.34]#./configure --prefix=/usr/local/httpd --enable-deflate --enable-headers --enable-modules=so --enable-so --with-mpm=worker --enable-rewrite [root@httpd-server httpd-2.2.34]#make &&make install
编译生成resin的httpd模块
[root@httpd-server ~]# wget http:// [root@httpd-server ~]# tar xf resin-3.1.13.tar.gz [root@httpd-server ~]# cd resin-3.1.13 [root@httpd-server resin-3.1.13]# ./configure --with-apxs=/usr/local/httpd/bin/apxs [root@httpd-server resin-3.1.13]# cd modules/c/src/ [root@httpd-server src]# make&&make install [root@httpd-serverr src]# ll /usr/local/httpd/modules/ #查看模块是否生成 总用量 180 -rw-r--r-- 1 root root 9291 1月 2 20:00 httpd.exp -rwxr-xr-x 1 root root 170915 1月 2 20:16 mod_caucho.so [root@httpd-server src]# tail /usr/local/httpd/conf/httpd.conf #查看httpd配置文件是否生成resin配置命令 </IfModule> # # mod_caucho Resin Configuration # LoadModule caucho_module /usr/local/httpd/modules/mod_caucho.so ResinConfigServer localhost 6800 CauchoConfigCacheDirectory /tmp CauchoStatus yes
编辑httpd配置文件,使其可以将请求转发至resin服务器
[root@httpd-server src]# tail /usr/local/httpd/conf/httpd.conf # # mod_caucho Resin Configuration # LoadModule caucho_module /usr/local/httpd/modules/mod_caucho.so ResinConfigServer 192.168.0.11 8888 CauchoConfigCacheDirectory /tmp CauchoStatus yes SetHandler cacucho-request #加上SetHandler caucho-request是全部将请求转发到resin,不加仅有PHP jsp类型转发 [root@httpd-server src]# /usr/local/httpd/bin/apachectl start #启动httpd服务 httpd: apr_sockaddr_info_get() failed for httpd-server #错误提示原因:这个问题是没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [root@httpd-server src]# netstat -tnlp #检查端口是否启动
测试
浏览器访问
浏览器访问
最终结果看,配置成功了!