Introduction to the

The experiment uses the open source PBOOTCMS system as the background system of the enterprise website to build an enterprise website on the cloud server.

This tutorial guides you step by step to build a corporate website on a cloud server. This tutorial uses the open source PBOOTCMS system as the backend system for the enterprise website. You can experience that in this tutorial. Note: This tutorial only applies to CentOS 7.x. If you are buying an ECS server that uses a different version of the OS, the operation may be slightly different from this tutorial.

Log in to the cloud server

After purchasing an ECS server, the system creates an ECS instance. Each ECS instance corresponds to one cloud server that has been purchased. You can access the cloud server through the terminal tools on your computer for application deployment and environment construction. 1. In the ECS instance list page, select the region where the instance belongs.

2. Find the target instance, and then select [more] > [password/key] > [reset instance password] in the operation column, and then set the ECS instance login password in the pop-up dialog box.

  1. On the pop-up page, click Restart Now to make the new password take effect.

4. In the ECS instance list page, copy the public IP address of the ECS instance.

5. Open the command line terminal tool on your computer.

Windows Powershell. MAC: Terminal. Windows users please check whether the SSH tool is installed on your system. A. Enter the command ssh-v in the terminal.

ssh -V

If the SSH version is displayed, it is installed, as shown in the figure below.

B. If not installed, please download and install the OpenSSH tool.

6. Enter the connection command SSH root@[ipaddress] in the terminal.

You need to replace the IPAddress with the public IP address of your ECS server. For example.

SSH [email protected]

The command displays the following results.



7. Enter YES and then enter the login password for the cloud server.



After successful login, the following information will be displayed.

Install the LAMP environment

LAMP refers to the Apache, MySQL, and PHP environments that run under Linux. Refer to the following steps to install the development environment on the cloud server. 1. On the ECS server, download the LAMP one-click installation package and run it by executing the following command.

Wget http://soft.vpser.net/lnmp/lnmp1.7.tar.gz - cO lnmp1.7. Tar. Gz && tar ZXF lnmp1.7, tar, gz & CD lnmp1.7 && ./install.sh lamp

2. On the MySQL version configuration page, type 2 to select MySQL5.5 version.



MySQL > set password for user ‘root’; Please try to use a more complex password to avoid security risks.

Note: Please keep the password of the database, which will be used to store the content of the site.



4. Enter Y to confirm InnoDB storage engine.



5. Type 5 to select PHP5.6.



6. Enter 1 to choose not to install the memory allocator.



7. Enter the administrator email address.



8. Enter 1 to install Apache2.2.



9. Press any key to begin the installation.

The installation process takes about 17 minutes. Please be patient. The successful installation is shown in the following figure.

Deploying web applications

After completing the environment deployment, refer to the following operations to build the enterprise website. 1. On the ECS server, execute the following command to download the PBOOTCMS source file.

cd ~ && git clone https://gitee.com/hnaoyun/PbootCMS.git

2. Execute the following command to copy the installation package to the Apache wwwroot directory.

rm -rf /home/wwwroot/default/* && cp -r PbootCMS/* /home/wwwroot/default/

3. Execute the following command to modify the permissions of the root directory of the site.

chmod -R a+w /home/wwwroot/default/

4. Import the initial data of CMS into the MySQL database.

A. Execute the following command to create the database PBOOTCMS.

Note: Before executing the command, please replace 12345678 in the command with the database password you set.

mysql -uroot -p12345678 -e “create database pbootcms;” B. Execute the following command to initialize the table structure and data of the database PBOOTCMS.

Note: Before executing the command, please replace 12345678 in the command with the database password you set.

sql_file="/home/wwwroot/default/static/backup/sql/"$(ls /home/wwwroot/default/static/backup/sql/) &&
mysql -uroot -p12345678 pbootcms < $sql_file

5. Execute the following command to modify the database configuration of CMS system.

Note: Replace your database configuration according to the parameter specification before executing the command. By default you only need to change the database password.

cat > /home/wwwroot/default/config/database.php << EOF <? PHP return array('database' => array('type' => 'mysqli')) Mysqli,sqlite, pdo_sqlite 'host' => '127.0.0.1', // database server 'user' => 'root', // dbname => 'pbootcms'; // dbname => 'pbootcms'; EOF

6. Back to the ECS console, click on the ECS instance ID link to enter the ECS details page in the ECS instance list page.

7. In the left navigation bar, click this instance security group, and then click the security group ID link to view the security group configuration.

Ensure that the security group has access to port 80 open, otherwise the established enterprise website cannot be accessed. Security group is a virtual firewall with state detection and packet filtering capabilities, used to divide the security domain in the cloud. By configuring security group rules, you can control the inbound and outbound traffic of one or more ECS instances within a security group.



8. Enter the public network IP address of the cloud server in the browser address bar and enter the home page of the CMS system.

The default access path of the system background is http://<ECS public network IP address >/admin.php. The default account is admin and the password is 123456.

So far you have completed the establishment of the enterprise website, you can customize the content of the enterprise website according to the needs of the company.