Server, VPS environment deployment and website program installation (Linux+LNMP+Discuz)

(Linux + LNMP + Discuz! X)

        Discuz! X is a product that uses PHP as the programming language, MySQL as the database, and Apache/IIS/Nginx (any one) to provide web services. To build the Discuz! X site, the server must have an environment consisting of PHP, MySQL, Apache/IIS/Nginx. Among them, IIS is mainly used for Windows servers, and Apache and Nginx are mostly used for Linux servers (ie LAMP and LNMP).

  When deploying a Linux server, you need to follow a certain order of deployment, namely:

  System environment initialization -> Apache / Nginx, MySQL, PHP package download -> Apache / Nginx, MySQL, PHP installation

  The following is an example of deploying Nginx, MySQL, and PHP on a Linux server to demonstrate the specific process of setting up the environment.

First, the system environment initialization

1. Check if the system is normal.

More /var/log/messages (check for system level error messages)

Dmesg (check if the hardware device has an error message)

Cat /proc/cpuinfo (Check if the CPU frequency is normal)

Top (Press 1 to check if the CPU core is normal and the memory size is normal)

Ifconfig (check if the NIC settings are correct)

Ping (check if the network is normal)

2, close the unneeded service

Execute the ntsysv command:


In the service settings interface, set the switches for each service. The following only lists the services that need to be started. Unlisted services are recommended to be closed:









Close SElinux, the shutdown method is as follows:

Modify SELINUX= in the /etc/selinux/config file to be disabled.

3. Timing calibration of the server clock, timing synchronization with the China National Time Service Center Time Server

Edit the scheduled task:

Crontab –e

Add the following line:

*/30 * * * * ntpdate > /dev/null 2>&1

After editing is complete, save it.

Second, download the LNMP installation package and compile and install

1. Log in to the VPS or server using putty or a similar SSH tool.

Run after login: screen -S lnmp

If the prompt screen: command not found command does not exist, you can execute it: yum install screen or apt-get install screen.

2. Download and install the LNMP one-click installation package:

You can choose to use the download version (recommended for foreign or US VPS use) or the full version (recommended for domestic VPS use), there is no difference between the two.

You need to confirm your Linux distribution before executing the installer. You can execute: cat /etc/issue to check whether it is CentOS, Debian or Ubuntu, or you can view it through the control panel provided by the VPS service provider. After you have made your decision, select the installation command for the corresponding system below:

 Execute under CentOS: wget -c && tar zxvf lnmp1.0-full.tar.gz && cd lnmp1.0-full && . /

Execute on Debian system: wget -c && tar zxvf lnmp1.0-full.tar.gz && cd lnmp1.0-full && . /

Execute under Ubuntu: wget -c && tar zxvf lnmp1.0-full.tar.gz && cd lnmp1.0-full && . /

In addition, there are 2 foreign image download points that can be replaced by and

To install version 0.9, please visit

After executing the above command, the following prompt will appear:

(Note: If it is a Debian system, it will prompt Where are your servers located? asia, america, europe, oceania or africa, here is the choice of server / VPS in which continent, generally the US VPS, direct carriage return, if it is China Enter asia and press Enter. If there is an error in the input, you can press and hold Ctrl and then press Backspace to delete. The following methods can be deleted.)

This step needs to set the MySQL root password, enter and press Enter to go to the next step, as shown below:

Here you need to confirm whether MySQL InnoDB is enabled. If you are not sure whether to enable y, this can be turned off separately in the MySQL file. Enter y for enable and n for not. Enter y or n and press Enter to proceed to the next step, displaying the following message:

This step is to choose the php version, you can choose PHP 5.3.17 or PHP 5.2.17, install PHP 5.3.17, enter y, install PHP 5.2.17, enter n, type y or n and press Enter to enter the next MySQL version. Choose, as shown below:

You can choose MySQL version 5.5.27 or 5.1.60. If you install MySQL 5.5.27, enter y, install MySQL 5.1.60 and enter n. Enter y or n and press Enter to complete the selection.

Prompt "Press any key to start...", press Enter to confirm the installation.

The LNMP script will automatically install and compile Nginx, MySQL, PHP, phpMyAdmin, and Zend Optimizer.

The installation time may vary from tens of minutes to several hours, mainly due to reasons such as the configuration speed of the machine.

3. Installation is complete:


If the following interface is displayed:

The description has been successfully installed.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to choose the cloud server?

★ Choose the right cloud server configuration based on your actual business needs: Understand...

How do I connect to my cloud server? (including linux and windows)

First of all to distinguish between linux and windows, including ubuntu, centos, debian are...

linux system data disk merged into the system disk

 Check it out, the current command: df -h [[email protected] ~]# df -h Filesystem...

Linux cloud server data disk expansion tutorial guide

This tutorial belongs to the data disk expansion [non-system disk] default directory /dev/sdb...

About the automatic synchronization of cloud server time, and the problem that time cannot be modified.

Recently, there have been user feedback, cloud server time cannot be modified. The solution is...