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