使用discuz搭建bbs论坛网站

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/Powerful_Fy/article/details/102537435

在上一篇文章中,已经介绍了如何在Linux搭建lnmp环境并通过WordPress搭建个人博客网站,接下来介绍如何使用discuz搭建bbs论坛网站

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

安装git:

[root@linux ~]# yum -y install git

通过git的方式克隆discuz包到本机:

[root@linux ~]# git clone https://gitee.com/ComsenzDiscuz/DiscuzX.git

拷贝discuz包中的upload目录到/data/www/路径下并重命令目录:

[root@linux ~]# cp -r DiscuzX/upload/  /data/www/test.bbs.com

添加nginx虚拟主机配置文件:

[root@linux ~]# cd /etc/nginx/conf.d/
[root@linux conf.d]# cp default.conf bbs.conf

编辑配置文件:

[root@linux conf.d]# vi bbs.conf 

修改以下内容:
在这里插入图片描述
1.定义bbs网站的自定义域名(如有真实域名可以使用真实域名)
2.定义bbs网站的目录
3.添加index.php(discuz使用的是php)
4.将该配置文件底部的php段内容的注释符号#去掉,定义bbs网站的目录
5.修改/scripts为bbs网站目录路径

验证配置文件并重载:

[root@linux conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@linux conf.d]# nginx -s reload

更改目录属主:

[root@linux conf.d]# cd /data/www/test.bbs.com/
root@linux test.bbs.com]# chown -R php-fpm config/ data/ uc_server/data/ uc_client/data/

修改Windows系统C:\Windows\System32\drivers\etc\hosts文件:(使用真实域名并已解析到服务器IP地址可忽略此步)
在这里插入图片描述
#添加自定义域名:test.bbs.com

打开浏览器访问域名即可开始安装:
在这里插入图片描述
点击我同意之后继续点击下一步需要配置数据库信息:

登录数据库:

[root@linux test.bbs.com]# mysql -uroot -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 92
Server version: 10.3.18-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

创建bbs网站数据库:

MariaDB [(none)]> create database bbs;
Query OK, 1 row affected (0.000 sec)

创建授权用户:

MariaDB [(none)]> grant all on bbs.* to 'bbsuser'@'127.0.0.1' identified by 'test123';
Query OK, 0 rows affected (0.005 sec)

#创建用户bbsuser,密码test123,授权从127.0.0.1连接

填写数据库信息:
在这里插入图片描述
#数据库信息填写刚创建的,管理员信息自己设置密码即可,邮箱默认即可

完成安装后bbs网站就搭建完成:
在这里插入图片描述
使用管理员账号登录后台:
在这里插入图片描述
接下来即可开始自由设置bbs网站了!

猜你喜欢

转载自blog.csdn.net/Powerful_Fy/article/details/102537435