Compiling and installing apache+php

Source: Internet
Author: User

1. Unzip Apache

Tar zxvf httpd-2.4.18.tar.gz


Unzip the APR and Apr-util packets into the Srclib directory in Apache.

Tar zxvf apr-1.4.6.tar.gz-c/home/software/httpd-2.4.18/srclib/

Tar zxvf apr-util-1.5.2.tar.gz-c/home/software/httpd-2.4.18/srclib/

cd/home/software/httpd-2.4.18/srclib/


Modify the package name


MV apr-1.4.6 Apr
MV apr-util-1.5.2 Apr-util



Install Apr

CD Apr

./configure--PREFIX=/USR/LOCAL/APR
Make

Make install

Installing Apr-util

CD Apr-util

./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR
Make

Make install


Installing Pere

Tar zxvf pcre-8.38.tar.gz

CD pcre-8.38

./configure

Make

Make install


Installing Apache

cd/home/software/httpd-2.4.18


./configure--prefix=/usr/local/apache--enable-so--enable-proxy--enable-rewrite--with-mpm=worker--with-apr=/usr /LOCAL/APR--with-apr-util=/usr/local/apr-util

Make
Make install

Compile and install the mod_fastcgi module and load the library file in httpd.conf

Tar zxvf mod_fastcgi-2.4.6.tar.gz
CD mod_fastcgi-2.4.6
wget Http://leeon.me/upload/other/byte-compile-against-apache24.diff

PATCH-P1 <byte-compile-against-apache24.diff

apache2.4 Install mod_fastcgi 2.4.6 , need to patch


CP MAKEFILE.AP2 Makefile

Vim Makefile to change the path in Makefile to the installation path of your Apache

Makes && make install//after successful installation, the mod_fastcgi.so is automatically copied to the /usr/local/apache/modules directory



Add in httpd.conf

LoadModule Fastcgi_module modules/mod_fastcgi.so

Add the following line to the last side of the httpd.conf:

<filesmatch \.php$>

SetHandler "proxy:fcgi://127.0.0.1:9000"

</FilesMatch>



Add Apache User, modify User and the Group are:

User Apache

Group Apache

ServerName localhost:80


Installing FreeType

wget http://nchc.dl.sourceforge.net/project/freetype/freetype2/2.4.7/freetype-2.4.7.tar.gz
Tar zxvf freetype-2.4.7.tar.gz
CD freetype-2.4.7
./configure--prefix=/usr/local/freetype
Make
Make install


Install JPEG

Tar zxvf jpegsrc.v8c.tar.gz
CD jpeg-8c/
./configure--prefix=/usr/local/jpeg
Make
Make install


Installing libpng

Tar jxvf libpng-1.2.10.tar.bz2
CD libpng-1.2.10
./configure--prefix=/usr/local/libpng

Make

Make install


Installing GD

Tar zxvf gd-2.1.0-preview.tar.gz

CD gd-2.1.0
./configure--PREFIX=/USR/LOCAL/GD
Make
Make install

Installing PHP5.6

Tar zxvf php-5.6.20.tar.gz

CD php-5.6.20

./configure--prefix=/usr/local/php5--enable-fpm--with-mcrypt--enable-mbstring--with-curl--enable-pdo-- Disable-debug--enable-inline-optimization--with-bz2--with-zlib--enable-sockets--enable-sysvsem--ENABLE-SYSVSHM --enable-pcntl--enable-mbregex--with-mhash--enable-zip--with-pcre-regex--with-mysql--with-mysqli--WITH-GD-- With-jpeg-dir=/usr/local/jpeg--with-freetype-dir=/usr/local/freetype


Make
Make install

cd/usr/local/php5/etc/

CP Php-fpm.conf.default php-fpm.conf



Modify PHP Port

VI etc/php-fpm.conf



[Global]



[WWW]


user = Nobody
Group = Nobody

Listen = 127.0.0.1:9009


PM = dynamic

Pm.max_children = 5

Pm.start_servers = 2

Pm.min_spare_servers = 1

Pm.max_spare_servers = 3


Copy php.ini file
Cp-a/home/software/php-5.6.20/php.ini-production Etc/php.ini


VI php.ini

#在930行上下, modify the time zone to Shanghai

Date.timezone =asia/shanghai



Save startup PHP

/usr/local/php5/sbin/php-fpm-c/usr/local/php5/etc/php.ini


Start httpd

/usr/local/apache/bin/httpd-k start









This article is from the "jiazheming" blog, make sure to keep this source http://8888866666.blog.51cto.com/6988153/1769683

Compiling and installing apache+php

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.