#!/bin/bsah
#关闭防火墙和selinux
#安装LAMP架构
hanshu(){
systemctl stop firewalld && setenforce 0
yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd >>/dev/null
while [ $? -ne 0 ]
do
yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd >>/dev/null
done
systemctl start httpd
if [ $? -eq 0 ]; then
echo "Apache启动成功"
fi
touch /etc/httpd/conf.d/discuz.conf
echo "<VirtualHost *:80>" >>/etc/httpd/conf.d/discuz.conf
echo " ServerName www.discuz.com" >>/etc/httpd/conf.d/discuz.conf
echo " ServerAlias dscuz.com" >>/etc/httpd/conf.d/discuz.conf
echo " DocumenTRoot /webroot/discuz" >>/etc/httpd/conf.d/discuz.conf
echo "</VirtualHost>" >>/etc/httpd/conf.d/discuz.conf
echo '<Directory "/webroot/discuz">' >>/etc/httpd/conf.d/discuz.conf
echo ' Require all granted' >>/etc/httpd/conf.d/discuz.conf
echo '</Directory>' >>/etc/httpd/conf.d/discuz.conf
mkdir -p /webroot/discuz
unzip /tmp/Discuz_X3.4_SC_UTF8.zip >>/dev/null
cp -rf /tmp/upload/* /webroot/discuz
chmod 777 -R /webroot/discuz
systemctl start mariadb
if [ $? -eq 0 ]; then
mysql=$(which mysql)
$mysql -uroot -p123 -e "create database discuz";
exit
fi
systemctl restart httpd
}
cat << EOF
本脚本适用于Centos7版本安装discuz论坛系统,要求将Discuz_X3.4_SC_UTF8.zip上传至/tmp目录下,请选择是否安装。
y) 安装discuz论坛系统;
n) 不安装;
EOF
read -p "Your choice:" choice
case $choice in
y)
hanshu
echo 开始安装
;;
n)
exit
;;
esac
Discuz论坛系统搭建
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...