[root@localhost shell]# vim lnmp.sh
#!/bin/bash
yum -y install httpd ----安裝http
yum -y install mariadb mariadb-devel mariadb-server ---安裝資料庫
yum -y install php php-mysql ----安裝php依賴包
systemctl start httpd ------開啟http服務
systemctl enable httpd ------設定自動開啟httpd服務
systemctl status httpd -----檢視http的服務狀態
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
執行指令碼的效果圖(在執行的時候確保yum中有相關的包)
[root@localhost shell]# sh lnmp.sh
已載入外掛程式:langpacks, product-id, search-disabled-repos, subscription-manager
this system is not registered with an entitlement server. you can use subscription-manager to register.
軟體包 httpd-2.4.6-67.el7.x86_64 已安裝並且是最新版本
無須任何處理
已載入外掛程式:langpacks, product-id, search-disabled-repos, subscription-manager
this system is not registered with an entitlement server. you can use subscription-manager to register.
軟體包 1:mariadb-5.5.56-2.el7.x86_64 已安裝並且是最新版本
軟體包 1:mariadb-devel-5.5.56-2.el7.x86_64 已安裝並且是最新版本
軟體包 1:mariadb-server-5.5.56-2.el7.x86_64 已安裝並且是最新版本
無須任何處理
已載入外掛程式:langpacks, product-id, search-disabled-repos, subscription-manager
this system is not registered with an entitlement server. you can use subscription-manager to register.
軟體包 php-5.4.16-42.el7.x86_64 已安裝並且是最新版本
軟體包 php-mysql-5.4.16-42.el7.x86_64 已安裝並且是最新版本
無須任何處理
active: active (running) since 六 2018-07-21 20:16:27 cst; 125ms ago
7月 21 20:16:27 localhost.localdomain systemd[1]: starting the apache http server...
7月 21 20:16:27 localhost.localdomain httpd[7865]: ah00558: httpd: could not reliably determine the server's fully q...ssage
7月 21 20:16:27 localhost.localdomain systemd[1]: started the apache http server.
hint: some lines were ellipsized, use -l to show in full.
created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
● mariadb.service - mariadb database server
loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
active: active (running) since 六 2018-07-21 20:16:33 cst; 121ms ago
main pid: 7978 (mysqld_safe)
cgroup: /system.slice/mariadb.service
├─7978 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─8140 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-e...
自動化部署指令碼
usr bin env python coding utf 8 import sys,os import subprocess import re import shlex import time filename sys.argv 0 absdir os.path.abspath os.path....
部署python自動化指令碼 搭建自動化指令碼執行環境
年前把平台的指令碼寫好了,準備在虛擬機器中全部執行一遍。沒想到在虛擬機器中配置了很長時間,才把環境搭好。為了不再犯這配置環境的苦,在這簡單說說環境的搭建吧。因為寫的指令碼是在win7上實現的,所以虛擬機器我安裝的也是win7系統。1 安裝python 2 配置環境變數 python安裝成功後,將安裝...
Shell 自動化部署 雜記
本文以 ubuntu server 10.04 為例,下面只是簡單記錄一些東西,以後會整理成檔案發布出來。1.使用 tar 工具進行檔案壓縮與解壓縮 壓縮 test 整個目錄 tar zcvf test.tar.gz test 解壓縮 test.tar.gz 到當前目錄的 test 檔案中 tar ...