一、先安装JDK我安装的是1.7版本
tarzxfjdk-7u45-linux-i586.tar.gz-C/usr/local/
然后更改环境变量
vi/etc/profile
#exportJAVA_HOME=/usr/local/jdk1.7.0_45
#exportJRE_HOME=$JAVA_HOME/jre#exportCLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib#exportPATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/binsource/etc/profile使配置生效
最后进行测试java-version输出版本号就安装正确
二、安装apache-tomcat-6.0.37
tarxzfapache-tomcat-6.0.20.tar.gz-C/usr/local/
cd/usr/local/
ln-sapache-tomcat-6.0.20/tomcat
vi/etc/profile
#TOMCAT_HOME=/usr/local/tomcat
#exportPATHTOMCAT_HOME
source/etc/profile
三、安装apache
tarzxfapache-2.2.13.tar.gz-C/usr/local
cd/usr/local/http-2.2.13
./configure--prefix=/usr/local/apache2--enable-so--enable-rewrite
make&&makeinstall
四、安装jkconnects
安装jkconnector
wgethttp://labs.xiaonei.com/apache-mirror/tomcat/tomcat-connectors/jk/source/jk-1.2.28/tomcat-connectors-1.2.28-src.tar.gz
tarxfztomcat-connectors-1.2.28-src.tar.gz-C/usr/local/src/
cd/usr/local/src/tomcat-connectors-1.2.28-src/
cdnative/
./configure–with-apxs=/usr/local/httpd/bin/apxs
make
cpapache-2.0/mod_jk.so/usr/local/httpd/modules/
apche配置
vim/usr/local/httpd/conf/extra/httpd-vhosts.conf
LoadModulejk_modulemodules/mod_jk.so
Include/usr/local/httpd/conf/mod_jk.conf
<VirtualHost*:80>
JkMountCopyOn
ServerNameedu.veryi.com
DirectoryIndexindex.jspindex.htmlindex.jspindex.htm
DocumentRoot/usr/local/tomcat/webapps/ROOT
#DocumentRoot/usr/local/www/edu.veryi.com/html
#<Directory/usr/local/www/edu.veryi.com>
<Directory/usr/local/tomcat/webapps/ROOT>
Orderallow,deny
Allowfromall
</Directory>
CustomLog"|/usr/local/sbin/cronolog/var/log/httpd/edu.veryi.com-access_log.%Y%m%d"combined
ErrorDocument404/missing.html
</VirtualHost>
vim/usr/local/httpd/conf/mod_jk.conf
JkWorkersFile/usr/local/httpd/conf/workers.properties
#Wheretoputjklogs
JkLogFile/usr/local/httpd/logs/mod_jk.log
#Setthejkloglevel[debug/error/info]
JkLogLevelinfo
#Selectthelogformat
JkLogStampFormat"[%a%b%d%H:%M:%S%Y]"
#JkOptionsindicatetosendSSLKEYSIZE,
JkOptions+ForwardKeySize+ForwardURICompat-ForwardDirectories
#JkRequestLogFormatsettherequestformat
JkRequestLogFormat"%w%V%T"
#servlet和jsp请求通过ajp13的协议送给Tomcat
JkMount/servlet/*worker1
JkMount/*.jspworker1
——————————
/usr/local/httpd/conf/workers.properties
#Definingaworkernamedworker1andoftypeajp13
worker.list=worker1
#Setpropertiesforworker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
#worker.worker1.lbfactor=50
#worker.worker1.socket_keepalive=1
#worker.worker1.socket_timeout=300
tomcat配置
vim/usr/local/tomcat/conf/server.xml
<Hostname="edu.veryi.com"
unpackWARs="true"autoDeploy="true"><Contextpath=""docBase="/usr/local/tomcat/webapps/ROOT"/><ValveclassName="org.apache.catalina.valves.AccessLogValve"directory="logs"
prefix="tomcat_access_log."suffix=".log"pattern="common"resolveHosts="false"/><LoggerclassName="org.apache.catalina.logger.FileLogger"directory="logs"
prefix="tomcat_file_log."suffix=".log"timestamp="true"/>
</Host>