Apache Application and Optimization chapter (i): Compile and install the latest Apache

Source: Internet
Author: User
Tags apache download fully qualified domain name

1. Download apache2.4 package, unzip the website

2. Since 2.4 requires an additional APR, it is necessary to compile and install Apr

Otherwise you will get an error checking for APR ... no

Configure:error:APR not found. Please read the documentation

3. Download the required packages:

    1. wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
    2. wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
    3. wget Http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

4. Compile and install:

    1. Yum Remove apr-util-devel Apr apr-util-mysql apr-docs apr-devel apr-util Apr-util-docs

The steps are as follows:

A: Solve Apr not found problem >>>>>>

    1. [Email protected] test]# TAR-ZXF apr-1.4.5.tar.gz
    2. [Email protected] test]# CD apr-1.4.5
    3. [Email protected] apr-1.4.5]#/configure --prefix=/usr/local/apr
    4. [[email protected] apr-1.4.5]# sudo make && sudo make install

B: Solve apr-util not found problem >>>>

    1. [Email protected] test]# TAR-ZXF apr-util-1.3.12.tar.gz
    2. [Email protected] test]# CD apr-util-1.3.12
    3. [Email protected] apr-util-1.3.12]#/configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin /apr-1-config
    4. [[email protected] apr-util-1.3.12]# sudo make && sudo make install


C: Solve pcre problem >>>>>>>>>

    1. [Email protected] test]# Unzip-o pcre-8.10.zip
    2. [Email protected] test]# CD pcre-8.10
    3. [Email protected] pcre-8.10]#/configure --prefix=/usr/local/pcre
    4. [[email protected] pcre-8.10]# sudo make && sudo make install

4. When you finally compile Apache, add:

Go to Apache download directory

./configure--prefix=/usr/local/myapache--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--with-pcre =/usr/local/pcre

Successful compilation completed ~

5. Launch Apache

Sudo/usr/local/myapache/bin/apachectl-f/usr/local/myapache/conf/httpd.conf

Successful prompt httpd (PID 21768) already running

Stop Apache

Sudo/usr/local/myapache/bin/apachectl stop

6. If you start an error

AH00558:httpd:Could not reliably determine the server ' s fully qualified domain name, using 127.0.1.1. Set the ' ServerName ' directive globally to suppress this message
(13) Permission denied:AH00072:make_sock:could not bind to address [::]:80
(13) Permission denied:AH00072:make_sock:could not bind to address 0.0.0.0:80
No listening sockets available, shutting down
Ah00015:unable to open logs

You need to modify httpd.conf in Apache to conf directory to join ServerName localhost:80

Apache Application and Optimization chapter (i): Compile and install the latest Apache

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.