LNMP One-click installation script

Source: Internet
Author: User
Tags mcrypt

#!/bin/bash

# INSTALL NGINX+PHP5


Yum-y Install libxml2* libtool* pcre* gettext*


Dir= ' pwd '

mkdir ${dir}/tmp

#VERSION = ' Cat/etc/redhat-release | awk ' {print $7} ' | Cut-c1 '

version= ' Lsb_release-r |awk ' {print $} ' |cut-c1 '


Cp-r/usr/local/src/install_nginx/mysql_x86_64/usr/local/mysql


Jpegsrc_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^jpegsrc* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/jpeg-6b

If [$VERSION-eq 6];then

\cp/usr/share/libtool/config/config.*.

Else

\cp/usr/share/libtool/config.*.

Fi

Mkdir-p/usr/local/man/man1

./configure--prefix=/usr/local--enable-static--enable-shared

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Libpng_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^libpng* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

CP Scripts/makefile.linux Makefile

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Freetype_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^freetype* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}



Libxml_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^libxml* '

Tar jxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}



Libiconv_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^libiconv* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Libmcrypt_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^libmcrypt* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

if [$VERSION! = 6];then

Rm-rf/usr/lib/libmcrypt.so.4

Fi

Ln-s/usr/local/lib/libmcrypt.so.4/usr/lib/libmcrypt.so.4

/sbin/ldconfig

CD libltdl/

./configure--enable-ltdl-install

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Mhash_function () {

CD ${dir}

File= ' ls-1 |grep-i ^mhash* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

if [$VERSION! = 6];then

Rm-rf/usr/lib/libmhash.so.2

Fi

Ln-s/usr/local/lib/libmhash.so.2/usr/lib/libmhash.so.2

}


Mcrypt_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^mcrypt* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

/sbin/ldconfig

./configure

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Gd_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^gd* '

Tar jxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure--prefix=/usr/local--with-jpeg=/usr/local--with-png=/usr/local

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Php_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^php.*tar.gz '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

GZIP-CD ${dir}/php-5.2.17-fpm-0.5.14.diff.gz | Patch-d ${dir}/tmp/${file%.tar.*}-P1

'./configure '--with-config-file-path=/usr/local/webserver/php/etc '--prefix=/usr/local/webserver/php '-- With-freetype-dir=/usr/local '--with-mysql=/usr/local/mysql '--with-zlib '--enable-shared '--with-curl '-- With-gd '--with-jpeg-dir=/usr/local '--with-png-dir=/usr/local '--enable-mbstring=all '--enable-mbregex '-- Enable-gd-native-ttf '--enable-fastcgi '--enable-fpm '--with-libxml-dir=/usr--enable-xml '-- Enable-force-cgi-redirect '--with-openssl '--enable-sockets '--disable-rpath '--enable-discard-path '-- Enable-safe-mode '--enable-bcmath '--enable-shmop '--enable-sysvsem '--enable-inline-optimization '-- Enable-pcntl '--with-iconv '--with-mcrypt '--with-mhash '

Make zend_extra_libs= '-liconv '

Make install

CP Php.ini-dist/usr/local/webserver/php/etc/php.ini

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Memcache_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^memcache* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tgz*}

/usr/local/webserver/php/bin/phpize

./configure--with-php-config=/usr/local/webserver/php/bin/php-config

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Eaccelerator_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^eaccelerator* '

Tar jxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

/usr/local/webserver/php/bin/phpize

./configure--enable-eaccelerator=shared--with-php-config=/usr/local/webserver/php/bin/php-config

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Pcre_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^pcre* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}


Nginx_function () {

CD ${dir}

File= ' ls-1 | Grep-i ^nginx* '

Tar zxf ${file}-C ${dir}/tmp/

CD tmp/${file%.tar*}

./configure--user=nobody--group=nobody--prefix=/usr/local/webserver/nginx--with-http_stub_status_module-- With-http_ssl_module

Make && make install

If [$?! = 0];then

echo "${file} ERROR!!!!!!!!!!!"

Exit 10

Fi

}



Jpegsrc_function

Libpng_function

Freetype_function

#Libxml_Function

Libiconv_function

Libmcrypt_function

Gd_function

Mhash_function

Mcrypt_function

Php_function

Memcache_function

Eaccelerator_function

Pcre_function

#Nginx_Function




Cd/usr/local/src/install_nginx

#yes | CP conf/fcgi.conf/usr/local/webserver/nginx/conf/

#yes | CP conf/nginx.conf/usr/local/webserver/nginx/conf/

Yes | CP conf/php-fpm.conf/usr/local/webserver/php/etc/

Yes | CP conf/php.ini/usr/local/webserver/php/etc/


This article is from the "Zhangdh Open Space" blog, so be sure to keep this source http://linuxblind.blog.51cto.com/7616603/1709757

LNMP One-click installation script

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.