【 Discuz! 】CentOS7.x上基于LAMP环境搭建Discuz!论坛

Discuz! 是全球成熟度最高、覆盖率最大的论坛软件系统之一。

自 2001 年 6 月面世以来,Discuz! 已拥有 15 年以上的应用历史和 200 多万网站用户案例。

目前,Discuz! 已经发展成为一个以社区为基础的专业建站平台,让论坛(BBS)、社交网络(SNS)、门户(Portal)、群组(Group)、开放平台(Open Platform)应用充分融合于一体,帮助网站实现一站式服务。


官网:http://www.discuz.net/forum.php

官方gitee:https://gitee.com/ComsenzDiscuz/DiscuzX

安装包下载:http://www.discuz.net/thread-3570835-1-1.html


一、实验环境

操作系统:CentOS7.2 Minimal

IP:192.168.1.105

Discuz!版本:X3.4 

二、防火墙、selinux设置

# setenforce 0

# sed -i 's/^SELINUX=.*/SELINUX=permissive/g'   /etc/selinux/config

# systemctl stop  firewalld

# systemctl disable firewalld

三、软件安装

# yum -y install git

# yum -y install mariadb mariadb-server

# yum -y install httpd

# yum -y install php php-mysql

# yum -y install gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap

# git clone https://gitee.com/ComsenzDiscuz/DiscuzX.git

12979420-74191b339d264949.png

四、相关服务启动

# systemctl start mariadb httpd

# systemctl enable mariadb httpd 

12979420-6048702aa79b3565.png

五、数据库设置

# mysql_secure_installation

设置mariadb的root密码:Discuz@123

12979420-ed65697a1836fc4b.png
12979420-84f1b9d900d68bd2.png

创建# Discuz库和用户,授权

# mysql -u root -p"Discuz@123"

> create database discuz;

>  grant all on discuz.* to 'discuz'@'localhost' identified by 'Discuz@123';

 > flush privileges;

12979420-55937e1b4687fa61.png

六、php网页解析和数据库访问测试

# vim /var/www/html/test1.php


12979420-ec5f8c78d39efed3.png

#  vim /var/www/html/test2.php


12979420-dc03ff85f7d65fa2.png


测试访问:http://192.168.1.105/test1.php

12979420-12ba0a62fc219052.png

测试访问:http://192.168.1.105/test2.php


12979420-853bfcbf22b7bb7d.png

http://www.w3school.com.cn/php/func_mysql_connect.asp

https://dev.mysql.com/doc/apis-php/en/apis-php-function.mysql-connect.html

七、Discuz!论坛代码部署


# cp -rf DiscuzX/upload/ /var/www/html/bbs

# chown -R apache:apache /var/www/html/bbs

# systemctl restart httpd


12979420-b76cb894873a0391.png

八、Discuz!论坛WEB安装

web访问:http://192.168.1.105/bbs/install/


12979420-8828cba83ef4386d.png
12979420-adf54a22445d1a88.png


12979420-8eef9c0ff3a0131d.png
12979420-8d5c8860e802aee9.png

数据库名: mariadb中创建的数据库discuz

数据库用户名:  mariadb中被授权的用户discuz

数据库密码: mariadb中被授权的用户discuz登录数据库discuz的密码Discuz@123

管理员账号: admin

管理员密码: 自定义后台管理员密码


12979420-2124ba4e20578bcd.png


12979420-df03b590339a7191.png
12979420-c7d7a75f675b4ddd.png
12979420-f9d03c3bd6e81516.png

九、安装后目录处理

安装完成后,我们应该将install目录转移,并限制访问权限

# cd /var/www/html/bbs 

# mv install/ install.lock

# chmod 600 install.lock/


12979420-a33d042e63f6a31c.png

十、注册、发帖、回复等论坛操作测试

12979420-888400418a21c7a8.png
12979420-a23ed555d15e0d81.png
12979420-69501b74d29b8b7b.png


http://www.w3school.com.cn/php/func_mysql_connect.asp

https://dev.mysql.com/doc/apis-php/en/apis-php-function.mysql-connect.html

猜你喜欢

转载自blog.csdn.net/weixin_33796177/article/details/87230975