Two ways to compile and install httpd2.4 Centos 6

Source: Internet
Author: User

First method one, download unzip
wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.29.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
tar -vxf httpd-2.4. . tar. gz
TAR-VXF apr-1.6.3.tar.gz
TAR-VXF apr-util-1.6.1.tar.gz
Second, install the development package group and related dependent packages
Yum " Development Tools " Yum Install openssl-devel pcre-devel expat-devel
Third, compile Apr and Apr-util

HTTPD is dependent on APR, so first compile Apr and Apr-util

1. Compiling Apr
CD apr-1.6. 3 . /configure--PREFIX=/APP/APR
Make && make install
2. Compiling apr-util
CD apr-util-1.6. 1
./configure--prefix=/app/apr-util--WITH-APR=/APP/APR
Make && make install
Iv. compiling httpd
CD httpd-2.4.  in . /configure--prefix=/app/--enable---enable---enable---enable--- with---with---with-apr=/app/apr/--with-apr-util=/app/apr-util/-- enable-modules=--enable-mpms-shared=--with-mpm=prefork

Make && make install
V. Environment variables
Echo ' path=/app/httpd24/bin/: $PATH ' >/etc/profile.d/httpd24. SH  /etc/profile.d/httpd24. SH
Vi. Creating users and Groups
Useradd-r-s/sbin/nologin Apache
Vii. Modifying configuration files
vim/app/httpd24/conf/httpd.conf Modify user Apachegroup Apache
Viii. Startup scripts
vim/etc/init.d/httpd24apachectl=/app/httpd24/bin/apachectlhttpd=${httpd-/app/httpd24/bin/ httpd}pidfile=${pidfile-/app/httpd24/logs/httpd.pid}lockfile=${lockfile-/var/lock/ SUBSYS/HTTPD24}

Chkconfig--add httpd24
Chkconfig httpd24 on
Service HTTPD24 Start

The second method of one, download decompression
wgethttp//Mirrors.hust.edu.cn/apache//httpd/httpd-2.4.29.tar.gzwgetHttps//Mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gzwgetHttps//Mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gzTar-VXF httpd-2.4. in.Tar. GZTar-VXF apr-1.6.3.Tar. GZTar-VXF apr-util-1.6.1.Tar. gz
Second, install the development package group and related dependent packages
Yum " Development Tools " Yum Install openssl-devel pcre-devel expat-devel
Third, copy Apr and Apr-util source Package
CP -R apr-1.6. 3 httpd-2.4. /srclib/AprCP -R apr-util-1.6. 1 httpd-2.4. /srclib/apr-util
Third, compile
CD httpd-2.4.  in . /--prefix=/app/--enable---enable---enable---enable--- with---with---with-included---enable-modules=--enable-mpms-shared=  --with-mpm=prefork

Make && make install

The following steps are the same as the first method

Two ways to compile and install httpd2.4 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.