中文字幕日韩精品一区二区免费_精品一区二区三区国产精品无卡在_国精品无码专区一区二区三区_国产αv三级中文在线

linuxcentos7終極編譯部署LAMP環(huán)境腳本國內(nèi)網(wǎng)站下載速度賊快

#!/bin/bash
#LAMP終極部署
cat <<-EOF
+-------------------------------------------------------------------------+
| LAMP終極部署 V1.0 |
+-------------------------------------------------------------------------+
| a. 部署Apache服務(wù) |
| b. 部署php服務(wù) |
| c. 部署MySQL服務(wù) |
| d. 一鍵部署LAMP |
| q. 按q鍵退出程序 |
+-------------------------------------------------------------------------+
EOF
#安裝Apache
install_Apache()
{
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i '/^\bSELINUX\b/c SELINUX=disabled' /etc/selinux/config
mkdir /usr/local/apr &> /dev/null
mkdir /usr/local/apr-util &> /dev/null
mkdir /usr/local/apache &> /dev/null
cd /usr/local/src
echo "正在下載Apache服務(wù),請稍等?。?!"
wget http://archive.apache.org/dist/apr/apr-1.6.5.tar.gz &> /dev/null
wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz &> /dev/null
wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.37.tar.gz &> /dev/null
if [ $? -eq 0 ]
then
echo "download success"
else
echo "download failed"
exit
fi
tar xf apr-1.6.5.tar.gz
tar xf apr-util-1.6.1.tar.gz
tar xf httpd-2.4.37.tar.gz
echo "正在安裝所需的依賴包"
yum -y install gcc gcc-c++ openssl openssl-devel expat-devel &> /dev/null
if [ $? -eq 0 ]
then
echo "依賴包安裝成功"
else
echo "依賴包安裝失敗"
exit
fi
cd /usr/local/src/apr-1.6.5/
echo "正在配置和編譯安裝apr,請喝口水稍等?。?!"
./configure --prefix=/usr/local/apr/ &> /dev/null
make &> /dev/null && make install &>/dev/null
if [ $? -eq 0 ]
then
echo "apr installed"
else
echo "apr installed failed"
exit
fi
cd /usr/local/src/apr-util-1.6.1/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ &> /dev/null
make &> /dev/null && make install &> /dev/null
if [ $? -eq 0 ]
then
echo "apr-util installed"
else
echo "apr-util installed failed"
exit
fi
cd /usr/local/src/httpd-2.4.37/
echo "正在配置Apache"
./configure --prefix=/usr/local/apache/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --enable-so --enable-ssl--enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support &> /dev/null
make &> /dev/null && make install &> /dev/null
if [ $? -eq 0 ]
then
echo "Apache installed"
else
echo "Apache installed failed"
exit
fi
cd /usr/local/apache/bin/
echo ServerName www.fangxi.com >> /usr/local/apache/conf/httpd.conf
./apachectl start
if [ $? -eq 0 ]
then
echo "Apache安裝成功并啟動"
else
echo "Apache啟動失敗"
exit
fi

創(chuàng)新互聯(lián)建站秉承實現(xiàn)全網(wǎng)價值營銷的理念,以專業(yè)定制企業(yè)官網(wǎng),網(wǎng)站設(shè)計制作、成都做網(wǎng)站,小程序設(shè)計,網(wǎng)頁設(shè)計制作,成都做手機(jī)網(wǎng)站,營銷型網(wǎng)站建設(shè)幫助傳統(tǒng)企業(yè)實現(xiàn)“互聯(lián)網(wǎng)+”轉(zhuǎn)型升級專業(yè)定制企業(yè)官網(wǎng),公司注重人才、技術(shù)和管理,匯聚了一批優(yōu)秀的互聯(lián)網(wǎng)技術(shù)人才,對客戶都以感恩的心態(tài)奉獻(xiàn)自己的專業(yè)和所長。

}
#安裝php
install_php()
{
echo "正在安裝php服務(wù)"
yum -y install php php-cli php-curl php-fpm php-intl php-mcryp php-mysql php-gd php-mbstring php-xml php-dom &> /dev/null
if [ $? -eq 0 ]
then
echo "php安裝成功"
else
echo "php安裝失敗"
exit
fi
systemctl start php-fpm &> /dev/null
if [ $? -eq 0 ]
then
echo "php安裝成功"
else
echo "php安裝失敗"
exit
fi

}
#編譯安裝Mysql
install_mysql()
{
echo "開始安裝mysql"
echo "正在準(zhǔn)備編譯環(huán)境,wait a minute"
yum -y install ncurses ncurses-devel openssl-devel bison gcc gcc-c++ make cmake &> /dev/null
if [ $? -eq 0 ]
then
echo "編譯環(huán)境已準(zhǔn)備好"
else
echo "編譯環(huán)境準(zhǔn)備失敗"
exit
fi
echo "正在下載源碼包----請稍稍等一下"
wget https://down.51cto.com/download.php?do=attachment&aid=3110021&k=26b650aaf1d2184d58d2570ac2f8d0bb&t=1568725722&c=1
groupadd mysql
useradd -r -g mysql -s /bin/nologin mysql
tar xf mysql-boost-5.7.26.tar.gz
cd mysql-5.7.26/
echo "正在配置中,請再喝口水,小憩一下"
cmake . \
-DWITH_BOOST=boost/boost_1_59_0/ \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DSYSCONFDIR=/etc \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DINSTALL_MANDIR=/usr/share/man \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 &> /dev/null
if [ $? -eq 0 ]
then
echo "mysql配置成功"
else
echo "mysql配置失敗"
exit
fi
echo "----------正在安裝編譯安裝Mysql請稍等-----------"
make &> /dev/null && make install /dev/null
if [ $? -eq 0 ]
then
echo "mysql編譯安裝成功"
else
echo "mysql編譯安裝失敗"
exit
fi
echo [mysqld] > /etc/my.cnf
echo basedir=/usr/local/mysql >> /etc/my.cnf
echo datadir=/usr/local/mysql/data >> /etc/my.cnf
echo "mysql配置文件successed"
cd /usr/local/mysql/
mkdir mysql-files
chown -R mysql.mysql /usr/local/mysql
echo "-------------正在初始化Mysql請稍等--------------"
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &> mima.txt
mima=awk '/password/ {print $NF}' mima.txt
echo "初始密碼為:$mima"
if [ $? -eq 0 ]
then
echo "mysql初始化成功"
else
echo "mysql初始化失敗"
exit
fi
bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data
#給數(shù)據(jù)庫加密
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
#添加到開機(jī)啟動項
systemctl start mysqld
if [ $? -eq 0 ]
then
echo "mysql啟動成功"
else
echo "mysql啟動失敗"
exit
fi
echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile
echo "----------修改數(shù)據(jù)庫初始密碼----------"
read -p "請輸入你要設(shè)置的數(shù)據(jù)庫密碼" new_mima
mysqladmin -uroot -p${mima} password "$new_mima"
if [ $? -eq 0 ]
then
echo "mysql初始密碼修改成功,mysql部署完成"
else
echo "mysql初始密碼修改失敗"
exit
fi

}
while :
do
read -p "請輸入你要選擇的參數(shù): " var
case $var in
a)
install_Apache
;;
b)
install_php
;;
c)
install_mysql
;;
d)
install_Apache
install_php
install_mysql
;;
q)
exit
;;
*)
printf "請按照上方提供的選項輸入!!!\n"
;;

esac
done

本文標(biāo)題:linuxcentos7終極編譯部署LAMP環(huán)境腳本國內(nèi)網(wǎng)站下載速度賊快
文章路徑:http://www.rwnh.cn/article28/jjeocp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、移動網(wǎng)站建設(shè)外貿(mào)網(wǎng)站建設(shè)、App設(shè)計服務(wù)器托管、響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計
合江县| 晋城| 林州市| 嘉兴市| 奈曼旗| 鄂尔多斯市| 稷山县| 子长县| 桂林市| 香格里拉县| 石泉县| 塘沽区| 崇文区| 资源县| 江油市| 九龙坡区| 驻马店市| 甘肃省| 昌吉市| 土默特右旗| 资兴市| 会同县| 西乌珠穆沁旗| 巴里| 万宁市| 岐山县| 东丰县| 左云县| 公安县| 醴陵市| 鞍山市| 孟村| 涡阳县| 灌南县| 夏邑县| 临安市| 兴义市| 宜川县| 鲜城| 南和县| 嘉祥县|