Manually build Discuz! Forum

Last updated: 2020-02-18 14:38:07


Operation scene

Discuz! It is one of the forum website software systems with the highest maturity and the largest coverage in the world, and is used by more than 2 million website users. You can use Discuz! To build a forum, this document introduces how to build Discuz on Tencent Cloud servers! Forum and its required LAMP (Linux + Apache + MariaDB + PHP) environment.

Build Discuz manually! Forum, you need to be familiar with Linux commands, such as Install software through YUM in CentOS environment And have a good understanding of the use and version compatibility of the installed software.

Sample software version

Discuz built in this article! The version and description of the forum software are as follows:

  • Linux:Linux operating system, this paper takes CentOS 7.5 as an example.
  • Apache:Web server, this paper takes Apache 2.4.15 as an example.
  • MariaDB: database, this paper takes MariaDB 5.5.60 as an example.
  • PHP: scripting language, this paper takes PHP 5.4.16 as an example.
  • Discuzials: forum website software, this article is based on Discuz! X3.2 as an example.

Operation step

Step 1: log in to Cloud Virtual Machine

Log in to the Linux instance in a standard way (recommended) . You can also choose different login methods according to your actual operation habits:

Step 2: build the LAMP environment

For CentOS systems, Tencent Cloud provides software installation sources that are synchronized with CentOS officially, including the most stable versions of the software that can be quickly installed directly through Yum.

Install and configure the necessary software

  1. Execute the following command to install the necessary software (Apache, MariaDB, PHP):)
yum install httpd php php-fpm php-mysql mariadb mariadb-server -y
  1. Execute the following order, Launch service.
systemctl start httpd
systemctl start mariadb
systemctl start php-fpm
  1. Execute the following command to set the root account password and basic configuration so that root users can access the Access database.
  • Execute the following command to enter the user password and basic settings before logging in to MariaDB for the first time.
  • Press the enter key after entering the root account password for the first time (the interface does not display by default when setting the root password), and enter the confirmation again. Complete the basic configuration through the prompts on the interface.
  1. Execute the following command, log in to MariaDB, and enter Step 3 To set the password, press " Enter ".
mysql -u root -p

If you can log in to MariaDB by entering the password you just set, the configuration is correct. as shown below:

  1. Execute the following command to exit the MariaDB database.

Verify the environment configuration

To confirm and ensure that the environment is built successfully, you can verify it by doing the following:

  1. Execute the following command in the default root of Apache, Directory /var/www/html Create in test.php Test the file.
vim /var/www/html/test.php
  1. Press " I "switch to edit mode and write the following:
echo "<title>Test Page</title>";
  1. Press " Esc ", enter" : wq Save the file and return.
  2. In the browser, Access should test.php File to see if the environment configuration was successful.
http://Public network IP of CVM/test.php 

The following page indicates that the LAMP environment is configured successfully.

Step 3: install and configure Discuz!

Download Discuz!

Execute the following command to download the installation package.


Installation preparation work

  1. Execute the following command to extract the installation package.
  1. Execute the following command to copy all files under the extracted "upload" folder to the /var/www/html/ .
cp -r upload/* /var/www/html/
  1. Execute the following command to assign the write Permission to other users.
chmod -R 777 /var/www/html

Install Discuz!

  1. In the Web browser address bar, enter Discuz! The IP address of the site (that is, the public network IP address of Cloud Virtual Machine instance), you can see Discuz! Installation interface.
  2. Click [I agree] to go to the check installation environment page.
  3. Confirm that the current status is normal, and click "next" to go to the page of setting up the running environment.
  4. Select a new installation and click "next" to go to the create database page.
  5. According to the page prompt, Enter information, for Discuz! Create a database.
  • Please use th Install the necessary software Set the root account and password to connect to the database, and set up the system mailbox, administrator account, password and Email.
  • Please remember your administrator user and password.
  1. Click [next] to start the installation.
  2. After the installation is complete, click [your forum has completed installation, click this Access] to Access Forum.


If you encounter problems in the process of using Cloud Virtual Machine, you can refer to the following documents and analyze and solve the problems according to the actual situation: