Building the Website

Purchased Services

Building Process

Building the Database

Install the database.

  • CentOS 6.5 64bit (40 GB) is used as the OS of the database node, and the MySQL version is 5.1.73.
  • For CentOS 7 and later versions, MySQL is removed from the default program list. You need to run the sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm command to manually download MySQL. After the download is complete, perform 2 to install the software.
  1. Log in to ECS discuz01 remotely and enter the username and password.

  2. Run the following command to deploy the MySQL database server, MySQL client, and all required libraries and files:

    yum install -y mysql-server mysql mysql-devel

    If the following information is displayed, the installation is successful.
    Complete!

Configure MySQL.

  1. Run the following command to start the MySQL service:

    service mysqld start

  2. Run the following command to set the administrator username and password. The password is self-defined. In this command, Huawei@123 is used an example.

    mysqladmin -u root password 'Huawei@123'

  3. Run the following command and enter the password of user root to enter the database:

    mysql -u root -p

  4. Run the following command to use the database:

    use mysql

  5. Run the following command to query the user list:

    select host,user from user;

    This command and the following database commands must end with a semicolon (;).

  6. Run the following command to refresh the user list and allow all IP addresses to access the database:

    update user set host='%' where user='root' LIMIT 1;

  7. Run the following command to forcibly update the permissions: and allow ECSs in the same subnet to access the MySQL database using private IP addresses.

    flush privileges;

  8. Run the following command to exit the database:

    quit

  9. Run the following command to restart the MySQL service:

    service mysqld restart

  10. Run the following command to enable the MySQL service to automatically start upon system boot:

    chkconfig mysqld on

  11. Run the following command to disable the firewall:

    service iptables stop

  12. Run the following command to permanently disable the firewall after restarting the ECS:

    chkconfig iptables off

Setting Up the Web Environment

Install the web environment.

  1. Unbind the EIP from ECS discuz01 and bind it to ECS discuz02.

  2. Log in to ECS discuz02 remotely and enter the username and password. For details, see the operations for logging in to ECS discuz01.
  3. Run the following command to install the Apache server, PHP FastCGI manager, MySQL client, and MySQL database server:

    yum install -y httpd php php-fpm mysql mysql-server php-mysql

    If the following information is displayed, the installation is successful.
    Complete!
  4. Run the following command to reinstall the Apache server, PHP FastCGI manager, MySQL client, and MySQL database 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.

  1. Run the following command to start the httpd service:

    service httpd start

  2. Run the following command to enable the httpd service to automatically start upon system boot:

    chkconfig httpd on

  3. Run the following command to start the php-fpm service:

    service php-fpm start

  4. Run the following command to enable the php-fpm service to automatically start upon system boot:

    chkconfig php-fpm on

  5. Run the following command to disable the firewall:

    service iptables stop

  6. Run the following command to permanently disable the firewall after restarting the ECS:

    chkconfig iptables off

  7. Run the following command to start the MySQL service:

    service mysqld start

  8. Run the following command to enable the MySQL service to start upon system boot.

    chkconfig mysqld on

  9. Enter http://EIP in a browser to query the default page of the ECS.

Deploying the Website Code

  1. Log in to ECS discuz02 remotely and run the following command to install the Discuz software:
    wget http://download.comsenz.com/DiscuzX/3.3/Discuz_X3.3_SC_UTF8.zip
    • The recommended English version of Discuz X3.3 (UTF-8) is not free. 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.
  2. Run the following command to decompress the Discuz installation package:

    unzip Discuz_X3.3_SC_UTF8.zip

  3. Run the following command to copy all files in the decompressed upload folder to the var/www/html directory:

    cp -r upload/* /var/www/html

  4. Run the following command to grant write permissions to other users.

    chmod -R 777 /var/www/html

  5. Enter http://EIP in the address box and install Discuz following the guidance.
    1. Confirm the agreement and click I Agree.
    2. After the installation starts, check the installation environment and click Next.
    3. Set the running environment and click Next.
    4. Enter the database information and click Next to complete the installation.
      • The database address is the private IP address of discuz01.
      • The database password is the password of the database administrator account (username root) configured on discuz01.
      • The administrator information is required.

Verifying the Website

In the browser address bar, enter http://EIP/forum.php. If the forum homepage is displayed, the website is successfully built.