Manually Building Discuz! Forum

Last updated: 2020-07-27 09:43:59

    Use Case

    With more than 2 million forums based on Discuz!, it is the most sophisticated and predominant internet discussion software in the world. This article describes how to create a forum using Discuz! and deploy the LAMP (Linux, Apache, MariaDB, and PHP) runtime environment it needs.

    To set up Discuz! manually, you should be familiar with common Linux commands, such as Installing Software via YUM in CentOS and know how to use the software you install and their version compatibility.


    This article uses the following:

    • Operating system: CentOS 7.5, a distribution of Linux
    • Web server: Apache 2.4.6
    • Database: MariaDB 5.5.60
    • Hypertext processor: PHP 5.4.16
    • Forum software: Discuz! X3.2


    Step 1: Logging in to Linux CVM

    Log in to a Linux instance using WebShell (recommended). You can also use another login method that you are comfortable with.

    Step 2: Setting up LAMP

    Tencent Cloud hosts an image of the CentOS official version installation source, which contains the most recent and stable version of the software. Use Yum to install CentOS.

    Installing and configuring required software

    1. Run the following command to install Apache, MariaDB, and PHP:

      yum install httpd php php-fpm php-mysql mariadb mariadb-server -y
    2. Run the following commands to start the services:

      systemctl start httpd
      systemctl start mariadb
      systemctl start php-fpm
    3. Run the following commands to set a password for root and configure the database so root can access it.

      • Run the command before you log in to MariaDB for the first time.
      • Enter the password for root and press Enter. Your password is not shown on the screen. Enter the password a second time to confirm and complete the configuration as prompted on the screen.
    4. Run the following command to log in to MariaDB. Use the password you set in Step 3 and press Enter.

      mysql -u root -p

      A successful login is shown below:

    5. Run the following command to exit MariaDB.


    Verifying Your Setup

    Follow these steps to make sure the environment is set up properly:

    1. Run the following command to create a test file test.php in the default root directory "/var/www/html" of Apache:
      vim /var/www/html/test.php
    2. Press i to switch to edit mode and enter the following:
      echo "<title>Test Page</title>";
    3. Press Esc and input :wq to save the file and exit Vim.
    4. Open a browser window and use the following URL to access test.php to check whether the environment is properly configured.
      If it is, the following appears:

    Step 3: Installing and configuring Discuz!

    Downloading Discuz!

    Run the following command to download the installation package.


    Preparing for installation

    1. Run the following command to decompress the installation package.
    2. Run the following command to copy all files under "upload" to "/var/www/html/".
      cp -r upload/* /var/www/html/
    3. Run the following command to give users write permission:
      chmod -R 777 /var/www/html

    Installing Discuz!

    1. Open a browser window and go to the IP address of your Discuz! forum (your CVM public IP address), or you can bind a domain name to your IP address.
    2. Click I agree to start the process. Discuz! checks to see if the environment is properly installed and configured.
    3. Click Next Step when the check finishes.
    4. Select clean install, and click Next Step.
    5. Enter information as prompted to create a new database for Discuz!.
      • Use root and the password set in Installing and configuring required software to connect to the database and set up a system email address and administrator username, password, and email address.
      • Remember your administrator username and password.
    6. Click Next Step to start installation.
    7. After the installation is completed, click Your forum has been installed successfully. Click here to access. to access your forum.

    Using a Domain Name

    Use a domain name that makes your website easier to remember. We recommend you obtain a domain name and set it to point to your Discuz! site. If you are installing Discuz! just to learn the process, you can keep using the IP address. Otherwise, use a domain name.


    If you encounter a problem when using CVM, refer to the following documents for troubleshooting:

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback