Centos6.7 compiling and installing Apache PHP
##### Apache Compile and install # # #
[[Email protected]~]# Yum Install gcc gcc-c++Make Wget[[email protected]~]# Yum Install Zlib-devel openssl-devel [[email protected]~]# Yum install-y Perl perl-devel1) Apr[[email protected] src]# wget http://Mirror.bit.edu.cn/apache//apr/apr-1.5.2.tar.gz[Email protected] src]# tar zxvf apr-1.5.2. Tar.gz[[email protected] src]# CD Apr-1.5.2[email protected] Apr-1.5.2]#./configure--prefix=/usr/local/apache/apr[[email protected] Apr-1.5.2]# make &&Make Install2) apr-Util[[email protected] src]# wget http://Mirror.bit.edu.cn/apache//apr/apr-util-1.5.4.tar.gz[Email protected] src]# tar zxvf apr-util-1.5.4. Tar.gz[[email protected] src]# CD Apr-util-1.5.4[email protected] Apr-util-1.5.4]#./configure--prefix=/usr/local/apache/apr-util--with-apr=/usr/local/apache/apr[[email protected] Apr-util-1.5.4]# make &&Make Install3) Pcre[[email protected] src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz[Email protected] src]# tar zxvf pcre-8.37. Tar.gz[[email protected] src]# CD Pcre-8.37[email protected] pcre-8.37]# ./configure[[email protected]t pcre-8.37]# make &&Make Install4) Apache[[email protected]~]# cd/usr/local/src/[[Email protected]~]# wget http://Mirrors.cnnic.cn/apache//httpd/httpd-2.4.17.tar.gz[Email protected] src]# tar zxvf httpd-2.4. -. Tar.gz[[email protected] src]# CD httpd-2.4. -[email protected] httpd-2.4. -]#./configure--prefix=/usr/local/Apache--with-apr=/usr/local/apache/apr/bin/apr-1-Config--with-apr-util=/usr/local/apache/apr-util/bin/apu-1-Config--enable-module= So--enable-mods-shared= All--enable-deflate--enable-Expires--enable-Headers--enable-Cache--enable-file-Cache--enable-mem-Cache--enable-disk-Cache--enable-mime-Magic--enable-authn-dbm--enable-vhost-alias--enable- So--enable-rewrite--enable-SSL--with-mpm=Prefork[[email protected] httpd-2.4. -]# make &&Make install#index.php#addhandler php5-script. Php#addtype text/HTML. php###### httpd end ###########[[email protected]~]# ln-s/usr/local/apache/conf/etc/Httpd[[email protected]~]# ln-s/usr/local/apache/bin/* /usr/sbin/[[email protected] ~]# touch/etc/init.d/httpd[[email protected] ~]# chmod 755/etc/init.d/httpd[ [email protected] ~]# vi/etc/init.d/httpd#!/bin/bash## httpd Startup script for the Apache HTTP server## CHKC Onfig:-15# description:the Apache HTTP Server is an efficient and extensible # Server implementing the CU rrent HTTP standards.# processname:httpd# config:/etc/httpd/conf/httpd.conf# config:/etc/sysconfig/httpd# pidfile:/ var/run/httpd/httpd.pid#### BEGIN INIT info# provides:httpd# required-start: $local _fs $remote _fs $network $named # Requi Red-stop: $local _fs $remote _fs $network # should-start:distcache# Short-description:start and Stop Apache HTTP server# De Scription:the Apache HTTP Server is a extensible server # Implementing the current HTTP standards.### END INIT info# so Urce function Library. /etc/rc.d/init.d/functionsif [-F/ETC/SYSCONFIG/HTTPD]; Then. /etc/sysconfig/httpdfihttpd_lang=${httpd_lang-"C"}initlog_Args= "" apachectl=/usr/sbin/apachectlhttpd=${httpd-/usr/sbin/httpd}prog=httpdpidfile=${pidfile-/usr/local/ Apache/logs/httpd.pid}lockfile=${lockfile-/var/lock/subsys/httpd}retval=0stop_timeout=${stop_timeout-10}start ( {echo-n $ "starting $prog:" lang= $HTTPD _lang daemon--pidfile=${pidfile} $httpd $OPTIONS retval=$ ? echo [$RETVAL = 0] && Touch ${lockfile} return $RETVAL}stop () {echo-n $ "stopping $prog:" Killproc-p ${pidfile}-D ${stop_timeout} $httpd retval=$? echo [$RETVAL = 0] && rm-f ${lockfile} ${pidfile}}reload () {echo-n $ "reloading $prog:" If! lang= $HTTPD _lang $httpd $OPTIONS-T >&/dev/null; Then retval=6 echo $ ' reloading due to configuration syntax error ' failure $ ' not reloading $HTTPD Due to configuration syntax error "Else # force LSB behaviour from Killproc lsb=1 killproc-p ${pidfile} $HTTPD-hup retval=$? if [$RETVAL-eq : 0; Then failure $ "httpd shutdown" fi fi echo}case "$" in start) start; stop) stop;; Status) status-p ${pidfile} $httpd retval=$? ;; restart) stop start;; Condrestart|try-restart) if Status-p ${pidfile} $httpd >&/dev/null; Then stop start fi;; Force-reload|reload) reload;; Graceful|help|configtest|fullstatus) $apachectl [email protected] retval=$? ;; *) echo $ "Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful| Help|configtest} "Retval=2esacexit $RETVAL [[email protected] ~]# chkconfig--add httpd[[email protected] ~] # Chkconfig httpd on
##### PHP Compilation Installation # # #
[[Email protected]~]# Yum Install libxml2-devel curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel net-snmp net-sn mp-Devel[[email protected] src]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz[Email protected] src]# tar zxvf libiconv-1.14. Tar.gz[[email protected] src]# CD Libiconv-1.14[email protected] Libiconv-1.14]#./configure--prefix=/usr/local/php/Libiconv[[email protected] Libiconv-1.14]# make &&Make Install[[email protected] src]# wget http://nchc.dl.sourceforge.net/project/mcrypt/libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz[Email protected] src]# tar zxvf libmcrypt-2.5.8. Tar.gz[[email protected] src]# CD Libmcrypt-2.5.8[email protected] Libmcrypt-2.5.8]# ./Configure[[email protected] Libmcrypt-2.5.8]# make &&Make Install[[email protected] libltdl]#/sbin/ldconfig && CD libltdl/[email protected] libltdl]#./configure--enable-ltdl-Install[[email protected] libltdl]# make&&Make Install[[email protected] src]# wget http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz[Email protected] src]# tar zxvf mhash-0.9.9.9. Tar.gz[[email protected] src]# CD Mhash-0.9.9.9[email protected] Mhash-0.9.9.9]# ./Configure[[email protected] Mhash-0.9.9.9]# make &&Make Install[[email protected] src]# wget http://nchc.dl.sourceforge.net/project/mcrypt/mcrypt/2.6.8/mcrypt-2.6.8.tar.gz[Email protected] src]# tar zxvf mcrypt-2.6.8. Tar.gz[[email protected] src]# CD MCrypt-2.6.8[email protected] MCrypt-2.6.8]#/sbin/ldconfig && Export ld_library_path=/usr/local/Lib:ld_library_path[[email protected] MCrypt-2.6.8]# ./configure [[email protected] MCrypt-2.6.8]# make &&Make Install[[email protected] src]# wget http://cn2.php.net/distributions/php-5.6.15.tar.gz[Email protected] src]# tar zxvf php-5.6. the. Tar.gz[[email protected] src]# CD PHP-5.6. the[[email protected] PHP-5.6. the]#./configure--prefix=/usr/local/PHP--with-config-file-path=/usr/local/php/etc--with-iconv=/usr/local/php/Libiconv--with-apxs2=/usr/local/apache/bin/Apxs--with-mysql=Mysqlnd--with-mysqli=Mysqlnd--with-pdo-mysql=Mysqlnd--with-GD--with-jpeg-dir--with-png-dir--with-Pear--with-freetype-dir--with-zlib--with-libxml-dir--with-iconv-dir--with-Xmlrpc--with-Mhash--with-MCrypt--with-Curl--with-OpenSSL--with-SNMP--with-GetText--enable-PDO--enable-mbstring--enable-CType--enable-SimpleXML--enable-FTP--enable-Sockets--enable-gd-native-TTF--enable-Sysvsem--enable-EXIF--enable-Sysvshm--enable-XML--enable-Dom--enable-SimpleXML--enable-Shmop--enable-Zip--enable-Mbregex--enable-Bcmath--enable-inline-optimization--enable-soap[[email protected] PHP-5.6. the]# make &&Make install[[email protected] PHP-5.6. the]# CP php.ini-production/usr/local/php/etc/Php.ini[[email protected]~]# ln-s/usr/local/php/bin/*/usr/sbin/
Centos6.7 compiling and installing Apache PHP