One-click installation of lnmp: Automatically detects the latest stable version, without the root permission

Source: Internet
Author: User

After installing the lnmp environment many times, I gradually wrote shell scripts, but every time I had to go to the nginx, PHP, and MySQL official websites to check the latest stable version, download it, and install it again, which was very difficult.

Now it is finally implemented:

1. Check the latest stable version on the official nginx, PHP, and MySQL websites and download and install it automatically.

2. Offline installation is supported.

3. The root and sudo permissions are not required, making it safer.

4. Add php-fpm.sh, mysqld. Sh, and use the same control method as nginx.

Start nginx:./nginx.ShDisable nginx :./Nginx.Sh-S stop restart nginx :./Nginx.Sh-S reload starts PHP :./PHP-FPM.ShClose PHP :./PHP-FPM.Sh-S stop restart PHP :./PHP-FPM.Sh-S reload start MYSQL :./MySQL/mysqld.ShClose MYSQL :./MySQL/mysqld.Sh-S stop

 

Project address: http://code.taobao.org/p/lnmp/

Script: http://code.taobao.org/svn/lnmp/trunk/src/lnmp.sh
Script URL: http://dwz.cn/lnmp-sh

Procedure:

 
WgetHTTP://Dwz.cn/lnmp-shChmod+ X lnmp-Sh./Lnmp-Sh

Offline installation:

 
./Lnmp-Sh-I offline

 

Principles:

#! /Bin/ Bash # nginx version check  Echo   '  Check nginx online  '  Wget -NV http: // Nginx.org/en/download.html-O nginx.html  # Official nginx download page. Format... <H4> stable version </H4> </center> <Table width = "  100%  " > < Tr > <TD width = "  20%  " > <A href = "  /En/changes-1.2  " > Changes- 1.2 </A> </TD> <TD width ="  20%  " > <A href = "  /Download/nginx-1.2.7.tar.gz  " > Nginx- 1.2 . 7 </A> ...Html = $ ( Cat  Nginx.html) # extract the string from the left to the right. </H4> </center> <Table width = "  100%  " > < Tr > <TD width = "  20%  " > <A href = "  /En/changes-1.2  " > Changes- 1.2 </A> </TD> <TD width = "  20%  " > <A href = "  /Download/nginx-1.2.7.tar.gz  " > Nginx-1.2 . 7 </A> ... TMP =$ {Html #* '  Stable version  '  } # Extract the string after the last string from the right to the left to obtain </H4> </center> <Table width = "  100%  " > < Tr > <TD width = "  20%  " > <A href ="  /En/changes-1.2  " > Changes- 1.2 </A> </TD> <TD width = "  20%  " > <A href = "  /Download/nginx-1.2.7 Tmp2 =$ {TMP % '  .Tar.gz  ' * } # Extract the string after the last string from left to right and get 1.  2.7 Nginxversion =$ {Tmp2 ##* '  Nginx-  '  }  Echo   '  Nginx:  ' $ Nginxversion

 

When the HTML format on the official nginx, PHP, and MySQL websites is modified, the version will fail to be detected and the script will be updated accordingly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.