Building the Website
Requested Cloud Resources
Building Process
Obtaining the Software
- WinSCP
WinSCP is a free and open-source SFTP, FTP, WebDAV and SCP client for Microsoft Windows. It is mainly used to transfer files between a local and a remote computer in a secure manner. Download the required version of WinSCP.
- Discuz X3.5 (UTF-8)
Discuz X3.5 (UTF-8) is used to deploy website applications. Download the software package of the required version from the official website.
- The recommended English version of Discuz X3.5 (UTF-8) is not free of charge. Refer to the provided page for payment details.
- The software packages are only used to construct the forum. To deploy a commercial website, download the applications as needed.
Building the Database
Install MySQL.
CentOS 7.2 is used as an example to describe how to install MySQL.
- Log in to ECS discuz01 remotely and enter the username and password.
- Install MySQL.
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server --nogpgcheck
Configure MySQL.
- Start and enable MySQL.
systemctl enable mysqld
- Query the running status of MySQL.
systemctl status mysqld.service
Information similar to the following is displayed:
# systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2021-08-23 10:54:55 CST; 7s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Main PID: 7873 (mysqld) CGroup: /system.slice/mysqld.service └─7873 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid Aug 23 10:54:49 ecs-adc3-420652-aed6 systemd[1]: Starting MySQL Server... Aug 23 10:54:55 ecs-adc3-420652-aed6 systemd[1]: Started MySQL Server.
- Obtain the password of user root, which was automatically set during MySQL installation:
grep 'temporary password' /var/log/mysqld.log
Information similar to the following is displayed:2021-08-16T11:33:37.790533Z 1 [Note] A temporary password is generated for root@localhost: ;8nPd29lhs,k
- Harden MySQL.
Securing the MySQL server deployment. Enter password for user root: #Enter the obtained password of user root. The existing password for the user account root has expired. Please set a new password. New password: #Enter the new password. Re-enter new password: #Enter the new password again. The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : N #Asks you whether to change the password of user root. Press N. ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y #Asks you whether to remove anonymous users. Press Y. Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y #Asks you whether to forbid remote login of user root. Press Y. Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y #Asks you whether to delete the test database and cancel access permissions to it. Press Y. - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y #Asks you whether to reload privilege tables. Press Y. Success. All done!
- Enter the password of user root to log in to the database.
mysql -u root -p
- Set the MySQL database as the default database.
- Query the user list.
This command and the following database commands must end with a semicolon (;).
- Refresh the user list and allow all IP addresses to access the database.
- Forcibly update the permissions to allow ECSs in the same subnet to access the MySQL database using private IP addresses.
- Exit the database.
- Restart MySQL.
- Enable MySQL to automatically start upon system boot.
- Disable the firewall.
- Check the firewall status.
Setting Up the Web Environment
Install the web environment.
- Unbind the EIP from ECS discuz01 and bind it to ECS discuz02.
- Log in to ECS discuz02 remotely and enter the username and password.
- Install MySQL.
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server --nogpgcheck
- Install the Apache HTTP Server (httpd), PHP FastCGI Process Manager (php-fpm), MySQL client (mysql), and MySQL server (mysql-server).
yum install -y httpd php php-fpm mysql mysql-server php-mysql
If the following information is displayed, the installation is successful.Complete!
- Reinstall the Apache HTTP Server (httpd), PHP FastCGI Process Manager (php-fpm), MySQL client (mysql), and MySQL server (mysql-server).
yum reinstall -y httpd php php-fpm mysql mysql-server php-mysql
If the following information is displayed, the installation is successful.Complete!
Configure the web environment.
- Start httpd.
- Enable httpd to automatically start upon system boot.
- Start php-fpm.
- Enable php-fpm to automatically start upon system boot.
- Disable the firewall.
- Check the firewall status again.
- Start MySQL.
- Enable MySQL to automatically start upon system boot.
- Enter http://EIP in a browser to query the default page of the ECS.
Deploying the Website Code
- Decompress the Discuz_X3.5_SC_UTF8_20231001.zip package to the Discuz_X3.5_SC_UTF8_20231001 folder.
- Use WinSCP to upload the upload file in the Discuz_X3.5_SC_UTF8_20231001 folder to the /var/www/html directory on ECS discuz02. For details, see WinSCP documents.
- Log in to discuz02 and run the following command to grant the write permission to other users:
chmod -R 777 /var/www/html
- Enter http://Elastic IP address in the address bar of a browser. Follow the installation wizard to install Discuz.
- The database address if the private IP address of discuz01.
- The database password is the password of the database administrator's root account configured on discuz01.
Verifying the Website
In the browser address bar, enter http://Elastic IP address/forum.php. 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.