apache-tomat-8.5.55.tar.gz
放在\root
目录下面/usr/local
下建立tomcat
文件夹,并进入,解压安装包到这个目录[root@localhost ~]# cd /usr/local [root@localhost local]# mkdir tomcat [root@localhost local]# cd tomcat [root@localhost tomcat]# tar -zxvf /root/apache-tomcat-8.5.55.tar.gz -C ./
[root@localhost tomcat]# cd apache-tomcat-8.5.55/ [root@localhost apache-tomcat-8.5.55]# cd bin [root@localhost bin]# ./startup.sh [root@localhost bin]# firewall-cmd --zone=public --add-port=8080/tcp --permanent [root@localhost bin]# firewall-cmd --reload
tomcat
文件[root@localhost bin]# cd /etc/rc.d/init.d/ [root@localhost init.d]# touch tomcat [root@localhost init.d]# chmod +x tomcat
#!/bin/bash #chkconfig:- 20 90 #description:tomcat #processname:tomcat TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-8.5.55 case $1 in start) su root $TOMCAT_HOME/bin/startup.sh;; stop) su root $TOMCAT_HOME/bin/shutdown.sh;; *) echo "require start|stop";; esac
[root@localhost init.d]# service tomcat start [root@localhost init.d]# service tomcat stop
[root@localhost tomcat]# chkconfig --add tomcat [root@localhost tomcat]# chkconfig tomcat on
service命令用于对系统服务进行管理,好比启动(start)、中止(stop)、重启(restart)、查看状态(status)等。
service命令自己是一个shell脚本,它在/etc/init.d/目录查找指定的服务脚本,而后调用该服务脚原本完成任务。
service运行指定服务(称之为System V初始脚本)时,把大部分环境变量去掉了,只保留LANG和TERM两个环境变量,而且把当前路径置为/,也就是说是在一个能够预测的很是干净的环境中运行服务脚本。这种脚本保存在/etc/init.d目录中,它至少要支持start和stop命令。
引自:http://www.javashuo.com/article/p-fprxscug-mn.htmlhtml
chkconfig命令用来更新(启动或中止)和查询系统服务的运行级信息。谨记chkconfig不是当即自动禁止或激活一个服务,它只是简单的改变了符号链接。
使用语法:
chkconfig [--add][--del][--list][系统服务] 或 chkconfig [--level <等级代号>][系统服务][on/off/reset]
chkconfig 在没有参数运行时,显示用法。若是加上服务名,那么就检查这个服务是否在当前运行级启动。若是在服务名后面指 定了on,off或者reset,那么chkconfi 会改变指定服务的启动信息。on和off分别指服务被启动和中止,reset指重置服务的启动信息,不管有问题的初始化脚本指定了什么。on和off开 关,系统默认只对运行级3,4,5有效,可是reset能够对全部运行级有效。
参数用法:
–add 增长所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增长相关数据。
–del 删除所指定的系统服务,再也不由chkconfig指令管理,并同时在系统启动的叙述文件内删除相关数据
–level<等级代号> 指定读系统服务要在哪个执行等级中开启或关毕
等级0表示:表示关机
等级1表示:单用户模式
等级2表示:无网络链接的多用户命令行模式
等级3表示:有网络链接的多用户命令行模式
等级4表示:不可用
等级5表示:带图形界面的多用户模式
等级6表示:从新启动
引自:http://www.ttlsa.com/linux-command/linux-chkconfig-1/java
nginx-1.17.10.tar.gz
放在\root
下面/usr/local/
下建立nginx
文件夹并进入解压[root@localhost ~]# cd /usr/local [root@localhost local]# mkdir nginx [root@localhost local]# cd nginx/ [root@localhost nginx]# tar zxvf /root/nginx-1.17.10.tar.gz -C ./ [root@localhost nginx]# cd nginx-1.17.10/ [root@localhost nginx-1.17.10]# yum -y install pcre-devel^C
[root@localhost nginx-1.17.10]# yum -y install pcre-devel [root@localhost nginx-1.17.10]# yum -y install openssl openssl-devel
[root@localhost nginx-1.17.10]# ./configure [root@localhost nginx-1.17.10]# make && make install
/usr/local/nginx/sbin/ngix
[root@localhost nginx-1.17.10]# /usr/local/nginx/sbin/nginx [root@localhost nginx-1.17.10]# /usr/local/nginx/sbin/nginx -s stop [root@localhost nginx-1.17.10]# /usr/local/nginx/sbin/nginx -s reload
/usr/local/nginx/conf/nginx.conf
http:192.168.1.9:80
便可[root@localhost nginx-1.17.10]# yum install -y docker [root@localhost nginx-1.17.10]# systemctl start docker.service [root@localhost nginx-1.17.10]# docker version
[root@localhost nginx-1.17.10]# systemctl enable docker.service [root@localhost nginx-1.17.10]# docker pull mysql
docker
镜像速度[root@localhost nginx-1.17.10]# vim /etc/docker/daemon.json
{ "registry-mirrors":["http://hub-mirror.c.163.com"] }
[root@localhost nginx-1.17.10]# systemctl daemon-reload [root@localhost nginx-1.17.10]# systemctl restart docker.service
systemctl 提供了一组子命令来管理单个的 unit,其命令格式为:
systemctl [command] [unit]
command 主要有:
start:马上启动后面接的 unit。
stop:马上关闭后面接的 unit。
restart:马上关闭后启动后面接的 unit,亦即执行 stop 再 start 的意思。
reload:不关闭 unit 的状况下,从新载入配置文件,让设置生效。
enable:设置下次开机时,后面接的 unit 会被启动。
disable:设置下次开机时,后面接的 unit 不会被启动。
status:目先后面接的这个 unit 的状态,会列出有没有正在执行、开机时是否启动等信息。
is-active:目前有没有正在运行中。
is-enable:开机时有没有默认要启用这个 unit。
kill :不要被 kill 这个名字吓着了,它实际上是向运行 unit 的进程发送信号。
show:列出 unit 的配置。
mask:注销 unit,注销后你就没法启动这个 unit 了。
unmask:取消对 unit 的注销。
引自:http://www.javashuo.com/article/p-ovpoctwv-m.htmlmysql