如何在linux下安装tomcat
2017-05-21
展开全部
Tomcat的安装,需要自己先下载,然后
解压缩
# mkdir /usr/local/tomcat
# cd /usr/local/tomcat
# tar -zxvf /software/apache-tomcat-7.0.54.tar.gz
生成链接以便版本升级
# ln -s apache-tomcat-7.0.54 server
启动Tomcat
# cd /usr/local/tomcat/server/bin
# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/server
Using CATALINA_HOME: /usr/local/tomcat/server
Using CATALINA_TEMDIR: /usr/local/tomcat/server/temp
Using JRE_HOME: /usr/java/default
Using CLASS_PATH: /usr/local/tomcat/server/bin/bootstrap.jar:/usr/local/tomcat/server/bin/tomcat-juli.jar
Tomcat started.
测试Tomcat:
打开防火墙,使外部能访问
# /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
# service iptables save
# service iptables restart
或直接修改文件/etc/sysconfig/iptables.
# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
# service iptables restart
在浏览器输入: http://192.168.16.133:8080
如在本机可以输入: http://localhost:8080
出现tomcat的页面表示安装成功.
停止Tomcat
# ./shutdown.sh
解压缩
# mkdir /usr/local/tomcat
# cd /usr/local/tomcat
# tar -zxvf /software/apache-tomcat-7.0.54.tar.gz
生成链接以便版本升级
# ln -s apache-tomcat-7.0.54 server
启动Tomcat
# cd /usr/local/tomcat/server/bin
# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/server
Using CATALINA_HOME: /usr/local/tomcat/server
Using CATALINA_TEMDIR: /usr/local/tomcat/server/temp
Using JRE_HOME: /usr/java/default
Using CLASS_PATH: /usr/local/tomcat/server/bin/bootstrap.jar:/usr/local/tomcat/server/bin/tomcat-juli.jar
Tomcat started.
测试Tomcat:
打开防火墙,使外部能访问
# /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
# service iptables save
# service iptables restart
或直接修改文件/etc/sysconfig/iptables.
# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
# service iptables restart
在浏览器输入: http://192.168.16.133:8080
如在本机可以输入: http://localhost:8080
出现tomcat的页面表示安装成功.
停止Tomcat
# ./shutdown.sh
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询