Home > OS >  Share ali cloud LNAMP (Linux Nginx Apache MySQL, PHP) environment a key installation script
Share ali cloud LNAMP (Linux Nginx Apache MySQL, PHP) environment a key installation script

Time:10-03



Simple explanation:
Use this script can be automated to install Nginx (static request processing front end), Apache (as the back-end processing PHP requests), MySQL, PHP, FTP Linux system such as the necessary service environment,
Support CentOS, Debian and all major version of Ubuntu (tested version including CentOS - 5.9 - i386, CentOS - 5.9 - x86_64, CentOS - 6.4 - i386, CentOS - 6.4 - x86_64, Debian - 6-32 bit, Debian - 6-64 - bit, Debian - 7-32 bit, Debian - 7-64 - bit Ubuntu - 10-32 bit, Ubuntu - 10-64 - bit Ubuntu - 11-32 bit, Ubuntu - 11-64 - bit Ubuntu - 12-32 bit, Ubuntu - 12-64 - bit Ubuntu - 13-32 bit, Ubuntu - 13-64 - bit)

Why use LNAMP?
If you use LNMP, that is, in PHP - FPM way to run PHP, poor stability, often encountered errors such as: Nginx 502 Bad Gateway,
If you use the LAMP, Apache in dealing with a front-end HTTP request more efficiency than Nginx is very low,
In Nginx Apache way to run a web application can make full use of the advantages of the two: Nginx efficiently and the stability of the Apache,

And, the program will automatically according to the different host hardware situation to optimize the server software configuration parameters, fully USES the host resources,

Due to the different site procedures may have asked about the PHP version, for example, some websites program can only run under installs are, therefore, this installation script provides custom specified version of the PHP installation, support version including, installs are, PHP5.3, PHP5.4, PHP5.5 altogether four versions, see later for specific installation method,

Installation steps:
* note: if the host is installed by any other means the server environment, please before using this script, reshipment system! (note that the backup data)

(1) install the screen and the python command
Due to the install script is written using the Python language, so you need to install Python command to execute,
At the same time, in order to prevent the problems occurred in the installation process of SSH drops, suggest install screen command tool first,
CentOS system installation method is:
Yum install - y screen
(basic CentOS system has been installed the python command, without having to install again, because of yum is in itself a python program,
Debian and Ubuntu installation method is:
Apt - get the install - y screen python

(2) establish a screen window
After the installation screen using the following command to open a screen window:
Screen -s lnamp
Behind all the operations are done in this screen window,
If the installation on the SSH connection drops due to network problems, you can reconnect after SSH, use the following command to open the installation window:
Screen -x lnamp

(3) installed LNAMP
The above preparations start after the formal installed LNAMP,
Enter the following command, and then install script will automatically be installed LNAMP environment,
Wget - O - http://www.server110.com/lnamp/| python
After the installation, the screen display server account password information, at the same time, this information is stored in/root/setup. TXT, convenient to see in the future,

Custom PHP version:
The install script will be installed by default installs are (with ZendOptimizer 3.3.9 and XCache), in general, there is no need to modify,
If web application documentation for PHP version of the runtime environment have other requirements, such as must be under PHP5.3 to run, you will need to install the corresponding PHP version,
This installation script can support PHP version: 5.2 (the default), 5.3, 5.4, 5.5,
To specify the installation PHP5.3, for example, you need to use the following command parameters:
Wget - p - O - http://www.server110.com/lnamp/| python 5.3