The background,

Discuz is a PHP-based forum tool that can be deployed on both Linux and Windows platforms. This experiment takes you to quickly build your own forum based on CentOS.

Software environment

System: CentOS 6.8 64-bit

IP: 192.168.200.112

Two, installation tutorial

1. Prepare an operating system environment

1.1 Disabling the Firewall – Startup Fails (Learn to Use)

systemctl stop firewalld 
systemctl disable firewalld 
Copy the code

1.2 Turn off Selinux security enhancement turn off permanently

sed -i 's/enforcing/disabled/' /etc/selinux/config 
Copy the code

If you ignore this step, you may encounter the following problems: the directory does not exist and cannot be writable when you install disCUZ. For the solution, see blog.csdn.net/qq\_4096517…

13. Yum source acceleration

Replace ali cloud image first backup the original yum source, to avoid errors cannot be restored

cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak 
Copy the code

Then modify the base. Reop source

wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
Copy the code

Install the epel. ‘source

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 
Copy the code

Refresh the cache

yum clean all
yum makecache 
Copy the code

References:

Blog park:www.cnblogs.com/zhuang229/p…

Jane:www.jianshu.com/p/b7cd2f9fb…

2. Prepare LAMP environment

LAMP stands for Linux, Apache, MySQL, and PHP, and is the basic operating environment on which the Discuz forum system depends. So let’s prepare the LAMP environment

Install MySQL 2.1

yum install mysql-server -y 
Copy the code

After installation, start MySQL service:

service mysqld restart 
Copy the code

This experiment uses the default mysql account name and password, but you can also set your own mysql account name and password. Refer to the following:

/usr/bin/mysqladmin -u root password 'Password' 
Copy the code

[Optional] Set MySQL to automatically start upon startup:

chkconfig mysqld on 
Copy the code

This section describes the steps for installing mysql

My article: juejin.cn/post/691247…

CSDN:blog.csdn.net/YHF886/arti…

2.2 Installing the Apache Component

yum install httpd -y 
Copy the code

After installation, start the HTTPD process:

service httpd start 
Copy the code

HTTPD is also set to automatically start upon startup:

chkconfig httpd on 
Copy the code

Installing PHP 2.3

yum install php php-fpm php-mysql -y 
Copy the code

After installation, start the php-fpm process:

service php-fpm start
Copy the code

Once started, you can use the following command to see which port the PHP-fpm process listens on

netstat -nlpt | grep php-fpm
Copy the code

Set phP-fpm to automatically start upon startup:

chkconfig php-fpm on 
Copy the code

3. Install and configure Discuz

Download a discuz_x3.2_sc_utf8.zip package:

Wget HTTP: / / http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zipCopy the code

Once the download is complete, unzip the package (to install the unzip command, you can unzip it in Win and upload it)

Unzip Discuz_X3. 2 _sc_utf8. ZipCopy the code

After unzipping, you can see discuz’s source code in the upload folder

Since PHP access /var/ WWW/HTML/by default, we need to copy all the files in the upload folder to /var/ WWW/HTML /

cp -r upload/* /var/www/html/ 
Copy the code

Grant permissions to the /var/www/html directory and its subdirectories

chmod -R 777 /var/www/html 
Copy the code

Restart the Apache

service httpd restart 
Copy the code

3. Initialize Diszz

Enter http://192.168.200.112/ in the browser address box to go to the initial installation screen

Reference from manual of Experiments

Tencent cloud:Cloud.tencent.com/developer/l…