Shell 脚本部署论坛系统discuz 。

#!/bin/bash
###部署论坛系统discuz
#基础环境:永久关闭防火墙#临时关闭#停用防火墙#开启禁用防火墙
sed -ri '/^SELINUXTYPE=/cSELINUX=disabled' /etc/selinux/config
setenforce 0
systemctl stop firewalld.service
systemctl disable firewalld.service

###安装LAMP
#下载7个相关安装包#开启Apache 和数据库 #设成开机自启
yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd &> /dev/null
systemctl start httpd mariadb
systemctl enable httpd mariadb

####安装Discuz!
##导入discuz网站源码包
#下载源码压缩包#创建项目目录#下载解压文件软件#解压项目文件
#复制项目文件中upload里内容到项目文件#给项目目录授权
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 /luntan/discuz
yum -y install  unzip &> /dev/null

if [ ! -d upload ]
then
unzip Discuz_X2.5_SC_UTF8.zip
  echo "discuz解压完成"
else  echo "discuz已被解压,无需处理"
fi

cp -rf upload/* /luntan/discuz
chown -R apache.apache /luntan/discuz

##Apache配置虚拟主机
#打开配置文件,创建项目配置文件,进行编辑#重启
if [ ! -f /etc/httpd/conf.d/discuz.conf ]
then
cat >> /etc/httpd/conf.d/discuz.conf <<-EOF
<VirtualHost *:80>
   ServerName www.discuz.com
   DocumentRoot /luntan/discuz
</VirtualHost>

<Directory "/luntan/discuz">
   Require all granted
</Directory>
EOF
fi

systemctl restart httpd

##准备数据库
#登录数据库#创建discuz数据库
mysql -e "use discuz;" &> /dev/null
if [ $? -eq 1 ]
then
 mysql -e "create database discuz;"
fi

###局域网浏览器访问:ip#虚拟机:浏览器 ip

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值