Linux下部署 tomcat服务器

来源:互联网 发布:软件开发难吗 编辑:程序博客网 时间:2024/05/16 16:24

tar zxvf apache-tomcat-7.0.82.tar.gz //解压tomcat 服务器

进入tomcat中的bin,并启动tomcat。
./startup.sh

在windows中要访问tomcat,需要关闭防火墙
centos 7关闭方式:
systemctl stop firewalld

vim /etc/profile //添加tomcat 环境变量
CATALINA_HOME=/usr/tomcat/apache-tomcat-7.0.82
export JAVA_HOME JRE_HOME PATH CLASSPATH CATALINA_HOME

chmod -R 777 /usr/tomcat/apache-tomcat-7.0.82/bin/ //给bin目录授权

vim /etc/sysconfig/iptables // 开放8080 端口

添加以下内容

-A INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT

1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd –state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

http://blog.csdn.net/xlgen157387/article/details/52672988

curl loacalhost:8080 //可以看是否可以访问到,一般下载的是主页

netstat -ano | findstr :8080 //查看8080 端口是否被监听

外网不能访问阿里云部署的服务问题总结:
需要在管理面板里添加安全组,centOS7 换防火墙,打开需要开放的端口

参考链接:
https://help.aliyun.com/knowledge_detail/59367.htmlhttps://help.aliyun.com/knowledge_detail/59367.html
https://help.aliyun.com/knowledge_detail/40744.html
https://help.aliyun.com/document_detail/25475.html

原创粉丝点击