<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[LAMP或LNMP一键安装包]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Sat, 13 Apr 2013 05:27:58 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	网上有很多LNMP/LAMP一键安装脚本，编译安装参数还要修改脚本，此脚本整合了LAMP和LNMP,在任何一台有网络的Red hat 或者centos 服务器上自动配置LNMP或者LAMP，用户可以自定义编译参数也可以使用此脚本默认的参数编译安装。还可以单独安装mysql、nginx、apache、php。<br/>使用方法：将下面代码保存一个文件，例如inst_lanmp.sh 上传到服务器上执行。<br/>此脚本在CentOS 6.0&nbsp;&nbsp;X864环境下通过：使用效果如下：<br/><a href="http://jackxiang.com/attachment.php?fid=329" target="_blank"><img src="http://jackxiang.com/attachment.php?fid=329" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://jackxiang.com/attachment.php?fid=330" target="_blank"><img src="http://jackxiang.com/attachment.php?fid=330" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>代码如下：<br/><textarea name="code" class="python" rows="15" cols="100">
#!/bin/bash&nbsp;&nbsp;
#set -x&nbsp;&nbsp;
#date: 2013-01-06&nbsp;&nbsp;
#Description: 一键安装LNMP环境 or LAMP 环境 
#Version: 0.1&nbsp;&nbsp;
#Author: Wolf&nbsp;&nbsp;
#定义命令搜索路径 
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin&nbsp;&nbsp;
export PATH&nbsp;&nbsp;
src_dir=/usr/src&nbsp;&nbsp;
nginx_dir=/usr/local/nginx&nbsp;&nbsp;
mysql_dir=/usr/local/mysql&nbsp;&nbsp;
php_dir=/usr/local/php&nbsp;&nbsp;
libmcrypt_dir=/usr/local/libmcypt&nbsp;&nbsp;
apache_dir=/usr/local/apache 
#关闭SELiunx 
echo &quot;Disabled SELinux&quot;&nbsp;&nbsp;
if [ -s /etc/selinux/config ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;sed -i &#039;s/SELINUX=enforcing/SELINUX=disabled/g&#039; /etc/selinux/config&nbsp;&nbsp;
fi 
 
/usr/sbin/setenforce 0&nbsp;&nbsp;
# Check if user is root&nbsp;&nbsp;
if [ &quot;$UID&quot; -ne 0 ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;printf &quot;Error: You must be root to run this script!&#92;n&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;exit 1&nbsp;&nbsp;
fi&nbsp;&nbsp;
 
#检查需要的软件包是否存在，如果没有就下载。 
download_src()&#123;&nbsp;&nbsp;
cd $src_dir&nbsp;&nbsp;
 
if [ -s libiconv-1.13.1.tar.gz ] 
then 
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;libiconv-1.13.1.tar.gz found&quot; 
else 
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;libiconv-1.13.1.tar.gz not found. download new....&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;wget http://mozbuildtools.googlecode.com/files/libiconv-1.13.1.tar.gz 
fi 
 
if [ -s mhash-0.9.9.9.tar.gz ] 
then 
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;mhash-0.9.9.9.tar.gz found&quot; 
else 
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;mhash-0.9.9.9.tar.gz not found. download new.....&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;wget http://acelnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz 
fi 
 
if [ -s mysql-5.5.25a.tar.gz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;mysql-5.5.25a.tar.gz found&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;mysql-5.5.25a.tar.gz not found. download new.....&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://mysql.ntu.edu.tw/Downloads/MySQL-5.5/mysql-5.5.25a.tar.gz&nbsp;&nbsp; 
fi 
&nbsp;&nbsp;
if [ -s php-5.3.13.tar.gz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;php-5.3.13.tar.gz found&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;php-5.3.13.tar.gz not found. download new.....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://us1.php.net/distributions/php-5.3.13.tar.gz&nbsp;&nbsp;
fi 
&nbsp;&nbsp;
if [ -s google-perftools-1.6.tar.gz ] 
then 
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;google-perftools-1.6.tar.gz found&quot; 
else 
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;google-perftools-1.6.tar.gz not found. download new.....&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;wget http://gperftools.googlecode.com/files/google-perftools-1.6.tar.gz 
fi 
 
if [ -s cmake-2.8.4.tar.gz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;cmake-2.8.4.tar.gz found......&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;cmake-2.8.4.tar.gz not found. download new.....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz&nbsp;&nbsp;
fi 
&nbsp;&nbsp;
if [ -s libmcrypt-2.5.7.tar.gz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;libmcrypt-2.5.7.tar.gz found&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;libmcrypt-2.5.7.tar.gz not found. download new...&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/Production/libmcrypt-2.5.7.tar.gz&nbsp;&nbsp;
fi 
&nbsp;&nbsp;
if [ -s memcache-2.2.5.tgz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;memcache-2.2.5.tgz found&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;memcache-2.2.5.tgz not found. download new......&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://vps.googlecode.com/files/memcache-2.2.5.tgz&nbsp;&nbsp;
fi 
&nbsp;&nbsp;
if [ -s eaccelerator-0.9.5.3.tar.bz2 ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;eaccelerator-0.9.5.3.tar.bz2 found&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;eaccelerator-0.9.5.3.tar.bz2 not found. download new..&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://autosetup1.googlecode.com/files/eaccelerator-0.9.5.3.tar.bz2&nbsp;&nbsp;
fi 
&nbsp;&nbsp;
if [ -s ImageMagick.tar.gz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;ImageMagick.tar.gz found&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;ImageMagick.tar.gz not found. download nrw.&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://www.imagemagick.org/download/ImageMagick.tar.gz&nbsp;&nbsp;
fi 
&nbsp;&nbsp;
if [ -s imagick-2.3.0.tgz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;imagick-2.3.0.tgz found&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;&nbsp;&quot;imagick-2.3.0.tgz not found. download new&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://lnmpp.googlecode.com/files/imagick-2.3.0.tgz&nbsp;&nbsp;
fi&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
 
#初始化服务器 
init_server()&#123;&nbsp;&nbsp;
for src in dialog ntp vim-enhanced vixie-cron gcc gcc-c++ gcc-g77 flex bison autoconf automake glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libtool* zlib-devel libxml2-devel libjpeg-devel libpng-devel libtiff-devel fontconfig-devel freetype-devel libXpm-devel gettext-devel curl curl-devel pam-devel e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel net-snmp net-snmp-devel nss_ldap openldap-clients openldap-servers libtidy libtidy-devel wget libc-client libc-client-devel pcre pcre-devel&nbsp;&nbsp;
do&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;yum -y install $src&nbsp;&nbsp;
done&nbsp;&nbsp;
 
ln -s /usr/lib64/libc-client.so* /usr/lib/&nbsp;&nbsp;
ln -s /usr/lib64/libldap* /usr/lib&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
 
 
#先检测apache是否已经安装，如果已经安装就不在安装，如果没有安装就安装apache 
cd $src_dir 
inst_apache () &#123; 
if [ -d $apache_dir ] 
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Apache is installed&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;exit 1 
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir 
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Apache not install. install run...&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;if [ -s httpd-2.2.24.tar.gz ] 
&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;httpd-2.2.24.tar.gz found.&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;httpd-2.2.24.tar.gz not found. download new....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wget http://mirror.apache-kr.org/httpd/httpd-2.2.24.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$apache_mo&quot; = &quot;&quot; ] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你没有输入编译参数，使用默认的参数进行编译.......&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf httpd-2.2.24.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir/httpd-2.2.24 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=/usr/local/apache3 --enable-so --enable-rewrite --enable-mods-shared=most --with-mpm=worker 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd ../ 
&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf httpd-2.2.24.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir/httpd-2.2.24 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$apache_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi 
 fi 
&#125; 
&nbsp;&nbsp;
#先检测mysql是否已经安装，如果已经安装了就不再安装，如果没安装就安装mysql 
inst_mysql()&#123;&nbsp;&nbsp;
useradd -s /sbin/nologin -M mysql 
tar zxvf cmake-2.8.4.tar.gz&nbsp;&nbsp;
cd $src_dir/cmake-2.8.4&nbsp;&nbsp;
./configure &amp;&amp; make &amp;&amp; make install 
&nbsp;&nbsp;
if [ -d $mysql_dir ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL is installed&quot;&nbsp;&nbsp;
else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$mysql_mo&quot; = &quot;&quot; ] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你没有输入mysql编译参数，使用本脚本默认参数进行编译......&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL not install. install run...&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf mysql-5.5.25a.tar.gz&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd mysql-5.5.25a&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_SSL=yes&nbsp;&nbsp;-DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=on&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gmake &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL not install. install run...&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf mysql-5.5.25a.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd mysql-5.5.25a 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$mysql 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi 
fi&nbsp;&nbsp;
 
if [ -f /ect/my.cnf ]&nbsp;&nbsp;
then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir/mysql-5.5.25a 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL config file my.cnf found. backup my.cnf to my.cnf.bak&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mv /etc/my.cnf /etc/my.cnf.bak&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/bin/cp support-files/my-small.cnf /etc/my.cnf&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/bin/cp support-files/mysql.server /etc/rc.d/init.d/mysqld&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chmod 755 /etc/rc.d/init.d/mysqld 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chown mysql:mysql /usr/local/mysql -R 
fi&nbsp;&nbsp;
/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --user=mysql --defaults-file=/etc/my.cnf 
chown mysql:mysql /usr/local/mysql -R&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
&nbsp;&nbsp;
inst_libmcypt()&#123;&nbsp;&nbsp;
if [ -d $libmcrypt_dir ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;libmcrypt is installed.&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf libmcrypt-2.5.7.tar.gz&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd libmcrypt-2.5.7&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=/usr/local/libmcypt &amp;&amp; make &amp;&amp; make install&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/sbin/ldconfig 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd libltdl/ 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --enable-ltdl-install 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make install 
fi 
&nbsp;&nbsp;
cd $src_dir 
tar zxf mhash-0.9.9.9.tar.gz 
cd mhash-0.9.9.9/ 
./configure 
make 
make install 
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a 
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la 
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so 
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2 
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1 
&#125;&nbsp;&nbsp;
#先检测PHP是否已经编译安装，如果安装了就不再进行安装，如果没安装就安装PHP 
inst_php_apache()&#123;&nbsp;&nbsp;
cd $src_dir 
tar zxf libiconv-1.13.1.tar.gz 
cd libiconv-1.13.1/ 
./configure --prefix=/usr/local 
make 
make install 
cd $src_dir&nbsp;&nbsp;
if [ -d $php_dir ] 
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP is installed&quot;&nbsp;&nbsp;
else 
&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$php_mo&quot; = &quot;&quot; ] 
&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你没有输入编译安装参数，使用本脚本默认的参数进行编译安装..........&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP not install. install run....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf php-5.3.13.tar.gz&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd php-5.3.13&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-mysql=/usr/local/mysql/bin/mysql_config --with-enable-sysvsem --with-apxs2=/usr/local/apache/bin/apxs --with-openssl --with-zlib --with-bz2 --with-curl --with-libxml-dir=/usr --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-gd-native-ttf --enable-gd-jis-conv --without-iconv --with-ldap --with-mcrypt=/usr/local/libmcypt --with-zlib-dir --with-snmp --enable-zip --with-curlwrappers --with-imap --with-kerberos --with-imap-ssl --with-freetype-dir --with-mysql=/usr/local/mysql&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp php.ini-development /usr/local/php/lib/php.ini&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;使用你输入的参数进行编译安装.......&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP not install. install run....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf php-5.3.13.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd php-5.3.13 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$php_mo&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp php.ini-development /usr/local/php/lib/php.ini 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
&nbsp;&nbsp;&nbsp;&nbsp;fi 
fi&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
inst_php()&#123;&nbsp;&nbsp;
cd $src_dir 
tar zxf libiconv-1.13.1.tar.gz 
cd libiconv-1.13.1/ 
./configure --prefix=/usr/local/libiconv 
make 
make install 
cd $src_dir&nbsp;&nbsp;
if [ -d $php_dir)&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP is installed&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$php_mo&quot; = &quot;&quot; ] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你没有输入PHP安装编译参数，将使用本脚本默认参数进行编译......&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 5 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;请选择安装方式，1,安装和Nginx结合使用的PHP，2,安装和apache结合使用的PHP.....&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入一个数字[1 &#124; 2]: &quot;&nbsp;&nbsp;php_num 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case $php_num in 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;正在安装和nginx结合使用的PHP..........&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 5 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP not install. install run....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf php-5.3.13.tar.gz&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd php-5.3.13&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-mysql=/usr/local/mysql/bin/mysql_config --with-enable-sysvsem --enable-fpm --with-openssl --with-zlib --with-bz2 --with-curl --with-libxml-dir=/usr --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-iconv=/use/local/libiconv --with-ldap --with-mcrypt=/usr/local/libmcypt --with-zlib-dir --with-snmp --enable-zip --with-curlwrappers --with-imap --with-kerberos --with-imap-ssl --with-freetype-dir --with-mysql=/usr/local/mysql 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp php.ini-development /usr/local/php/lib/php.ini&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;正在安装和apache结合使用的PHP.......&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 5 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-mysql=/usr/local/mysql/bin/mysql_config --with-enable-sysvsem --with-apxs2=/usr/local/apache/bin/apxs --with-openssl --with-zlib --with-bz2 --with-curl --with-libxml-dir=/usr --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-gd-native-ttf --enable-gd-jis-conv --without-iconv --with-ldap --with-mcrypt=/usr/local/libmcypt --with-zlib-dir --with-snmp --enable-zip --with-curlwrappers --with-imap --with-kerberos --with-imap-ssl --with-freetype-dir --with-mysql=/usr/local/mysql 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp php.ini-development /usr/local/php/lib/php.ini 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;请输入一个数字[1 &#124; 2]: &quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;esac 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你输入了PHP编译安装参数，使用你输入的参数进行编译.......&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 5 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP not install. install run....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf php-5.3.13.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd php-5.3.13 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$php_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp php.ini-development /usr/local/php/lib/php.ini&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi 
fi&nbsp;&nbsp;
&#125; 
 
inst_php_nginx () &#123; 
cd $src_dir 
tar zxf libiconv-1.13.1.tar.gz 
cd libiconv-1.13.1/ 
./configure --prefix=/usr/local 
make 
make install 
cd $src_dir&nbsp;&nbsp;
if [ -d $php_dir)&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP is installed&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$php_mo&quot; = &quot;&quot; ] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你没有输入编译安装参数，使用本脚本默认的参数进行安装&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP not install. install run....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf php-5.3.13.tar.gz&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd php-5.3.13&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-mysql=/usr/local/mysql/bin/mysql_config --with-enable-sysvsem --enable-fpm --with-openssl --with-zlib --with-bz2 --with-curl --with-libxml-dir=/usr --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-gd-native-ttf --enable-gd-jis-conv --without-iconv --with-ldap --with-mcrypt=/usr/local/libmcypt --with-zlib-dir --with-snmp --enable-zip --with-curlwrappers --with-imap --with-kerberos --with-imap-ssl --with-freetype-dir --with-mysql=/usr/local/mysql&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp php.ini-development /usr/local/php/lib/php.ini&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你输入了mysql编译参数，使用你输入的参数进行编译........&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP not install. install run....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 5 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd php-5.3.13 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$php_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp php.ini-development /usr/local/php/lib/php.ini 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
fi&nbsp;&nbsp;
&#125; 
#安装PHP扩展&nbsp;&nbsp;
inst_php_ex()&#123;&nbsp;&nbsp;
cd $src_dir&nbsp;&nbsp;
tar zxf memcache-2.2.5.tgz&nbsp;&nbsp;
cd memcache-2.2.5/&nbsp;&nbsp;
$&#123;php_dir&#125;/bin/phpize&nbsp;&nbsp;
./configure --with-php-config=$&#123;php_dir&#125;/bin/php-config&nbsp;&nbsp;
make&nbsp;&nbsp;
make install&nbsp;&nbsp;
cd ../&nbsp;&nbsp;
&nbsp;&nbsp;
tar jxf eaccelerator-0.9.5.3.tar.bz2&nbsp;&nbsp;
cd eaccelerator-0.9.5.3&nbsp;&nbsp;
$&#123;php_dir&#125;/bin/phpize&nbsp;&nbsp;
./configure --enable-eaccelerator=shared --with-eaccelerator-shared-memory --with-php-config=$&#123;php_dir&#125;/bin/php-config&nbsp;&nbsp;
make&nbsp;&nbsp;
make install&nbsp;&nbsp;
cd $src_dir&nbsp;&nbsp;
&nbsp;&nbsp;
tar zxf ImageMagick.tar.gz&nbsp;&nbsp;
cd ImageMagick-6.8.1-9/&nbsp;&nbsp;
./configure&nbsp;&nbsp;
make&nbsp;&nbsp;
make install&nbsp;&nbsp;
cd ../ 
&nbsp;&nbsp;
tar zxf imagick-2.3.0.tgz&nbsp;&nbsp;
cd imagick-2.3.0/&nbsp;&nbsp;
$&#123;php_dir&#125;/bin/phpize 
./configure --with-php-config=$&#123;php_dir&#125;/bin/php-config&nbsp;&nbsp;
make&nbsp;&nbsp;
make install&nbsp;&nbsp;
cd ..&nbsp;&nbsp;
echo &quot;php extension installed successfully!&quot;&nbsp;&nbsp;
&#125;&nbsp;&nbsp;
#安装nginx&nbsp;&nbsp;
inst_nginx()&#123;&nbsp;&nbsp;
if [ -s nginx-1.3.10.tar.gz ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;nginx-1.3.10.tar.gz found.&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;nginx-1.3.10.tar.gz not found. download new....&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;wget http://www.nginx.org/download/nginx-1.3.10.tar.gz&nbsp;&nbsp;
fi 
&nbsp;&nbsp;
cd $src_dir 
tar zxf google-perftools-1.6.tar.gz 
cd google-perftools* 
./configure 
make 
make install 
cd $src_dir 
 
if [ -d $nginx_dir ]&nbsp;&nbsp;
then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx is installed&quot;&nbsp;&nbsp;
else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$nginx_mo&quot; = &quot;&quot; ] 
&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你没有输入安装参数，使用本脚本默认的参数进行编译安装&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf nginx-1.3.10.tar.gz&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd nginx-1.3.10&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_stub_status_module&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;你输入了安装参数，使用你输入的参数进行安装......&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd $src_dir 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tar zxvf nginx-1.3.10.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cd nginx-1.3.10&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$nginx_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install 
&nbsp;&nbsp;&nbsp;&nbsp;fi 
fi&nbsp;&nbsp;
&#125; 
&nbsp;&nbsp;
#生成一个PHP启动脚本，可以用service phpd start &#124; restart &#124; stop &#124; show 进行启动、重启、关闭、查看运行状态 
phpd()&#123; 
cat &lt;&lt;EOF &gt;&gt;phpd 
#!/bin/bash&nbsp;&nbsp; 
#Author: wolf 
#Date: 2013-01-03 
#&nbsp;&nbsp; 
#chkconfig: - 85 15&nbsp;&nbsp; 
#processname: php&nbsp;&nbsp;
php=/usr/local/php/sbin/php-fpm&nbsp;&nbsp; 
conf=/usr/local/php/etc/php-fpm.conf&nbsp;&nbsp; 
case $1 in&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -n &quot;Starting php&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$php&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot; done&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stop)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -n &quot;Stopping php&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;killall -9 php-fpm&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot; done&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;restart)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$0 stop&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$0 start&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; show)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ps -aux&#124;grep php&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -n &quot;Usage: $0 &#123;start&#124;restart&#124;reload&#124;stop&#124;test&#124;show&#125;&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
esac 
EOF 
if [ -f /usr/src/phpd ] 
then 
&nbsp;&nbsp;&nbsp;&nbsp;/bin/cp /usr/src/phpd /etc/rc.d/init.d/phpd 
&nbsp;&nbsp;&nbsp;&nbsp;chmod +x /etc/rc.d/init.d/phpd 
fi 
&#125; 
#生成nginx启动脚本，可以用service nginxd start &#124; restart &#124; stop &#124; reload &#124; test &#124; show 进行重启、关闭、启动&gt;、测试配置文件、查看状态和重新加载。 
nginxd()&#123; 
cat &lt;&lt;EOF &gt;&gt;/usr/src/nginxd 
#!/bin/bash&nbsp;&nbsp; 
#Author: wolf 
#Date: 2013-01-03 
#&nbsp;&nbsp; 
#chkconfig: - 85 15&nbsp;&nbsp; 
#description: Nginx is a World Wide Web server.&nbsp;&nbsp; 
#processname: nginx&nbsp;&nbsp; 
nginx=/usr/local/nginx/sbin/nginx&nbsp;&nbsp; 
conf=/usr/local/nginx/conf/nginx.conf&nbsp;&nbsp;&nbsp;&nbsp;
case $1 in&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -n &quot;Starting Nginx&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$nginx -c $conf&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot; done&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stop)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -n &quot;Stopping Nginx&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;killall -9 nginx&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot; done&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$nginx -t -c $conf&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reload)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -n &quot;Reloading Nginx&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ps auxww &#124; grep nginx &#124; grep master &#124; awk &#039;&#123;print $2&#125;&#039; &#124; xargs kill -HUP&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot; done&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;restart)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$0 stop&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$0 start&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; show)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ps -aux&#124;grep nginx&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *)&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -n &quot;Usage: $0 &#123;start&#124;restart&#124;reload&#124;stop&#124;test&#124;show&#125;&quot;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; 
esac 
EOF 
if [ -s /usr/src/nginxd ] 
then 
&nbsp;&nbsp;&nbsp;&nbsp;/bin/cp /usr/src/nginxd /etc/rc.d/init.d/nginxd 
&nbsp;&nbsp;&nbsp;&nbsp;chmod +x /etc/rc.d/init.d/nginxd 
fi 
&#125; 
cat &lt;&lt;EOF 
############################################ 
&nbsp;&nbsp;1 install Nginx 
&nbsp;&nbsp;2 install PHP 
&nbsp;&nbsp;3 install MySQL 
&nbsp;&nbsp;4 install LNMP 
&nbsp;&nbsp;5 install Apache 
&nbsp;&nbsp;6 install LAMP 
############################################ 
############################################ 
Select your web server(1 &#124; 2 &#124; 3 &#124; 4 &#124; 5 &#124; 6) 
EOF 
 
echo &quot;Input a number: &quot; 
read num 
case $num in&nbsp;&nbsp; 
&nbsp;&nbsp; 1)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入nginx的编译参数：&quot; nginx_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx installing........... have a rest&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;init_server&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;download_src&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_nginx&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp; 2)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入PHP的安装参数&quot; php_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP installing....... have a rest&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;download_src&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;init_server&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_mysql&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_libmcypt&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_php&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_php_ex 
&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;3)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入mysql编译安装参数: &quot; mysql_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL installing...... have a rest&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;init_server&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;download_src&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_mysql&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;4)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入nginx的编译参数：&quot; nginx_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入PHP的安装参数&quot; php_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入mysql编译安装参数: &quot; mysql_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;LNMP installing......&nbsp;&nbsp;have a rest&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;download_src&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;init_server&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_mysql&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_libmcypt&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_php&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_php_ex 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_nginx&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;5) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; read -p &quot;请输入apache编译安装参数: &quot; apache_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;apache installing....... nave a rest.&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; download_src&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; init_server&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inst_apache 
&nbsp;&nbsp;&nbsp;&nbsp;;; 
&nbsp;&nbsp;&nbsp;&nbsp;6) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入apache的安装参数: &quot; apache_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入mysql的安装参数: &quot; mysql_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read -p &quot;请输入php的安装参数: &quot;&nbsp;&nbsp;php_mo 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;LAMP installing......... nave a rest.&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;download_src 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;init_server 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_apache 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_mysql 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_libmcypt 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_php_apache 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inst_php_ex 
&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;*) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Input error&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Select your service(1 &#124; 2 &#124; 3 &#124; 4&#124; 5&#124; 6)&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
;; 
esac 
&nbsp;&nbsp;
#检查安装是否成功 
case $num in&nbsp;&nbsp;
&nbsp;&nbsp; 4)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if [ -s /usr/local/nginx ] &amp;&amp; [ -s /usr/local/php ] &amp;&amp; [ -s /usr/local/mysql ]&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;LNMP is install&nbsp;&nbsp;completed&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx basedir: /usr/local/nginx&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP basedir: /usr/local/php&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL basedir: /usr/local/mysql&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL datadir: /usr/local/mysql/data&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;LNMP is install fail&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;fi&nbsp;&nbsp;
&nbsp;&nbsp; ;;&nbsp;&nbsp;
&nbsp;&nbsp; 3)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if [ -s /usr/local/mysql ]&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx is install completed&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL basedir: /usr/local/mysql&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL datadir: /usr/local/mysql/data&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;phpd 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nginxd 
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx is install fail&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;fi&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp; 2)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;[ -s /usr/local/php ]&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP is install completed&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP basedir: /usr/local/php&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;phpd 
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP is install fail&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;fi&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;1)&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if [ -s /usr/local/nginx ]&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx is install completed&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx basedir: /usr/local/nginx &quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nginxd 
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Nginx is install fail&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;fi&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;
&nbsp;&nbsp; 5) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [ -s /usr/local/apache ] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Apache is installed completed.&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Apache basedir: /usr/local/nginx.&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Apache is install fail.&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi 
&nbsp;&nbsp; ;; 
&nbsp;&nbsp; 6) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ -s /usr/local/apache ] &amp;&amp; [ -s /usr/local/php ] &amp;&amp; [ -s /usr/local/mysql ] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;LNMP is install&nbsp;&nbsp;completed&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Apache basedir: /usr/local/apache&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;PHP basedir: /usr/local/php&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL basedir: /usr/local/mysql&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;MySQL datadir: /usr/local/mysql/data&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;LNMP is install fail&quot;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi 
&nbsp;&nbsp; ;; 
esac 
</textarea><br/><br/>来自：http://wolfchen.blog.51cto.com/2211749/1176237
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] LAMP或LNMP一键安装包]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>