Install Apache PHP (bird) with one click

Source: Internet
Author: User
Tags apache php mcrypt aliyun

##/bin/sh
Path=/home/oldboy/tools
[!-D $Path] && mkdir $Path-P

Cd/home/oldboy/tools
Yum Install Zlib-devel-y
wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.2.31.tar.gz &&\
Tar XF httpd-2.2.31.tar.gz &&\
CD httpd-2.2.31
./configure \
--prefix=/application/apache2.2.31 \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--ENABLE-SO \
--with-mpm=worker \
--enable-rewrite
Make &&\
Make install
Ln-s/application/apache2.2.31//application/apache
############### #PHP ###########
CD ~
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo
Yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel libmcrypt-devel mhash mcrypt Freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel openssl-devel-y
Cd/home/oldboy/tools
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
Tar zxf libiconv-1.14.tar.gz
CD libiconv-1.14
./configure--prefix=/usr/local/libiconv
Make
Make install
Cd.. /
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo
wget Http://php.net/get/php-5.3.27.tar.gz/from/this/mirror
Tar zxf Mirror
CD php-5.3.27/
./configure \
--prefix=/application/php5.3.27 \
--WITH-APXS2=/APPLICATION/APACHE/BIN/APXS \
--WITH-MYSQL=MYSQLND \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--WITH-LIBXML-DIR=/USR \
--enable-xml \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--ENABLE-SHMOP \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--WITH-GD \
--ENABLE-GD-NATIVE-TTF \
--WITH-OPENSSL \
--with-mhash \
--ENABLE-PCNTL \
--enable-sockets \
--WITH-XMLRPC \
--enable-zip \
--ENABLE-SOAP \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--enable-ftp
Make
Make install
Ln-s/application/php5.3.27/application/php
CP Php.ini-production/application/php/lib/php.ini
cd/application/apache/conf/
Sed-i ' 99cServerName 127.0.0.1:80\ ' httpd.conf
Sed-i ' 311cAddType application/x-httpd-php. php. phtml\ ' httpd.conf
Sed-i ' 312cAddType application/x-httpd-php-source. Phps\ ' httpd.conf
Sed-i ' 168cDirectoryIndex index.php index.html\ ' httpd.conf
Sed-i ' 67cUser www\ ' httpd.conf
Sed-i ' 68cGroup www\ ' httpd.conf
Useradd-u 513-s/sbin/nologin www
Sed-i ' 99cServerName 127.0.0.1:80\ ' httpd.conf
Sed-i ' 133c<directory "/application/apache2.2.31/html" >\ ' httpd.conf
Sed-i ' 379cInclude conf/extra/httpd-mpm.conf\ ' httpd.conf
Sed-i ' 397cInclude conf/extra/httpd-vhosts.conf\ ' httpd.conf
Cd/application/apache/conf/extra
Sed-i ' 27,42 d '/application/apache/conf/extra/httpd-vhosts.conf
##/bin/sh
echo "<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/application/apache2.2.31/html/www"
ServerName www.etiantian.org
Serveralias etiantian.org
Errorlog "/app/logs/www-error_log"
Customlog "/app/logs/www-access_log" common
</VirtualHost>

<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/application/apache2.2.31/html/bbs"
ServerName bbs.etiantian.org
Errorlog "/app/logs/bbs-error_log"
Customlog "/app/logs/bbs-access_log" common
</VirtualHost>

<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/application/apache2.2.31/html/blog"
ServerName blog.etiantian.org
Errorlog "/app/logs/blog-error_log"
Customlog "/app/logs/blog-access_log" common
</VirtualHost> ">>/application/apache/conf/extra/httpd-vhosts.conf
/application/apache/bin/apachectl Graceful


###### #感觉很菜有没有更高端一点的请教一下/(ㄒoㄒ)/~~########


This article from "Ys" blog, reproduced please contact the author!

Install Apache PHP (bird) with one click

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.