CentOS 6.4 64位 安装 apache-tomcat-6.0.43

下载 tomcat: 

  地址:http://mirrors.hust.edu.cn/apache/tomcat/tomcat-6/v6.0.43/bin/apache-tomcat-6.0.43.tar.gz

解压软件包

[root@test1 files]# tar zxvf apache-tomcat-6.0.43.tar.gz

将解压好的文件夹移动到指定目录

[root@test1 files]# mv apache-tomcat-6.0.43 /usr/

配置环境变量

[root@test1 ~]# vi /etc/profile
export CATALINA_HOME=/usr/apache-tomcat-6.0.43
export CATALINA_HOME

使修改生效

[root@test1 ~]#source /etc/profile

启动 tomcat 

[root@test1 ~]# /usr/apache-tomcat-6.0.43/bin/startup.sh

停止 tomcat

[root@test1 ~]# /usr/apache-tomcat-6.0.43/bin/shutdown.sh

注:如果其他机器无法访问,则有可能是防火墙配置问题。

配置防火墙开放8080端口:


[root@test1 ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

重启防火墙使配置生效

[root@test2 ~]# service iptables restart
iptables:清除防火墙规则:                                 [确定]
iptables:将链设置为政策 ACCEPT:filter                    [确定]
iptables:正在卸载模块:                                   [确定]
iptables:应用防火墙规则:                                 [确定]

重新访问验证。

原文地址:https://www.cnblogs.com/cnblank/p/4409511.html