作者:广工华立城建学部艺术团 | 来源:互联网 | 2014-05-21 13:41
apache和tomcat整合需要的软件包:httpd-2.2.21.tar.gztomcat-connectors-1.2.32-src.tar.gzjdk-7-linux-x64.rpmapache-tomcat-7.0.23.tar.gz首先安装gcc做编译前的环境。。www.2cto.com首先rpm-ivh.
apache和tomcat整合
需要的软件包:httpd-2.2.21.tar.gz tomcat-connectors-1.2.32-src.tar.gz jdk-7-linux-x64.rpm apache-tomcat-7.0.23.tar.gz
首先安装gcc做编译前的环境。。
www.2cto.com
首先rpm -ivh jdk-7-linux-x64.rpm 安装完成以后 创建一个连接 ln -s /usr/java/jdk1.7.0/ /usr/jdk
编译apache
tar zxvf httpd-2.2.21.tar.gz -C /usr/local/src/
cd /usr/local/src/httpd-2.2.21/
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-proxy --enable-proxy-ajp
make && make install
编译tomcat-connectors-1.2.32-src.tar.gz
tar zxvf tomcat-connectors-1.2.32-src.tar.gz -C /usr/local/src/
cd /usr/local/src/tomcat-connectors-1.2.32-src/
cd native/
./configure --with-apxs=/usr/local/apache2/bin/apxs
make && make install
解压apache-tomcat-7.0.23.tar.gz
tar zxvf apache-tomcat-7.0.23.tar.gz -C /usr/local/src/
cd /usr/local/src/apache-tomcat-7.0.23/
vim -o startup.sh shutdown.sh
在启动和关闭文件分别添加:export JAVA_HOME=/usr/jdk
然后到tomcat的webapss里面创建一个文件夹叫
jsp
cd到jsp里面
vim index.jsp
打开添加 <%=new java.util.Date() %>
修改tomcat配置文件
vim /usr/local/src/apache-tomcat-7.0.23/conf/server.xml
修改以下内容
cd /usr/local/apache2/htdocs
mkdir www
echo "111111111111111" > index.
html
cd /usr/local/apache2/conf
vim httpd.conf
修改Directoryindex index.jsp index.html
添加
include conf/extra/httpd-vhost.conf
include conf/extra/httpd-jk.conf
cd extra
vim httpd-vhost.conf
vim httpd-jk.conf
vim workers.properties
重新启动apache tomcat
测试: