LAMP 本地搭建脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LAMP 本地搭建脚本相关的知识,希望对你有一定的参考价值。


cd rpm

01########### 离线安装gcc-c++ ###########
rpm -Uvh mpfr-2.4.1-6.el6.x86_64.rpm
rpm -Uvh ppl-0.10.2-11.el6.x86_64.rpm
rpm -Uvh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
rpm -Uvh cpp-4.4.7-4.el6.x86_64.rpm
rpm -Uvh kernel-headers-2.6.32-431.el6.x86_64.rpm
rpm -Uvh glibc-headers-2.12-1.132.el6.x86_64.rpm
rpm -Uvh glibc-devel-2.12-1.132.el6.x86_64.rpm
rpm -Uvh libgomp-4.4.7-4.el6.x86_64.rpm
rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm
rpm -Uvh libstdc++-devel-4.4.7-4.el6.x86_64.rpm
rpm -Uvh gcc-c++-4.4.7-4.el6.x86_64.rpm


02########### 离线安装expat-devel ###########
rpm -Uvh expat-devel-2.0.1-11.el6_2.x86_64.rpm


03########### 离线安装pcre-devel ###########
rpm -Uvh pcre-devel-7.8-6.el6.x86_64.rpm


04########### 离线安装openssl-devel ###########
rpm -Uvh keyutils-libs-devel-1.4-4.el6.x86_64.rpm
rpm -Uvh libcom_err-devel-1.41.12-18.el6.x86_64.rpm
rpm -Uvh libsepol-devel-2.0.41-4.el6.x86_64.rpm
rpm -Uvh libselinux-devel-2.0.94-5.3.el6_4.1.x86_64.rpm
rpm -Uvh krb5-devel-1.10.3-10.el6_4.6.x86_64.rpm
rpm -Uvh zlib-devel-1.2.3-29.el6.x86_64.rpm
rpm -Uvh openssl-devel-1.0.1e-15.el6.x86_64.rpm


05########### 离线安装libxml2 ###########
rpm -Uvh libxml2-2.7.6-14.el6.x86_64.rpm
rpm -Uvh libxml2-devel-2.7.6-14.el6.x86_64.rpm


06########### 离线安装bzip2 ###########
rpm -Uvh bzip2-1.0.5-7.el6_0.x86_64.rpm
rpm -Uvh bzip2-devel-1.0.5-7.el6_0.x86_64.rpm


07########### 离线安装libcurl ###########
rpm -Uvh libcurl-7.19.7-37.el6_4.x86_64.rpm


08########### 离线安装libjpeg-turbo ###########
rpm -Uvh libjpeg-turbo-1.2.1-1.el6.x86_64.rpm
rpm -Uvh libjpeg-turbo-devel-1.2.1-1.el6.x86_64.rpm


09########### 离线安装libjpeg-turbo ###########
rpm -Uvh libpng-1.2.49-1.el6_2.x86_64.rpm
rpm -Uvh libpng-devel-1.2.49-1.el6_2.x86_64.rpm


10########### 离线安装freetype ###########
rpm -Uvh freetype-2.3.11-14.el6_3.1.x86_64.rpm
rpm -Uvh freetype-devel-2.3.11-14.el6_3.1.x86_64.rpm


11########### 离线安装gmp ###########
rpm -Uvh gmp-4.3.1-7.el6_2.2.x86_64.rpm
rpm -Uvh gmp-devel-4.3.1-7.el6_2.2.x86_64.rpm


12########### 离线安装readline ###########
rpm -Uvh readline-6.0-4.el6.x86_64.rpm
rpm -Uvh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm
rpm -Uvh readline-devel-6.0-4.el6.x86_64.rpm


13########### 离线安装libxslt ###########
rpm -Uvh libxslt-1.1.26-2.el6_3.1.x86_64.rpm
rpm -Uvh libgpg-error-devel-1.7-4.el6.x86_64.rpm
rpm -Uvh libgcrypt-devel-1.4.5-11.el6_4.x86_64.rpm
rpm -Uvh libxslt-devel-1.1.26-2.el6_3.1.x86_64.rpm


14########### 离线安装libmcrypt ###########
rpm -Uvh libmcrypt-2.5.7-5.el6.art.x86_64.rpm
rpm -Uvh libmcrypt-devel-2.5.7-5.el6.art.x86_64.rpm

cd ..

tar -zxvf apr-1.6.2.tar.gz
cd apr-1.6.2
rm -fr /vvonline/installpackage/apr-1.6.2/configure
cp -rv /vvonline/installpackage/conf/configure /vvonline/installpackage/apr-1.6.2/
./configure --prefix=/usr/local/apr
make
make install
cd ..
tar -zxvf apr-util-1.6.0.tar.gz
cd apr-util-1.6.0
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
make
make install
cd ..
tar -zxvf pcre-8.41.tar.gz
cd pcre-8.41
./configure --prefix=/usr/local/pcre
make
make install
cd ..
tar -zvxf httpd-2.4.26.tar.gz
cd httpd-2.4.26
mkdir -p /usr/local/apache2
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl --enable-ssl --enable-module=so --enable-rewrite --enable-cgid --enable-cgi
make
make install
rm -fr /usr/local/apache2/conf/httpd.conf
cp -rv /vvonline/installpackage/conf/httpd.conf /usr/local/apache2/conf/
PATH=$PATH:/usr/local/apache2/bin
export PATH
source /etc/profile
chown daemon.daemon -R /usr/local/apache2/htdocs
chmod 700 /usr/local/apache2/htdocs
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd/
chkconfig httpd on
service httpd start
cd ..
tar -zxvf php-7.1.6.tar.gz
cd php-7.1.6

 

./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-mysqli=shared,mysqlnd \
--with-pdo-mysql=shared,mysqlnd \
--with-libxml-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif
make && make install
PATH=$PATH:/usr/local/php/bin
export PATH
source /etc/profile
cp php.ini-production /usr/local/php/etc/php.ini
/usr/local/apache2/bin/apachectl -t
service httpd restart
mv /usr/local/apache2/htdocs/index.html /usr/local/apache2/htdocs/index_bak.html
cp -rv /vvonline/installpackage/conf/index.php /usr/local/apache2/htdocs/

 

 

 ####################### The End #######################

 

以上是关于LAMP 本地搭建脚本的主要内容,如果未能解决你的问题,请参考以下文章

lamp脚本一键搭建

lamp脚本一键搭建

LAMP 论坛搭建

搭建lamp的脚本

centos一键部署Lamp,shell脚本和搭建教程

lamp脚本一键搭建