CentOS 6 Installation, configuration httpd-2.4 detailed

Source: Internet
Author: User

Experiment host IP 172.18.254.37, at which point the HTTPD program version is 2.2.15,apr,apr-util version 1.3.9.


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/80/6D/wKiom1dBM-zREY7cAAA4QCWB5Ro099.jpg "title=" Pre-installation program version. jpg "alt=" wkiom1dbm-zrey7caaa4qcwb5ro099.jpg "/>


main train of thought: to want this host to apply httpd-2.4, to compile installs httpd-2.4, upgrade Apr,apr-util version is 1.4+



Installation Detailed:

1. Install the development Environment Package Group and the development package

# Yum Groupinstall "Development Tools" "Server Platform Development"-Y//Development Environment Pack Group

# Yum Install pcre-devel-y//Developer Package


# Service HTTPD stop//stop httpd services to ensure that the installation httpd-2.4 will not overwrite the original installation configuration

# chkconfig httpd off//Turn off auto start

2, download the source package (here to download the local FTP server)

# lftp 172.16.0.1/pub

> CD SOURCES/SOURCES/HTTPD

> ls


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/80/6B/wKioL1dBNUSiqPhWAADVcm2nj3A344.jpg "title=" SOURCE package. jpg "alt=" wkiol1dbnusiqphwaadvcm2nj3a344.jpg "/>


> Mget apr-1.5.0.tar.bz2 apr-util-1.5.3.tar.bz2 httpd-2.4.10.tar.bz2


3. Compile and install (Apr-util depends on Apr, so install Apr first)

A) Compile and install Apr

# tar XF apr-1.5.0.tar.bz2

# CD apr-1.5.0

#./configure--prefix=/usr/local/apr //rpm Install Apr default path under/usr, to differentiate here under/usr/local

# Make && make install

# LS/USR/LOCAL/APR//See if the installation files are generated

Bin Build-1 include Lib

b) Compile and install Apr-util

# CD

# Tar XF apr-util-1.5.3.tar.bz2

# CD apr-util-1.5.3

#./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR

# make-j 3 && make install

# ls/usr/local/apr-util/

Bin include Lib

c) Compile and install httpd-2.4

# CD

# Tar XF httpd-2.4.10.tar.bz2

# CD httpd-2.4.10

#./configure--prefix=/usr/local/apache24--sysconfdir=/etc/httpd24--enable-so--enable-ssl--enable-cgi-- Enable-rewrite--enable-modules=most--enable-mpms-shared=all--with-mpm=prefork--with-zlib--with-pcre--with-apr= /USR/LOCAL/APR--with-apr-util=/usr/local/apr-util



 // sysconfdir=/etc/httpd24 specifying the configuration file installation location

enable-so Support Dynamic shared Module (DOS), if not this module PHP will not work with Apache combined

ENABLE-SSL supports SSL features

ENABLE-CGI support CGI

Enable-rewrite Support for URL rewriting

Enable-modules=most which modules are enabled

Enable-mpms-shared=all supports multi-channel processing modules

With-mpm=prefork Setting the default module to Prefork module

        // With-zlib supports compression library, easy to send and receive after page compression, bandwidth saving when Internet is transmitted

With-pcre supports CRE extended regular expressions to support more powerful regular expression parsing capabilities


# Make && make install

# MAKE-J 4 && make install


4, verify the httpd-2.4 service

# Apachectl

# hash


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/80/6B/wKioL1dBNfqR_E3qAAAZR-gO0B4282.png "title=" Hash.png "alt=" Wkiol1dbnfqr_e3qaaazr-go0b4282.png "/>



# Ls/usr/local/apache24/bin


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/80/6D/wKiom1dBNVeDlYi_AABDTTcJ3S8743.png "title=" The actual installation apachectl path. png "alt=" Wkiom1dbnvedlyi_aabdttcj3s8743.png "/>


#/usr/local/apache24/bin/apachectl Start

