httpd2.4 compiling the installation on CentOS 6

Source: Internet
Author: User

httpd-2.4 new Features:

1, MPM support operation for the DSO mechanism, in the form of modules on-demand loading

2. The Event MPM production environment is available

3. Support asynchronous read-write mechanism

4, support the log level definition per module per directory

5, each request related to the special configuration

6. Enhanced Version Expression Analyzer

7, millisecond connection length

8, FQDN-based virtual machine does not need namevirtualhost instructions

9. New instruction, Allowoverridelist

10, support user-defined variable use

11. Lower memory consumption

httpd-2.4 New module:

1, mod_proxy_fcgi support PHP fastcgi working mode

2, mod_proxy_scgi Agent support different protocol functions, such as Python

3. Mod_remoteip is changed based on IP access control mechanism (allow from, deny from IS discarded)

CentOS 6 Installation httpd-2.4 instructions:

httpd-2.4 relies on newer versions of apr-1.4 and above (Apache Portable Runtime) and apr-util-1.4 versions above. CentOS 6 only offers apr-1.3, apr-util-1.3 versions. So CentOS 6 needs to compile and install the httpd-2.4 and its dependent apr-1.4 and apr-util-1.4.

httpd-2.4 Compile the installation steps:

1, first to ensure that the machine has installed httpd-2.2 service stopped, if not installed it is better.

~] #service httpd stop~] #chkconfif httpd off

2, build the compilation installation environment: must install development tools,server Platform Development, development package Pcre-devel

~] #yum Groupinstall "Development Tools" "Server Platform Development" ~] #yum-y install pcre-devel Description: The configuration of the Yum source is not introduced here, the reader can Install according to your own situation.

3, the compilation installs apr-1.4 above (I use the par-1.5 version to do the test), obtains to apr-1.4 above package. After decompression into the apr-1.5 directory, to compile and install:

~]# CD ~/apr-1.5.0~]#./configure--prefix=/usr/local/apr #环境检查--prefidx Specify the path to the compilation installation ~]# make && make Insta ll #编译, after successful copying files to/USR/LOCAL/APR

4. Compile and install apr-util-1.5

~]# CD ~/apr-util-1.5.3#./configure–prefix=/usr/local/apr-util-–with-apr=/usr/local/apr #环境检查--prefidx Specify compilation installation The path--WITH-APR specifies the package that depends on the ~]# made && make install #编译, and the file is copied to/usr/local/apr-util after success

5. Compilation and installation and environment configuration

5.1 Compiling the installation

~] #useradd  -r apache     #创建名为apache的用户, create a user group with the same name by default ~]# cd ~/httpd-2.4.9  ~]# ./configure --prefix=/usr/local/apache24 --sysconf=/etc/httpd24 --enable-so  --enable-ssl > --enable-cgi --enable-rewrite --with-zlib –with-pcre -- with-apr=/usr/local/apr > --with-apr-util=/usr/local/apr-util/ --enable-modules=most– enable-mpms-shared=all > --with-mpm=prefork    --sysconf                    : Create its configuration in/etc/ httpd24    --enable-so     --enable-ssl    -- enable-cgi    --enable-rewrite            &NBSP: Support URL rewrite     --enable-mpms-shared=all    : All three modules are compiled.     --with-mpm                   : Set the default mpm    --with-zlib                 &NBSP: Dependent on zlib  available for compression library     --with-pcre                 &NBSP: Support for extended regular expressions      do not specify (=)   Go to the default location      Note:--with/--without  supports or does not support which dependent packages             --enable/--disable  which features are enabled or disabled  ~]# make  && make install     #编译, copy files to/usr/local/apache24 after success

  compiled and installed to this end, what are the files after installation?

~]# cd /usr/local/apache24~]# ls  bin  build  cgi-bin   Conf  error  htdocs  icons  include  logs  man   manual  modules    bin : apache binary Files executable    INCLUDE&NBSP: Message header   icons: Resource storage location   conf: Profile   build: Files generated during installation      ~]# cat /usr/local/apache24/build/config.nice     compile the ./configure  at the time of installation Commands          "./configure"            "--prefix=/usr/local/apache24"          "--enable-so"            "--enable-ssl"            "--enable-cgi"           "--enable-rewrite"            "--with-zlib"           "--with-pcre"            "--WITH-APR=/USR/LOCAL/APR"           "--with-apr-util=/usr/local/apr-util/"          "--enable-modules= Most "         "--enable-mpms-shared=all "          "--with-mpm=prefork"           "--sysconf=/ Etc/httpd24 "\

At this point the start service must execute the APACHECTL command to the/usr/local/apache24/bin/directory to manage the httpd process. However, if you need httpd to start as normal as other services, you need to configure the following:

5.2 Environment Configuration

Setting Global environment variables

~] #vim/etc/profile.d/httpd.sh echopath=/user/local/apache24/bin: $PATH

Export Header File

~]# ln-sv/usr/local/apache24/include/usr/include/httpd

'/usr/include/httpd/include ', '/usr/local/apache24/include '

Loading library files

~]# ldconfig-v # Reload library file

~]# ldconfig-p # All library file paths loaded

Service Management Settings

~] #cp/etc/rc.d/init.d/httpd/etc/rc.d/init.d/httpd24~] #vim/etc/rc.d/init.d/httpd24 apachectl=/usr/sbin/apachectl HTTPD=${HTTPD-/USR/LOCAL/APACHE24/BIN/HTTPD} This directory needs to be changed PROG=HTTPD pidfile=${pidfile-/usr/local/apache24/logs/ Httpd.pid} lockfile=${lockfile-/var/lock/subsys/httpd24}

Add it to the boot start

~] #chkconfig –addhttpd24 ~] #chkconfig –list httpd24

Start the service, httpd can use the

~]# Service httpd Start














  

httpd2.4 compiling the installation on CentOS 6

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.