Centos 6.5x64 compile and install apache2.4.9.

Source: Internet
Author: User

Package to be downloaded

Apr-1.5.0.tar.gz

Apr-util-1.5.3.tar.gz

Pcre-8.33.tar.gz

Httpd-2.4.9.tar.gz

I put it in/usr/and decompress it.

Install apr-1.5.0

./Configure -- Prefix =/usr/local/aprmake Make install

Install apr-util-1.5.3
./Configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/apr/bin/apr-1-config Make Make install

Note that. /configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/apr/bin/apr-1-config appears cannot install 'libaprutil-1. la 'to a directory not ending in/usr/local/apr/lib
Execute make clean

Install pcre-8.33./configure -- prefix =/usr/local/pcre make Make install

Note that when You run./configure -- prefix =/usr/local/pcre, You need a C ++ compiler for C ++ support appears.

Execute yum install-y gcc-c ++

Install httpd-2.4.9

. /Configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite -- enable-mods-shared = most -- with-apr =/usr/local/apr -- -apr-util =/usr/local/apr-util -- with-pcre =/usr/local/pcre

Make

Make install


Modify:/usr/local/apache2/conf

Open httpd. conf in Notepad

Remove the # ServerName www. example. comt: 80 comment and change www.example.com to localhost.

Then run service httpd start.

Then you can access http: // localhost: 80 through a browser. If the page displays "Itworks !", This indicates that apache has been installed and started successfully.

Add to startup Item

Solve httpd: unrecognized service

Cp/usr/local/apache/bin/apachectl/etc/rc. d/init. d/httpd

Vi/etc/rc. d/init. d/httpd

Starting #! Add
# Chkconfig: 2345 85 15

Chkconfig -- add httpd service

Yum install lynx-y
Service httpd status execution
Service httpd status
Not Found

The requested URL/server-status was not found on this server.
Unsolved

Restart Apache

Servicehttpdrestart

So far, the apache server software has been installed.

========================================= ======

Go to the/usr/local/apache2/conf directory and run the following command to modify the configuration file:

Vim httpd. conf
A) 1 remove the following statement #
LoadModulephp5_module modules/libphp5.so
If there are no words, you can add them to an existing LoadModule statement.
B) modify the email address
Change to your mailbox ServerAdmin xxx@gmail.com
Modify the server name as follows: ServerName192.168.1.191: 80
C) modify the homepage Index
Modify the index file on the first page (index.phpor index.html on the first page ):
DirectoryIndexindex. php index.html
D) Modify AddType
Add the following AddType to the existing AddType (php text cannot be parsed without the following statement)
AddTypeapplication/x-httpd-php. php. phtml. php3. inc

Error403Accessforbidden!
Run commands
vi/usr/local/apache/conf/extra/httpd-info.conf
Set
<Location/server-status>SetHandlerserver-statusOrderdeny,allowDenyfromallAllowfrom.example.com</Location>

Change

<Location/server-status>SetHandlerserver-statusOrderdeny,allowDenyfromallAllowfrom127.0.0.1</Location>


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.