Compiling and installing HTTPD 2.4

Source: Internet
Author: User

CentOS 6.9

(1) Turn off SELinux

Note: If you do not turn off SELinux, there may be unpredictable problems such as forbidden when setting documentroot.

#sed  -i ‘s/^SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config`

(2) Turn off iptables and add system users

You can also open port 80, which is directly closed for testing convenience

# /etc/init.d/iptables stop# groupadd -r apache# useradd -r -g apache apache

(3) Required dependency packages

# yum -y groupinstall "Development tools" "Server Platform Development"# yum -y install pcre-devel# yum -y install expat-devel

(4) Download the installation package

wget https://mirrors.aliyun.com/apache/httpd/httpd-2.4.29.tar.gz https://mirrors.aliyun.com/apache/apr/apr-1.6.3.tar.gz https://mirrors.aliyun.com/apache/apr/apr-util-1.6.1.tar.gz

(5) Install Apr

# tar xf apr-1.6.3.tar.gz# apr-1.6.3# ./configure --prefix=/usr/local/apr# make && make install

(6) Installation Apr-util

# tar xf apr-util-1.6.1.tar.gz # cd apr-util-1.6.1# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/# make && make install

(7) Installation httpd

# tar xf httpd-2.4.29.tar.gz # cd httpd-2.4.29# ./configure --prefix=/usr/local/apache --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-mem=event --libdir=/usr/lib64

(8) Adding environment variables

# echo "PATH=/usr/local/apache/bin/apachectl:$PATH" > /etc/profile.d/httpd.sh

(9) Start the HTTP service

# apachectl -k start

(10) Viewing the listening port

ss -tnl

Compiling and installing HTTPD 2.4

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.