apache+jdk+tomcat安装笔记
作者: Jeffrey
出处: http://blog.zhangjianfeng.com/article/481
两种方式实现
第一种: pache2.2.3+jdk1.5.0_04+tomcat-5.5.9+proxy_ajp
jdk的安装和环境配置不写了,以前写过了.
tomcat的安装也不写了,就是解压后找一个合适的目录放过去就可以了.
apache的安装稍为有点不同
1).解压httpd-2.2.3.tar.gz,进入解压后目录的cd httpd-2.2.3/srclib/,依次安装apr和apr-util
# cd apr
# ./configure –prefix=/usr/local/apr
# make
# make install
# cd ../apr-util
# ./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr/
# make
# make install
2).安装apache
#./configure –prefix=/app/apache-2.2.3 –enable-so –enable-rewrite=share –enable-proxy=share –enable-proxy-ajp=share –enable-dav=share –with-apr=/usr/local/apr/ –with-apr-util=/usr/local/apr-util/
#make && make install
#apache2.2以后不用再jk2 ,用mod_proxy_ajp模块即可
3)配置,
可以写在httpd.conf,不过建议Include conf/xxx.conf,然后写这个文件,大概内容参见下面
NameVirtualHost *:80
<VirtualHost xxxx:80>
<Directory ” /app/tomcat/webapps/ROOT”>
DirectoryIndex index.jsp
</Directory>
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
ServerName xxxxxx
ServerAlias www
ErrorLog logs/xx-error_log
CustomLog logs/xx-access_log common
</VirtualHost>
第2种 apache-tomcat-6.0.16+jdk-1_5_0_14-linux-i586.bin+httpd-2.2.8+tomcat-connectors-1.2.26
安装APACHE
./configure –prefix=/app/apache-2.2.8 –enable-so –enable-rewrite && make && make install
安装TOMCAT
解压到指定目录下即可
安装JDK-1_5_0_14
chmod +x filename && ./filename
安装tomcat-connectors
cd native
./configure –with-apxs=/app/apache-2.2.8/bin/apxs (or where ever the apxs/apxs2 is)
make
make install
配置部分
# tail -1 httpd.conf
Include conf/mod_jk.conf
# more mod_jk.conf
LoadModule jk_module modules/mod_jk.so
JkWorkersFile “conf/workers.properties”
JkShmFile logs/mod_jk.shm
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount /*.jsp srv1
JkMount /*.do srv1
AddType application/x-jsp .jsp
more workers.properties
#[shm]
#file=logs/shm.file
#size=1048576
#[channel.socket:localhost:8009]
#tomcatId=localhost:8009
#[uri:/jsp-examples/*]
#workers.tomcat_home=/jeffrey/app/tomcat
#ps=\
worker.list=srv1
worker.srv1.port=8009
worker.srv1.host=localhost
worker.srv1.type=ajp13
worker.srv1.lbfactor=1
给tomcat增加管理用户
<tomcat-users>
<role rolename=”manager”/>
<role rolename=”admin”/>
<user username=”michael” password=”1234567″ roles=”manager,admin”/>
</tomcat-users>
Trackback URL: http://blog.zhangjianfeng.com/article/481/trackback
Tags: apache, jdk, tomcat, 安装, 笔记





















stone,我在2003下没配过,抱歉,你继续google试试
可以告诉我在window2003下如何安装吗??我试过N次了可就是不成功.
我在win2003下也是用
tomcat: apache-tomcat-5.5.20.zip
apache: Apache_httpd-2.2.3-win32-src.zip
mod_jk: mod_jk-apache-2.2.3.so
是不是在win下要用二进制的安装??
tomcat: apache-tomcat-5.5.20.exe
apache: apache_2.2.3-win32-x86-no_ssl.msi
modjk: mod_jk-apache-2.2.3.so
那些配置文件也照着做了,可是到最后http://localhost/ 与http://localhost:8080 的页面无法统一啊~~~
e-mail我,谢谢~
cxxdb@126.com