CENTOS7 Apache 2.4.18 Compilation installation

Source: Internet
Author: User
Tags install openssl fully qualified domain name

Installation Environment: CentOS Linux release 7.0.1406 (Core)

0x01

Download Apache HTTP latest version to official website Http://httpd.apache.org/download.cgi#apache24

Tar zxf httpd-2.4.18.tar.gz

[Email protected] httpd-2.4.18]# Rpm-qa | grep Apr See if Apr/apr-util is installed on the current host, this library provides cross-platform support for Apache

[email protected] httpd-2.4.18]# yum install Apr apr-util Both packages are available in disc mirroring, configuration and Yum source

Apr location information installed with Yum

[Email protected] httpd-2.4.18]# RPM-QL Apr
/usr/lib64/libapr-1.so.0
/usr/lib64/libapr-1.so.0.4.8
/usr/share/doc/apr-1.4.8
/usr/share/doc/apr-1.4.8/changes
/usr/share/doc/apr-1.4.8/license
/usr/share/doc/apr-1.4.8/notice
[Email protected] httpd-2.4.18]# RPM-QL apr-util
/usr/lib64/apr-util-1
/usr/lib64/libaprutil-1.so.0
/usr/lib64/libaprutil-1.so.0.5.2
/usr/share/doc/apr-util-1.5.2
/usr/share/doc/apr-util-1.5.2/changes
/usr/share/doc/apr-util-1.5.2/license
/usr/share/doc/apr-util-1.5.2/notice

0x02 Apache Compilation options

--prefix=/usr/local/apache
--sysconfdir=/etc/httpd
--with-apr=/usr/local/apr
--with-apr-util=/usr/local/apr-util

--enable-so             //open so module, The so module is used to provide DSO support, providing dynamic sharing module with PHP collaboration
--enable-ssl            //HTTPS using
--enable-cgi &nbs P          //use
--enable-rewrite    //support URL rewriting for non-threaded MPM
--enable-zlib          //general compression mechanism
--with-pcre            
--enable-module=most   
--enable-mpms-shared=most        //which MPM is enabled (Prefork,worker , event), a different way to compile PHP (using the –ENABLE-MAINTAINER-ZTS option at compile time) when using worker or event
--WITH-MPM=MPM          //specifying the default MPM

--enable-deflate//transmission compression mechanism, saving bandwidth
--enable-cgid//with MPM using thread work (worker/event)

More options can be found through the./configure--help

Official compilation options Document Http://httpd.apache.org/docs/current/programs/configure.html

0X03 Installation

[Email protected] httpd-2.4.18]#/configure--prefix=/usr/local/apache2--sysconfdir=/etc/httpd--enable-so-- Enable-ssl--enable-cgi--enable-rewrite--enable-zlib--enable-module=most--enable-mpms-shared=most--with-mpm= Event

Compile with the above compile options, compile the time to find an error, the use of Yum installed Apr is not enough? or because of the version of the problem caused. The Apr-config file is actually described here, but the APR rpm package is not included, so you should install the Apr-devel RPM package. Here with the source installation solution

Checking for APR ... configure:error:the--with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.

1, to the official website download Apr and apr-util source installation.

[Email protected] httpd-2.4.18]# tar zxf/mymnt/mnt/apr-1.5.2.tar.gz-c/usr/local/src/
[Email protected] httpd-2.4.18]# tar zxf/mymnt/mnt/apr-util-1.5.4.tar.gz-c/usr/local/src/

[Email protected] apr-1.5.2]#/configure--PREFIX=/USR/LOCAL/APR
[Email protected] apr-util-1.5.4]#/configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr

[Email protected] httpd-2.4.18]#/configure--prefix=/usr/local/apache2--sysconfdir=/etc/httpd--enable-so-- Enable-ssl--enable-cgi--enable-rewrite--enable-zlib--enable-module=most--enable-mpms-shared=most--with-mpm= Event--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util

2, installed after the APR also need to install PCRE, intends to download the website, very concise page, but the download page can not open. Found in the Yum source

Configure:error:pcre-config for Libpcre not found. PCRE is required and available from http://pcre.org/

[email protected] httpd-2.4.18]# Yum install Pcre-devel

3, continue to execute checking whether to enable Mod_ssl ... Configure:error:mod_ssl has been requested but can is built due to Prere Quisite failures, this is because the lack of OpenSSL

[email protected] httpd-2.4.18]# Yum install Openssl-devel

4. the last error that appears is Configure:error:MPM most does not the support dynamic loading.

Literally, you can change the--enbale-mpm-shared to all at this point.

Make && make install

How 0x04 starts

Did not make any settings when trying to start [[email protected] apache2]# bin/apachectl start

AH00558:httpd:Could not reliably determine the server ' s fully qualified domain name, using Localhost.localdomain. Set the ' ServerName ' directive globally to suppress this message

Change the host name or ignore it directly

Apache does not have a service script, so you need to write one yourself to implement the boot. Of course, the temporary use of this is skipped.

CENTOS7 Apache 2.4.18 Compilation installation

Related Article

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.