Apache (httpd) source package Installation

Source: Internet
Author: User

Apache Installation

Apache is a foundation name, HTTPD is the package we need to install, httpd early name is Apache;
Apache official website www.apache.org


2.2 Source Bundle: http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz
2.4 Source Bundle: http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz
Apr:http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
Apr-util:https://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz

Apr and Apr-util are a common library of functions that allow httpd to be portable (Linux ported to Windows) without caring for the underlying operating system platform

Download and Unpack Packages
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gzwget http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gzwget https://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gztar zxvf apr-util-1.6.1.tar.gztar zxvf apr-1.6.3.tar.gztar zxvf httpd-2.4.29.tar.gz
Installing apr-1.63
cd apr-1.6.3/./configure --prefix=/usr/local/apr//检查下命令是否正常运行echo $?make && make install
Installing Apr-util
cd /usr/local/src/apr-util-1.6.1/./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/aprmake && make install
Error exclusions

Error:

xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录

Then search for hints expat
Yum List |grep-i Expat

[[email protected] apr-util-1.6.1]# yum list |grep -i expatexpat.x86_64                                2.1.0-10.el7_3             @anacondaexpat-devel.x86_64                          2.1.0-10.el7_3             @base    expat.i686                                  2.1.0-10.el7_3             base     expat-devel.i686                            2.1.0-10.el7_3             base     expat-static.i686                           2.1.0-10.el7_3             base     expat-static.x86_64                         2.1.0-10.el7_3             base     [[email protected] apr-util-1.6.1]#

Installing the Expat-devel Package

yum install -y expat-devel
Installing httpd
cd /usr/local/src/httpd-2.4.29/./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=mostmake && make install
Error exclusion 1:
checking for pcre-config... falseconfigure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/提示:缺少PCRE;

Workaround: Query and install Pcre

yum list |grep -i pcreyum install -y pcre-devel
Error 2:
collect2: error: ld returned 1 exit statusmake[2]: *** [htpasswd] 错误 1make[2]: 离开目录“/usr/local/src/httpd-2.4.29/support”make[1]: *** [all-recursive] 错误 1make[1]: 离开目录“/usr/local/src/httpd-2.4.29/support”make: *** [all-recursive] 错误 1

Solution:
Delete the files, re-unzip the source package installation, first copy the document, after configure Add "--WITH-INCLUDED-APR". re-compile;

cd /usr/local/src/cp -r apr-1.6.3 /usr/local/src/httpd-2.4.29/srclib/aprcp -r apr-util-1.6.1 /usr/local/src/httpd-2.4.29/srclib/apr-utilcd /usr/local/src/httpd-2.4.29/./configure --prefix=/usr/local/apache2.4 --with-included-apr --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=mostmake && make install
Start httpd
/usr/local/apache2.4/bin/apachectl start

Query whether HTTPD is started

ps aux |grep httpdnetstat -lntp
httpd Table of Contents detailed

Under the apache2.4 folder
Conf folder: Configuration file
Htdocs: Home File
Logs folder: Log file
Modules: module Storage

View the modules called by Apache

/usr/local/apache2.4/bin/httpd -M/usr/local/apache2.4/bin/apachectl -M

Apache (httpd) source package installation

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.