Manually deploy a Discuz! forum
Discuz! is a general-purpose community forum software built on a PHP and MySQL architecture that provides an efficient forum solution. This topic describes how to deploy a Discuz! X3.5 forum on an ECS instance.
Prerequisites
You have created a Linux ECS instance that meets the following requirements:
Network Type: VPC.
Operating System: Alibaba Cloud Linux 3/2, CentOS 7/8, or Ubuntu 22/20/18.
IP Address: The instance has a public IPv4 address.
Security Group: You have added inbound rules to the security group to allow traffic on ports 22, 80, and 3306. For more information, see Add a security group rule.
You have deployed a LAMP (Linux, Apache, MySQL, PHP) environment. For more information, see Manually deploy a LAMP environment.
Discuz! has version requirements for Nginx and MySQL. For a detailed compatibility matrix, see the Discuz! official website.
Procedure
Run the following command to verify the installed PHP XML libraries.
php -m | grep xmlThe command returns the following output. If your output shows only
libxml, you must install the PHP XML extensions. For more information, see Install PHP XML extensions.$ php -m | grep xml libxml xml xmlreader xmlwriterRun the following command to create and enter a directory, for example, /www.
sudo mkdir /www cd /wwwDownload the Discuz! installation package and upload it to the /www directory.
This example uses the Discuz_X3.5_SC_UTF8_20231001.zip.
Run the following commands to unzip the Discuz! installation package.
Alibaba Cloud Linux 3/2, CentOS 7/8
sudo yum -y install unzip sudo unzip Discuz_X3.5_SC_UTF8_20231001.zipUbuntu 22/20/18
sudo apt install -y unzip sudo unzip Discuz_X3.5_SC_UTF8_20231001.zip
Run the following command to copy all files from the upload folder to the Apache default root directory /var/www/html/.
sudo cp -r upload/* /var/www/html/Run the following command to grant full read, write, and execute permissions to all users for the /var/www/html directory.
sudo chmod -R 777 /var/www/htmlInstall Discuz!.
Obtain the public IP address of the ECS instance.
Log on to the ECS console.
In the left-side navigation pane, choose .
Find your instance and copy its public IP address from the IP Address column.
In the address bar of your web browser, enter
http://<public_ip_address_of_your_ECS_instance>.The Discuz! installation wizard opens, displaying the license agreement.
Read the agreement and click I Agree to continue.
The wizard checks your server environment, including the operating system, PHP version, required libraries, and file permissions. A green checkmark indicates that a requirement is met. After you review the results, click Next.
Select an installation method for UCenter Server and click Next.
UCenter Server is the user management center for your website. UCenter Server allows you to centralize user registration and sign-in, and exchange data with other community components. For more information, visit the Discuz! official website.
For this tutorial, select Install Discuz! X and UCenter Server. On the Set up the running environment page, ensure Install Discuz! X and UCenter Server is selected, and then click Next.
Enter the database and administrator details, and then click Next. In the Database Information section, use the following example values: set Database Server Address to
127.0.0.1, Database Name toDiscuz!, Database Username toroot, Database Password toEcs@test1, Table Prefix topre_, and System Email toadmin@admin.com.The following table describes the key parameters.
Parameter
Description
Database Server Address
Enter the database connection address.
Database Name
Enter the database name. Example: Discuz!.
Database Username
Enter the database username. The default is
root.Database Password
Enter the database password.
Table Prefix
This is a prefix for all Discuz! table names. To avoid conflicts when sharing a database, we recommend changing the default value of pre_.
Administrator Account
Set the administrator username for logging in to the website backend. The default is admin.
Administrator Password
Set the initial password for the administrator to log in to the website backend.
After the installation is complete, click Visit Your Site Now to access your forum.
Next steps
Using a public IP address to access your forum is insecure and not recommended for production. To enhance security and present a professional image, you should use a custom domain name. Follow these steps to set up a domain name for your forum.
Register a domain name.
For more information, see Domain name registration.
Complete the ICP filing.
If your domain name points to a website hosted on an Alibaba Cloud server in a Chinese mainland node, you must complete an ICP filing. For more information about the procedure, see ICP filing process.
Resolve the domain name.
You must point the domain name to the public IP address of the instance.
DNS resolution is required to access your website by domain name. For more information, see Public DNS resolution.