1、下载安装文件【apache-tomcat-6.0.41.tar.gz】到指定目录【/usr/local】
2、解压文件【tar -zxvf apache-tomcat-6.0.41.tar.gz】,然后【mv apache-tomcat-6.0.41.tar.gz tomcat】
3、若需要修改端口,可以修改tomcat/conf/server.xml文件,<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
4、web应用目录为tomcat/webapps目录
5、启动tomcat【tomcat/bin/startup.sh】
为tomcat配置环境变量
1 新建环境变量JAVA_HOME值为C:Program FilesJavajdk1.8.0_91
2 修改Path,追加%JAVA_HOME%in
3 新建环境变量CLASSPATH值为【.;%JAVA_HOME%libdt.jar;%JAVA_HOME%lib ools.jar;】
----------------------------------
tomcat与apache使用ajp_proxy模块整合
---------------------------------
1 apache配置开启虚拟主机
1.1 httpd.conf中LoadModule vhost_alias_module modules/mod_vhost_alias.so放开
1.2 httpd-vhosts.conf中配置如下
<VirtualHost *:80>
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs2"
ServerName www.zhang.com
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs2">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
2 整合
2.1 httpd.conf中去掉以下三项前的#
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
2.2 httpd-vhosts.conf中配置如下
<VirtualHost *:80>
ProxyPass / ajp://127.0.0.1:8009/
ProxyPassReverse / ajp://127.0.0.1:8009/
ServerName www.xue.com
</VirtualHost>
--------------------------------------
Tomcat开机启动
D:apache-tomcat-7.0.70-windows-x64apache-tomcat-7.0.70in>service.bat install Tomcat