Using RDS for MySQL to Set Up Discuz!
Crossday Discuz! Board (Discuz! for short) is a universal community forum software system. You can set up a customized forum with comprehensive functions and strong load capability on the Internet through simple installation and settings. This section describes how to set up Discuz! in the LAMP environment using Huawei Cloud VPC, ECS, and RDS for MySQL.
- Configuring Network Information
- Creating an ECS
- Setting Up the LAMP Environment
- Buying and Configuring an RDS DB Instance
- Installing Discuz!
Preparations
During the setup, you will use the following services or tools:
- Cloud services: ECS and RDS on Huawei Cloud
- PuTTY: a remote login tool
- Installation packages
- Apache Http Server 2.4.6
- MySQL 5.4.16
- PHP 5.4.16
The previous software is provided by third-party websites. The information is just for your reference and not for commercial use.
Configuring Network Information
- Log in to the management console.
- Click in the upper left corner and select a region and a project.
- Choose Networking > Virtual Private Cloud.
- On the displayed page, click Create VPC to create a VPC, such as vpc-01.
- On the displayed page, enter a VPC name, set IPv4 CIDR Block to 192.168, select an AZ as required, and add a subnet. Retain the default settings for other parameters. Then, click Create Now. After the VPC is created, return to the network console.
- On the network console, choose Access Control > Security Groups and click Create Security Group. The following uses sg-01 as an example.
- On the Security Groups page, locate the target security group and click Manage Rules in the Operation column.
- Click Add Rule and add an inbound rule for the EIP bound to the ECS.
Buying an ECS
- Log in to the management console.
- Click in the upper left corner and select a region and a project.
- Choose Compute > Elastic Cloud Server. The Elastic Cloud Server page is displayed.
- On the ECS console, buy an ECS.
- Configure basic settings: Select the pay-per-use billing mode, a region, and an image. Retain the default settings for other parameters.
- Configure network: Select a VPC and security group, and purchase an EIP. Retain the default settings for other parameters.
- Configure advanced settings: Enter an ECS name and password, and click Next: Confirm.
- Enter an ECS name, such as ecs-01.
- Enter a password.
- Confirm: Confirm the information and click Next.
- After the ECS is created, view and manage it on the ECS console.
Setting Up the LAMP Environment
- Download the PuTTY client.
- Decompress the package, locate putty from the extracted files and double-click it.
- In the displayed PuTTY configuration dialog box, choose Session and specify basic options for your PuTTY session in the right pane. Then, click Open as shown in Figure 2.
- Enter the EIP of your ECS in the Host Name (or IP address) text box.
- Enter a session name in the Saved Sessions text box and click Save. Discuz is used as an example. Retain the default settings for other parameters.
- In the displayed login window, enter the ECS username and password to log in to ECS.
- Install Apache, MySQL, PHP and other software.
Obtain the root permissions so that you can enter commands in PuTTY.
Enter commands to install software. For example, run the following command to install PHP:
yum install -y httpd php php-fpm php-server php-mysql mysql
The installation is complete if the following command output is displayed:Complete
- After the installation is complete, start related services in sequence.
systemctl start httpd.service
systemctl start php-fpm.service
Buying and Configuring an RDS DB Instance
- Buy a DB instance as required.
- DB instance rds-01 is used as an example. Select MySQL 5.7.
- Ensure that the RDS DB instance uses the same security group as the ECS so that you can access the RDS DB instance through the ECS.
- Set the root user password and keep the password secure. The system cannot retrieve your password.
- After the RDS DB instance is created, view or manage it on the management console.
Installing Discuz!
- Download the Discuz! installation package.
- Upload the installation package to the ECS using a data transfer tool.
- Run the following command to decompress the Discuz! installation package:
- Run the following command to copy all files in upload to /var/www/html/.
cp -R upload/* /var/www/html/
- Run the following command to grant write permissions to other users.
- Enter http://EIP/install in the address box in a local Windows browser and install Discuz! following the guidance.
In the preceding URL, EIP indicates the EIP automatically assigned when you purchase the ECS in Buying an ECS. The install must be lowercase.
- Confirm the agreement and click I Agree.
- After the installation starts, check the installation environment and click Next.
- Set the running environment and click Next.
- Enter the database information and click Next to complete the installation.
- The database address is the floating IP address of DB instance rds-01.
- The database password is the root user password of DB instance rds-01.
- Enter administrator information.
- After Discuz! is installed, enter http://EIP/forum.php in the browser address bar. If the forum homepage is displayed, the website is successfully built.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot