你好,游客 登录 注册 搜索
背景:
阅读新闻

Apache2.2.22-Tomcat6.0.35-Connectors-1.2.23部署

[日期:2013-06-03] 来源:Linux社区  作者:yakson [字体:大 中 小]

1.安装文件

apache-tomcat-6.0.35.tar.gz

httpd-2.2.22.tar.gz

tomcat-connectors-1.2.23-src.tar.gz

2.安装步骤

1.上传apache-tomcat-6.0.35.tar.gz到/opt/sudytech
执行
#tar -xzvf apache-tomcat-6.0.35.tar.gz
解压出目录
apache-tomcat-6.0.35

启动,测试是否安装成功
[root@localhost sudytech]# /opt/sudytech/apache-tomcat-6.0.35/bin/startup.sh
Using CATALINA_BASE: /opt/sudytech/apache-tomcat-6.0.35
Using CATALINA_HOME: /opt/sudytech/apache-tomcat-6.0.35
Using CATALINA_TMPDIR: /opt/sudytech/apache-tomcat-6.0.35/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/sudytech/apache-tomcat-6.0.35/bin/bootstrap.jar
访问:http://127.0.0.1:8080/
如果不能访问,查看是不是开启了防火墙,关闭即可.
[root@localhost sudytech]# /etc/init.d/iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255
3 ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0
5 ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353
6 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631
7 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
8 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
9 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
10 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

[root@localhost sudytech]# /etc/init.d/iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@localhost sudytech]#

启动成功后,关闭tomcat进行下一步安装
[root@localhost sudytech]# /opt/sudytech/apache-tomcat-6.0.35/bin/shutdown.sh
Using CATALINA_BASE: /opt/sudytech/apache-tomcat-6.0.35
Using CATALINA_HOME: /opt/sudytech/apache-tomcat-6.0.35
Using CATALINA_TMPDIR: /opt/sudytech/apache-tomcat-6.0.35/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/sudytech/apache-tomcat-6.0.35/bin/bootstrap.jar

2.上传httpd-2.2.22.tar.gz到/opt/soft
[root@localhost sudytech]# tar -xzvf httpd-2.2.22.tar.gz
[root@localhost sudytech]# cd httpd-2.2.22
[root@localhost httpd-2.2.22]# ./configure --prefix=/opt/sudytech/apache2
[root@localhost httpd-2.2.22]#make
[root@localhost httpd-2.2.22]#make install

3.上传tomcat-connectors-1.2.23-src.tar.gz到/opt/soft
[root@localhost sudytech]# tar -xzvf tomcat-connectors-1.2.23-src.tar.gz
[root@localhost sudytech]# cd tomcat-connectors-1.2.23-src/native
[root@localhost native]# ./configure --prefix=/opt/sudytech/tomcat-connector --with-apxs=/opt/sudytech/apache2/bin/apxs
[root@localhost native]# make
[root@localhost native]# make install
在/opt/sudytech/apache2/modules/ 下会产生mod_jk.so

4.配置httpd.conf
内容如下
-----------------------------------------------------------
# 加载 mod_jk 模块
LoadModule jk_module modules/mod_jk.so
Include conf/mod_jk.conf
-----------------------------------------------------------

创建mod_jk.conf
内容如下
-------------------------------------------------------
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

JKMount /*.jsp worker1
-------------------------------------------------------
接下来我们在 Apache 的 conf 目录下新建两个文件分别是 workers.properties、uriworkermap.properties(可省略)
内容如下
-----------------------------------------------------------
worker.list=worker1

worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
-----------------------------------------------------------

附录1:httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin yakson@linuxidc.com
    DocumentRoot /opt/sudytech/t.hijor.com
    ServerName www.linuxidc.com
    ErrorLog logs/www.linuxidc.com-error_log
    CustomLog logs/www.linuxidc.com-access_log common
    RewriteEngine on
    <Directory /opt/sudytech/t.hijor.com>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin yakson@linuxidc.com
    DocumentRoot /opt/sudytech/ftproot/linuxidc
    ServerName linuxidc.com
    ErrorLog logs/linuxidc.com-error_log
    CustomLog logs/linuxidc.com-access_log common
    RewriteEngine on
    <Directory /opt/sudytech/ftproot/linuxidc>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款