Install apache2.4.7 and php5.4.23 in CentOS5.8 source code

Source: Internet
Author: User
Install Apache2.4.7: container and apr-util

Install Apache2.4.7: first download the apachesource code package httpd-2.4.7.tar.gz wget http://httpd.apache.org/download.cgi#apache24 from the http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.7.tar.gz download the http://apr.apache.org/download.cgi and apr-util


Install Apache2.4.7:

First from http://httpd.apache.org/download.cgi#apache24
Download the apachesource code package httpd-2.4.7.tar.gz
Wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.7.tar.gz

Download from http://apr.apache.org/download.cgi
Apr-1.5.0.tar.gzand apr-util-1.5.1.tar.gz
Wget http://apache.fayea.com/apache-mirror//apr/apr-1.5.0.tar.gz
Wget http://apache.fayea.com/apache-mirror//apr/apr-util-1.5.3.tar.gz
Download pcre-8.32.tar.gz from http://sourceforge.net/projects/pcre/files/pcre/8.32/
Wget http://sourceforge.net/projects/pcre/files/pcre/8.32/pcre-8.32.tar.gz/download

The source code is stored in/opt/sourcecode.
Installation path:/opt/soft/
First install gcc and make
Yum-y install gcc
Yum-y install make
Yum-y install gcc-c ++ does not have this gcc-c ++.

**************************************** **************************************** ********************
Skip this part
Install apr:
Tar-zvxf apr-1.5.0.tar.gz
Cd apr-1.5.0
./Configure -- prefix =/opt/soft/apr
Make & make install


Install apr-util
Tar-zvxf apr-util-1.5.3.tar.gz
Cd apr-util-1.5.3
./Configure -- prefix =/opt/soft/apr-util -- with-apr =/opt/soft/apr
Make & make install
**************************************** **************************************** **********************

Install pcre
Tar-zvxf pcre-8.32.tar.gz
Cd pcre-8.32
./Configure -- prefix =/opt/soft/pcre
Make & make install


Install apache
Tar-zvxf httpd-2.4.7.tar.gz
Cd httpd-2.4.7
Extract the source code for the apr-1.5.0 and apr-util-1.5.3 to the apr and apr-util under the httpd-2.4.7/srclib/

. /Configure -- prefix =/opt/soft/apache -- with-pcre =/opt/soft/pcre -- with-embedded ded-apr-enable-module = so -- enable-so -- enable -rewrite


// More options. /configure -- prefix =/opt/soft/apache -- with-apr-util =/opt/soft/apr-util -- with-apr =/opt/soft/apr --- pcre =/opt/soft/pcre-enable-module = so -- enable-rewrite

Make & make install


Start apache
/Opt/soft/apache/bin/httpd
/Opt/soft/apache/bin/apachectl restart



Install PHP5.5
Yum-y install libxml2-devel does not install this compilation cannot PHP5.4.23

Download PHP5.4.23 from www.php.net

Wget http://cn2.php.net/get/php-5.4.23.tar.gz/from/this/mirror
Tar-zvxf php-5.4.23.tar.gz
Cd php-5.4.23
. /Configure -- prefix =/opt/soft/php -- with-config-file-path =/opt/soft/php/etc -- with-apxs2 =/opt/soft/apache/bin/ apxs -- enable-fpm -- with-mysql -- enable-sysvsem -- enable-sockets -- enable-pcntl -- enable-mbstring -- enable-mysqlnd -- enable-shmop -- enable-zip -- enable- ftp -- enable-gd-native-ttf -- enable-soap -- enable-xml

Make & make install


// More options .... /configure -- prefix =/opt/soft/php -- with-config-file-path =/opt/soft/php/etc -- enable-fpm -- enable-sysvsem -- enable-sockets -- enable-pcntl -- enable-mbstring -- enable-mysqlnd -- enable-opcache -- enable-shmop -- enable-zip -- with-mcrypt =/usr/local/libmcrypt/-- with-zlib =/usr/local/zlib/-- with-curl =/usr/local/curl/-- with-pcre-dir =/usr/local/pcre/-- with-t1lib =/usr/ local/tlib/-- with-pdo-mysql =/usr/-- with-fpm-user = www -- with-fpm-group = www


# Cp php. ini-development/opt/soft/php/etc/php. ini
# Vim/opt/soft/apache/conf/httpd. conf
Make sure the following strings exist
LoadModule php5_module modules/libphp5.so
If not, add
Add the following line to AddType application *:
AddType application/x-httpd-php. php. phtml
AddType application/x-httpd-php-source. phps

Add index. php to DirectoryIndex index.html
DirectoryIndex index. php index.html
# Service httpd restart


/Opt/softl/apache/bin/apachectl restart






Centos 1, 6.4
When installing apache and php, the following error occurs:
Libtool: link: cannot find the library '/usr/lib/libexpat. la' or unhandled argument'/usr/lib/libexpat. la'
These two files are not taken to the specified location. You can copy them by yourself.
Cp/opt/sourcecode/httpd-2.4.7/srclib/apr-util/xml/expat/libexpat. la/usr/lib64/libexpat. la
Cp/opt/sourcecode/httpd-2.4.7/srclib/apr-util/xml/expat/. libs/libexpat. so/usr/lib64/libexpat. so

Solve the/usr/bin/ld: cannot find-luuid error in the compiled code.
Ln-s/lib64/libuuid. so.1/usr/lib/libuuid. so
Or
Yum install uuid-devel
Yum install libuuid-devel

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.