91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

linux centos7 終極編譯部署LAMP環境腳本 國內網站下載速度賊快

發布時間:2020-07-30 00:39:24 來源:網絡 閱讀:340 作者:wx5d4557ee5e827 欄目:系統運維

#!/bin/bash
#LAMP終極部署
cat <<-EOF
+-------------------------------------------------------------------------+
| LAMP終極部署 V1.0 |
+-------------------------------------------------------------------------+
| a. 部署Apache服務 |
| b. 部署php服務 |
| c. 部署Mysql服務 |
| 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服務,請稍等!!!"
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

}
#安裝php
install_php()
{
echo "正在安裝php服務"
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 "正在準備編譯環境,wait a minute"
yum -y install ncurses ncurses-devel openssl-devel bison gcc gcc-c++ make cmake &> /dev/null
if [ $? -eq 0 ]
then
echo "編譯環境已準備好"
else
echo "編譯環境準備失敗"
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
#給數據庫加密
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
#添加到開機啟動項
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 "----------修改數據庫初始密碼----------"
read -p "請輸入你要設置的數據庫密碼" 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 "請輸入你要選擇的參數: " 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

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

布尔津县| 宜城市| 开封县| 杭锦旗| 舞钢市| 新建县| 光泽县| 洮南市| 胶南市| 和顺县| 兴海县| 垦利县| 调兵山市| 库车县| 广元市| 武乡县| 图木舒克市| 漳州市| 镇安县| 新平| 佳木斯市| 保山市| 石屏县| 偏关县| 万年县| 合江县| 镇雄县| 周至县| 久治县| 宁南县| 琼结县| 聂拉木县| 得荣县| 虞城县| 丰城市| 衡水市| 安阳县| 曲沃县| 临潭县| 新蔡县| 墨脱县|