欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

rhel7.4搭建Discuz

程序员文章站 2022-04-17 08:45:50
搭建一个论坛: 实验步骤如下: 1.新建虚拟机,配置IP,搭建本地yum 配置IP地址的方法 nmtui和nmcli 2.准备LAMP的环境 linux Apache mysq...
搭建一个论坛
实验步骤如下:
1.新建虚拟机,配置IP,搭建本地yum
配置IP地址的方法
nmtui和nmcli
2.准备LAMP的环境
linux Apache mysql php
01.安装mysql,设置开机自启动,启动服务,并设置root账号密码
[root@localhost html]# yum -y install mariadb-server.x86_64 mariadb
[root@localhost html]# systemctl enable mariadb.service
[root@localhost html]# systemctl restart mariadb.service
[root@localhost html]# mysqladmin -uroot password Taren1
02.安装apache,设置自动启动,启动服务
[root@localhost html]# yum -y install httpd
[root@localhost html]# systemctl enable httpd
[root@localhost html]# systemctl restart httpd
03.安装php和php-mysql
[root@localhost html]# yum -y install php-mysql.x86_64 php
测试PHP是否成功如下:
01.在/var/www/html下编辑文件test1.php
phpinfo();
>
02.用火狐测试一下
[root@localhost html]# firefox http://127.0.0.1/test1.php
测试数据库的功能:
01.在/var/www/html下编辑文件test2.php
$link=mysql_connect("localhost",'root','Taren1');
if($link) echo "Seccess!!";
else echo "Faild";
mysql_close();
>
02.用火狐测试一下
[root@localhost html]# firefox http://127.0.0.1/test2.php
3.创建论坛数据库,并授权
MariaDB [(none)]> create database bbsdb;
MariaDB [(none)]> grant all on bbsdb.* to runbbs@localhost identified by 'pwd123';
4.安装配置Discuz
01.解压安装包
[root@localhost ~]# uzip Discuz_X3.4_SC_UTF8_0101.zip
02.配置Discuz
由于PHP默认访问 /var/www/html/ 文件夹,所以我们需要把upload文件夹里的文件都复制到
/var/www/html/ 文件夹
[root@localhost html]# cp -rf /root/dir_SC_UTF8/upload/* /var/www/html/
修改文件的所属权限 ,使apache可以访问这个文件
[root@localhost html]# chown -R apache template/ data/ config/ uc_client/ uc_server/
或者chmod -R 777 /var/www/html
5.安装论坛系统
需要把selinux关闭,否则 无法安装
[root@localhost html]# setenforce 0
[root@localhost html]# firefox http://127.0.0.1
6.访问论坛首页
[root@localhost html]# firefox http://127.0.0.1