【Web容器】Linux下Apache+Resin服务器的安装与配置
2015-07-03 17:28
716 查看
说明:以下安装过程基于Centos 5.4 (64位)操作系统。
1、首先安装apache
(1)下载apache,下载地址为:http://mirror.esocc.com/apache//httpd/httpd-2.2.26.tar.gz
(2)tar zxvf httpd-2.2.26.tar.gz
(3)cd httpd-2.2.26
(4)./configure --prefix=/usr/local/httpd --enable-module=so
(5)make && make install
(6)apache安装完成后,进入/usr/local/httpd/bin/目录下,执行./apachecl start命令启动apache
(7)访问http://127.0.0.1/页面查看apache服务是否安装正常。
2、安装Resin
(1)下载resin,下载地址为:http://www.caucho.com/download/resin-4.0.25.tar.gz
(2)tar zxvf resin-4.0.25.tar.gz
(3)cd resin-4.0.25
(4)./configure --prefix=/usr/local/resin --enable-64bit --with-apxs=/usr/local/httpd/bin/apxs (安装resin需指明apache的安装目录)
(5)make && make install
(6)进入apache目录 /usr/local/httpd/conf/目录下,查看httpd.conf文件如果发现以下内容,则表示整合成功。
LoadModule caucho_module /usr/local/httpd/modules/mod_caucho.so
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory /tmp
CauchoStatus yes
3、apache与resin的配置
(1)修改apache配置文件/usr/local/httpd/conf/httpd.conf修改其工程目录:
DocumentRoot "/data/resin"
<Directory
"/data/resin">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
修改完apache之后,同时修改resin的配置文件/usr/local/resin/conf/resin.xml 将以下部分中的root-directory改为你的工程目录与apache的工程目录相同。
<host id="" root-directory=".">
<web-app id="/" root-directory="/data/resin"/>
<resin:if
test="${resin_doc}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
</resin:if>
</host>
4、服务测试
(1)将你的测试工程test放到/data/resin目录下。
(2)进入resin目录/usr/local/resin/bin目录下执行./resinctl restart命令重启resin服务。
(3)访问http://127.0.0.1:8080/test/index.jsp可访问到index.jsp页面,说明resin服务配置正常。
(4)进入apache目录/usr/local/httpd/bin目录下执行./apachectl restart命令重启apache服务。
(5)同样访问http://127.0.0.1/test/index.jsp ,此时的端口号为apache的端口号,发现apache也可以解析jsp文件了,整合成功。
另外:可以通过修改apache的配置文件httpd.conf中的DirectoryIndex,将index.jsp加入进去,则可通过访问http://127.0.0.1/test/ 的方式访问web工程了。
1、首先安装apache
(1)下载apache,下载地址为:http://mirror.esocc.com/apache//httpd/httpd-2.2.26.tar.gz
(2)tar zxvf httpd-2.2.26.tar.gz
(3)cd httpd-2.2.26
(4)./configure --prefix=/usr/local/httpd --enable-module=so
(5)make && make install
(6)apache安装完成后,进入/usr/local/httpd/bin/目录下,执行./apachecl start命令启动apache
(7)访问http://127.0.0.1/页面查看apache服务是否安装正常。
2、安装Resin
(1)下载resin,下载地址为:http://www.caucho.com/download/resin-4.0.25.tar.gz
(2)tar zxvf resin-4.0.25.tar.gz
(3)cd resin-4.0.25
(4)./configure --prefix=/usr/local/resin --enable-64bit --with-apxs=/usr/local/httpd/bin/apxs (安装resin需指明apache的安装目录)
(5)make && make install
(6)进入apache目录 /usr/local/httpd/conf/目录下,查看httpd.conf文件如果发现以下内容,则表示整合成功。
LoadModule caucho_module /usr/local/httpd/modules/mod_caucho.so
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory /tmp
CauchoStatus yes
3、apache与resin的配置
(1)修改apache配置文件/usr/local/httpd/conf/httpd.conf修改其工程目录:
DocumentRoot "/data/resin"
<Directory
"/data/resin">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
修改完apache之后,同时修改resin的配置文件/usr/local/resin/conf/resin.xml 将以下部分中的root-directory改为你的工程目录与apache的工程目录相同。
<host id="" root-directory=".">
<web-app id="/" root-directory="/data/resin"/>
<resin:if
test="${resin_doc}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
</resin:if>
</host>
4、服务测试
(1)将你的测试工程test放到/data/resin目录下。
(2)进入resin目录/usr/local/resin/bin目录下执行./resinctl restart命令重启resin服务。
(3)访问http://127.0.0.1:8080/test/index.jsp可访问到index.jsp页面,说明resin服务配置正常。
(4)进入apache目录/usr/local/httpd/bin目录下执行./apachectl restart命令重启apache服务。
(5)同样访问http://127.0.0.1/test/index.jsp ,此时的端口号为apache的端口号,发现apache也可以解析jsp文件了,整合成功。
另外:可以通过修改apache的配置文件httpd.conf中的DirectoryIndex,将index.jsp加入进去,则可通过访问http://127.0.0.1/test/ 的方式访问web工程了。
相关文章推荐
- 【跟我学apache-commons】【四】commons-io的使用
- Apache虚拟主机搭建(单IP多网站服务器配置)
- 异常:java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap
- 25 个有用 Apache ‘.htaccess’ 技巧
- Apache CXF实战之七 使用Web Service传输文件
- 开源性能测试工具Apache ab使用
- 不能在本地计算机启动 apache2.2解决方法
- java servlet导出EXCEL并合并EXCEL相同值的单元格(Apache POI技术)
- apache 安装
- LAMP第二部分apache的配置
- LAMP第一部分安装mysql -apache -php
- phalcon第三个例子(日志类Logger)ubuntu14.04 apache通过apt-get安装
- centos7安装apache-ant-1.9.5-bin.tar.gz
- Centos 7 下Apache2.4关联php5.6.10
- Linux下apache源码安装
- Linux服务篇之三:构建Apache服务器
- 安装新版xampp后apache无法启动提示:Apache Service detected with wrong path解决方案
- Apache ServiceMix 介绍
- Zend Studio 如何配置本地apache服务器使用xdebug调试php脚本
- Apache JMeter安装说明