# SS-TNL


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/80/6B/wKioL1dBNn-wCJD1AAAqp720CMI931.png "title=" Boot port. png "alt=" Wkiol1dbnn-wcjd1aaaqp720cmi931.png "/>


Detailed configuration:

How to use Apachectl directly instead of using full path for httpd2.4 server control??????


1. can be set by changing the PATH environment variable (only valid for current shell and child shell, invalid after restarting Shell)


# Export Path=/usr/local/apache24/bin: $PATH

# echo $PATH

/usr/local/apache24/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/ Usr/bin:/root/bin


2. Edit the configuration file (still valid after the Shell is restarted)

# vim/etc/profile.d/httpd24.sh

Export Path=/usr/local/apache24/bin: $PATH//Add content


Changes to the configuration file only, the environment variable does not take effect immediately, but is valid for the newly logged-on user, and then the new user logs on for verification

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/80/6D/wKiom1dBNgGxof_mAABbidXdiDU041.png "title=" echo$ Path.png "alt=" Wkiom1dbnggxof_maabbidxdidu041.png "/>


Re-authenticate with the original host:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/80/6B/wKioL1dBNyqwd5VPAAA1sz9mSUc119.png "title=" Boot port -2.png "alt=" Wkiol1dbnyqwd5vpaaa1sz9msuc119.png "/>


  

Login Browser, enter http://172.18.254.37


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/80/6D/wKiom1dBNmzQ9wOkAAAl0mvt4Mc669.jpg "title=" Default access page. jpg "alt=" wkiom1dbnmzq9wokaaal0mvt4mc669.jpg "/> // Install default access page for compilation here




1, compile and install the page of the page detailed:

[email protected] httpd-2.4.10]# cd/usr/local/apache24/

[email protected] apache24]# ll

Total 52

Drwxr-xr-x 2 root root 4096 may 18:28 bin//program path

Drwxr-xr-x 2 root root 4096 may 18:28 build//compile installation related files

Drwxr-xr-x 2 root root 4096 18:28 cgi-bin//cgi Format page Program store location

Drwxr-xr-x 3 root root 4096 may 18:28 error page (can customize error content, not access error)

Drwxr-xr-x 2 root root 4096 may 18:04 htdocs//web file storage location

Drwxr-xr-x 3 root root 4096 18:28 icons//various icons

Drwxr-xr-x 2 root root 4096 may 18:28 include//header file

Drwxr-xr-x 2 root root 4096 may 18:30 logs//log

Drwxr-xr-x 4 root root 4096 18:28 man//man manual

Drwxr-xr-x root root 12288 Jul Manual//official documents

Drwxr-xr-x 2 root root 4096 may 18:28 modules//module


2, the compiled configure command content under the/build/config.nice

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/80/6B/wKioL1dBN--hVDnTAABqRGkWTYQ996.jpg "title=" Compile content display. jpg "alt=" wkiol1dbn--hvdntaabqrgkwtyq996.jpg "/>




CentOS 6 Configuration httpd-2.4, starting with server scripting


# cd/etc/rc.d/init.d/

# CP httpd HTTPD24

# vim Httpd24

#if [-f/etc/sysconfig/httpd]; Then

#. /etc/sysconfig/httpd

#fi// Comment or delete the above file load


apachectl=/usr/local/apache24/bin/apachectl

httpd=${HTTPD-/USR/LOCAL/APACHE24/BIN/HTTPD}

Prog=httpd

pidfile=${pidfile-/usr/local/apache24/logs/httpd.pid}

lockfile=${lockfile-/var/lock/subsys/httpd24}


# chkconfig--add httpd24//Must be added after modification

# chkconfig--list httpd24


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/80/6B/wKioL1dBOQSR6MCKAACNJadqeBs439.jpg "title=" Service validation. jpg "alt=" wkiol1dboqsr6mckaacnjadqebs439.jpg "/>







CentOS 6 Installation, configuration httpd-2.4 detailed

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.