前期准备:
电脑成功安装VMware,安装好VMware后,提前准备封装好的centOS7虚拟机,在主页选择打开虚拟机----我已复制该虚拟机
打开虚拟机后输入用户名:root 和密码:123456
用ifconfig查看虚拟机IP地址,用ifup ens32打开网卡
避免因为centOS版本过低造成后续工作出错,我先更新了centOS7
[root@localhost ~]# yum -y update
准备工作做好后便可以开始着手搭建Discuz论坛环境了。
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum install lrzsz
[root@localhost ~]# rz
[root@localhost ~]# yum install wget
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
[root@localhost ~]# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.24-1.el7.x86_64.rpm-bundle.tar
[root@localhost ~]# tar -xvf mysql-5.7.24-1.el7.x86_64.rpm-bundle.tar
解压后得到如图所示的文件
[root@localhost ~]# yum remove mariadb-libs*
[root@localhost ~]# rpm -ivh mysql-community-common-5.7.24-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-libs-5.7.24-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-libs-compat-5.7.24-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-client-5.7.24-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-client-5.7.24-1.el7.x86_64.rpm
[root@localhost ~]# rpm -ivh mysql-community-devel-5.7.24-1.el7.x86_64.rpm
[root@localhost ~]# vi /etc/my.cnf
[root@localhost ~]# systemctl start mysqld.service
[root@localhost ~]# mysql -u -p
能正常进入则说明配置成功,输入exit退出;
1.下载PHP
[root@localhost ~]# yum install php
2.安装PHP进程管理器
[root@localhost ~]# yum install php-fpm
3.启动进程管理器
[root@localhost ~]# php-fpm -D
[root@localhost ~]# yum install php-mysql
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
DirectoryIndex index.php index.html
[root@localhost ~]# systemctl restart mysqld.service
[root@localhost ~]# systemctl restart httpd.service
[root@localhost ~]# systemctl restart php-fpm.service
[root@localhost ~]# unzip Discuz_X2.5_SC_UTF8.zip
[root@localhost ~]# cp -r upload /var/www/html
[root@localhost html]# chmod -R 777 upload
选择我同意,再点击下一步,默认选择全新安装,进入安装后将数据库密码一栏置空,再点击下一步,完成安装。
安装完成后,输入 http://xxx.xxx.xxx.xxx/upload/forum.php,验证是论坛否安装成功