Because Nginx is a high-performance http and reverse proxy server. Nginx has a strong advantage in reverse proxy, rewrite rules, stability, static file processing, memory consumption and so on. Therefore, most of the Web services on the company's online and test environments are LNMP environments, often for LNMP environments, and the following are scripts written with shell scripts to install the LNMP environment.
1) System Environment Introduction
Centos 5.8 64-bit (tested)
Nginx:nginx-1.4.1.tar.gz
Php:php-5.3.27.tar.gz
Mysql:mysql-5.6.5-m8.tar.gz
2) One-click Installation LNMP Environment
Cd/root/sh
wget http://sourceforge.net/projects/opensourcefile/files/Install_Centos_LNMP_v.0.1.sh/download
install_centos_lnmp_v.0.1.sh
3) View the shell script for the LNMP one-click installation script
Cat install_centos_lnmp_v.0.1.sh
#!/bin/bash
#author: Sfzhang
Mkdir-p/software
Cd/software
wget http://sourceforge.net/projects/opensourcefile/files/Centos_LNMP_v.0.1.tar.gz/download
If [$?-eq 0]
Then
Unzip centos_lnmp_v.0.1.tar.gz
Rm-f centos_lnmp_v.0.1.tar.gz
Else
echo "Downloading Http://sourceforge.net/projects/opensourcefile/files/Centos_LNMP_v.0.1.tar.gz/download failured !"
Exit 1
Fi
echo "Installing LNMP depend packages ... "
sh/software/install_packages.sh
If [$?-eq 0]
Then
echo "LNMP Depend packages install sucessfull!"
Else
echo "LNMP Depend packages install failured!"
Exit 1
Fi
echo "Installing PHP library files ..."
sh/software/install_php_lib.sh
If [$?-eq 0]
Then
echo "PHP Library install sucessfull!"
Else
echo "PHP Library install failured!"
Exit 1
Fi
echo "Installing Mysql,please waitting ..."
sh/software/install_mysql_5.6.sh
If [$?-eq 0]
Then
echo "MySQL install sucessfull!"
Else
echo "MySQL install failured!"
Exit 1
Fi
echo "Now installing Php,please waitting ..."
sh/software/install_php_5.3.sh
If [$?-eq 0]
Then
echo "PHP Install sucessfull!"
Else
echo "PHP Install failured!"
Exit 1
Fi
echo "Installing PHP extensions ..."
sh/software/install_php_ext.sh
If [$?-eq 0]
Then
echo "PHP Extensions install sucessfull!"
Else
echo "PHP Extensions install failured!"
Exit 1
Fi
echo "Installing Nginx ..."
sh/software/install_nginx.sh
If [$?-eq 0]
Then
echo "Nginx Install sucessfull!"
Else
echo "Nginx Install failured!"
Exit 1
Fi
echo "Optimizing the environment of the lnmp!"
sh/software/install_optimiz.sh
If [$?-eq 0]
Then
echo "Optimizing the environment of the LNMP sucessfull!"
Else
echo "Optimizing the environment of the LNMP failured!"
Exit 1
Fi
echo "Congratulations to you,a key installation Lnmp is successful!"