Plugin. configure -- prefixusrlocalapache2 -- enable-so -- enable-threads -- with-mpm
Install Apache2.2.17 with CentOS source code
# Install the required library yum-y install zlib-develCp/Home/root/Httpd-2.2.17.tar.gz/usr/local/srcCd/Usr/local/srctar xzvf httpd-2.2.17.tar.gz./configure -- prefix =/usr/local/apache2 --Enable-So -- enable-threads -- with-mpm = worker -- enable-cache -- enable-reWrite= SharEd-Enable-deflate = shared -- enable-ExPires = sharedmakemake install
# Start apache/usr/local/apache2/bin/ApachectlStart # If notice such as httpd: cocould not reliably dete appearsRmIne the server's fully qualified domain name, using 127.0.0.1 for ServerNamevi/usr/local/apache2/conf/httpd. conf: Modify ServerName: ServerName localhost: 80/usr/local/apache2/bin/apachectl restart
# InstallationPHP
# Install the required Library first
Yum-y install libxml2
Yum-y install libxml2-devel
Yum-y install gd
Yum-y install gd-devel
Yum-y install curl-devel
Yum-y install libjpeg-devel libpng-devel
Yum-y installFreeType freetype-devel
Yum-y install openldap
Yum-y install openldap-devel
cp /home/root/php-5.2.17.tar.gz /usr/local/src
cd /usr/local/src
tar xzvf php-5.2.17.tar.gz
./configure --prefix=/usr/local/php5 \
--with-suns.com/category/mysql" target=_blank>mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-libxml-dir=/usr/local/lib \
--with-gd \
--with-jpeg-dir=/usr/local/jpeg6 \
--with-zlib \
--with-curl \
--with-ldap \
--with-gettext \
--with-iconv \
--enable-mbstring \
--enable-soap \
--with-png-dir=/usr/local/libpng2 \
--with-freetype-dir=/usr/local/freetype \
--with-xmlrpc \
--with-config-file-path=/usr/local/php5/etc
make
make install
cp /usr/local/src/php.ini-dist /usr/local/php5/etc/php.ini
Configuration
Vi/usr/local/apache2/conf/httpd. conf
# Add index. php after DirectoryIndex index.html
DirectoryIndex index.html index. php
#
DuAdd the following to le mime_module>:
A
DdType application/x-httpd-php. php. phtml
AddType application/x-httpd-php-source. phps
/Usr/local/apache2/bin/apachectl restart
# If an error occurs, such as/usr/local/apache2/modules/libphp5.so: cannotRestoreSegment prot after reloc: Permission denied
# Solution:
SetEnforce 0
Chcon-c-v-R-u system_u-r object_r-t textrel_shlib_t/usr/local/apache2/modules/libphp5.so
/Usr/local/apache2/bin/apachectl restart
Setenforce 1
/Usr/local/apache2/bin/apachectl restart