Compile and install Apache + PHP in CentOS5

Source: Internet
Author: User
Some time ago I studied how to compile and install Apache and PHP in CentOS. Here is my compilation process, provided that MySQL has been installed. download the installation package with wget: apache: http: www.apache.orgdisthttpdhttpd-2.2.14.tar.bz2 php: http: cn2.php.netgetphp-5.3.0.tar.bz2 fromus. php. ne

Some time ago I studied Apache andPHPIs my compilation process, provided that MySQL has been installed.

1. Download the installation package

Use wget:

Apache: http://www.apache.org/dist/HttpdHttpd-2.2.14.tar.bz2

Php: Http://cn2.php.net/get/php-5.3.0.tar.bz2/from/us.php.net/mirror

2.ExtractTo/usr/local/src, compile apache first and compile php

Apache compilation parameters:

Apache:/configure -- prefix =/usr/local/apache2 -- with-mpm = worker --Enable-So -- enable-reWrite-- Enable-cache

-- Enable-File-Cache -- enable-disk-cache -- enable-mem-cache -- enable-deflate -- enable-cache-ExPires -- enable-headers

-- Disable-actions -- disable-cgId-- Disable-cgi -- disable-autoindex -- disable-userdir -- disable-Alias-- Disable-INcLude

-- Enable-proxy-ajp -- enable-proxy-balancer

Make

Make install

During apache compilation and installation, half of them will report that the mysqlclient package is not installed. In centos, use yum install mysql-devel. Other packages can be installed similarly.

 

Php compilation parameters:

./Configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-libxml-dir -- with-zlib

-- With-bz2 -- enable-calendar -- enable-Ftp-- With-gd -- with-jpeg-dir -- with-png-dir -- with-zlib-dir ---FreeType-dir

-- Enable-gd-native-ttf -- enable-mbsTrIng -- with-mysql -- with-mysqli =/usr/bin/mysql_config

-- With-mysql-sock =/var/lib/mysql. sock -- enable-sockets -- with-xsl -- enable-Zip

-- Enable-zend-multibyte -- with-curl =/usr -- with-openssl

Make

Make install

At this point, the compilation and installation of apache and php are basically over. Below are some configuration problems !!

 

The following is a description of the apache compilation parameters I have found online:

/Configure // configure the source code tree -- prefix =/usr/local/apache2 // the PREFIX of the top-level installation directory of the system-independent file, which is also the Apache installation directory.

-- Enable-moDuLe = so // open the so module. The so module is the apache core module supported by DSO.

-- Enable-deflate = sharEd// Supports webpageCompression

-- Enable-expires = shared // supports HTTP Control

-- Enable-rewrite = shared // supports URL rewriting

-- Enable-cache // supports caching

-- Enable-file-cache // supports file caching.

-- Enable-mem-cache // supports memory cache.

-- Enable-disk-cache // supports disk caching.

-- Enable-StatIc-SuPport // supports static connections (Dynamic connections by default)

-- Enable-static-htPasswd// Use static connections to compile htpasswd-manage user files for Basic Authentication

-- Enable-static-htdigest // use a static connection to compile htdigest-manage the user files used for digest Authentication

-- Enable-static-rotatelogs // use a static connection to compile the rotatelogs-pipeline log program for Rolling Apache logs

-- Enable-static-logresolve // use a static connection to compile logresolve-resolve the IP address in the Apache log as the host name

-- Enable-static-htdbm // use a static connection to compile htdbm-operate the DBM Password Database

-- Enable-static-AB // use a static connection to compile the AB-Apache HTTP Server Performance Testing Tool

-- Enable-static-checkgid // use a static connection to compile checkgid

-- Disable-cgid // disable the use of an external CGI daemon to execute the CGI script

-- Disable-cgi // disable compilation of cgi php -- disable-userdir // disable users from providing pages in their home directories

-- With-mpm = worker // run apache in worker Mode

-- Enable-authn-dbm = shared // operate on a dynamic database. Required for Rewrite.

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.