一.mysl配置
1.安装mysql
yum install mysql-server -y
2.进入mysql配置文件目录
cd /etc/my.cnf.d
3.编辑mysql配置文件
vim mysql-server.cnf
在[mysqld]中添加:
character-set-server=utf8
4.启动mysql服务
systemctl start mysqld
5.登入mysql
mysql
6.创建数据库
create database bbs;
7.授权
CREATE USER 'root'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;
二.php,nginx配置
1.安装php
yum install php php-gd php-fpm php-mysqlnd -y
2.安装nginx
yum install nginx -y
3.在nginx主配置文件的server里添加php信息
1)编辑nginx主配置文件
vi /etc/nginx/nginx.conf
将php信息添加到server里面:
location ~ .php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
3)添加php测试界面
echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/phpinfo.php
4)重启nginx,php-fpm服务
systemctl restart nginx php-fpm
4.测试
http://192.168.233.132/phpinfo.php
三.下载Discuz
1)Discuz传输:
2)Discuz解压:
unzip Discuz_X3.5_SC_UTF8_20230520.zip
3)将Discuz移动到网页目录下:
cd /usr/share/nginx/html/
mkdir bbs
cd
mv upload/* /usr/share/nginx/html/bbs/
四.访问Discuz
http://192.168.233.132/bbs/
五.界面参数设置
1)解决权限问题
cd /usr/share/nginx/html/bbs
chmod 777 data/ uc_client/ uc_server/ config/ -R
setenforce 0