Linux Shell编程综合实战1论坛系统

在线部署论坛系统

#!/bin/bash
#关闭防火墙
sed  -ri '/^SELINUX=/cSELINUX=disabled'   /etc/selinux/config
systemctl   stop   firewalld
systemctl  disable  firewalld
#安装LAMP
yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd
systemctl   start    httpd   mariadb
systemctl   enable   httpd   mariadb
#导入论坛网站源码
if     [ ! -f  Discuz_X2.5_SC_UTF8.zip  ]
then
wget http://download.comsenz.com/DiscuzX/2.5/Discuz_X2.5_SC_UTF8.zip
fi
mkdir  -p  /webroot/discuz
yum  install   -y   unzip
#解压源码包
if   [ ! -d   upload ]
then
unzip  Discuz_X2.5_SC_UTF8.zip
fi
#复制到指定目录
cp -rf upload/* /webroot/discuz/
#授权
chown  -R apache.apache  /webroot/discuz
#Apache 配置虚拟主机
cat > /etc/httpd/conf.d/discuz.conf <<-EOF
*:80>
ServerName www.discuz.com
DocumentRoot /webroot/discuz
</VirtualHost>

"/webroot/discuz">
Require all granted
</Directory>
EOF
systemctl  restart  httpd
#准备数据库
mysql -e  create   database  discuz;


Linux Shell编程综合实战1论坛系统_第1张图片

你可能感兴趣的:(shell编程部署论坛系统,linux)