安装Tomcat
进入
# cd /usr/local/tomcat
# wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.94/bin/apache-tomcat-7.0.94-fulldocs.tar.gz
官网下载地址:http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.94/bin/apache-tomcat-7.0.94-fulldocs.tar.gz
(如果下载有问题,请到官网:http://tomcat.apache.org/ 下载)
解压文件:tar -zxvf apache-tomcat-7.0.94-fulldocs.tar.gz
移动到根目录下:mv apache-tomcat-7.0.82 /
运行 tomcat :./startup.sh
关闭 tomcat: ./shutdowm.sh
登录
cd /usr/local/tomcat/bin 进入bin
./shutdown.sh 关闭
ps -ef|grep java 查看Tomcat是否以关闭
./startup.sh 启动Tomcat
防火墙
启动防火墙:systemctl start firewalld.service
查开方端口:firewall-cmd --zone=public --list-ports
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed
3.配置firewalld-cmd
Redis
启动Redis:/usr/local/bin/redis-server /usr/local/redis/redis.conf