In the CENTOS6 compilation installation httpd-2.4 method one

Source: Internet
Author: User
Tags install openssl

Installing httpd-2.4
dependent on apr-1.4+, apr-util-1.4+, [Apr-iconv]
Apr:apache portable runtime to solve cross-platform implementations
CentOS 6: Default: apr-1.3.9, apr-util-1.3.9
To prepare the development package before installation:
Development Environment Package Group:
Development Tools,server
Related package: Pcre-devel,openssl-devel expat-devel
Download the source code and unzip it:
httpd-2.4.27.tar.bz2
apr-1.6.2.tar.bz2
apr-util-1.6.0.tar.bz2
The first step: Install the required packages first. (Do not pack the group at work, pick some to install)
Yum Groupinstall "Development tools"
Yum Install Openssl-devel pcre-devel expat-devel
[email protected] apr-1.6.3]# Yum install Libtool
[Email protected] ~]# mkdir httpd2.4
[Email protected] ~]# CD httpd2.4/
Upload the source code to the inside;
[[email protected] httpd2.4] #rz
Then unzip.
Tar xvf apr-1.6.3.tar.bz2
Tar xvf apr-util-1.6.1.tar.bz2
Tar xvf httpd-2.4.29.tar.bz2
Compile Apr before compiling httpd
Step two: Now we're going to compile Apr (apr-1.6.3)
[Email protected] httpd2.4]# CD apr-1.6.3
[[email protected] apr-1.6.3]# ls
Apr-config.in buildconf DSO libapr.rc NOTICE support
APR.DEP build.conf emacs-mode LICENSE nwgnumakefile tables
APR.DSP build-outputs.mk encoding Locks passwd Test
APR.DSW changes File_io makefile.in poll ThreadProc
Apr.mak CMakeLists.txt Helpers Makefile.win random time
Apr.pc.in config.layout include memory README tools
Apr.spec Configure LIBAPR.DEP Misc Readme.cmake User
Atomic configure.in LIBAPR.DSP mmap Shmem
Build Docs Libapr.mak Network_io Strings
[[email protected] apr-1.6.3]#./configure--prefix=/app/apr (Start compiling)
[[email protected] apr-1.6.3] #make-j 4 && make install
[Email protected] apr-1.6.3]# Ls/app
Apr
[Email protected] apr-1.6.3]# CD.
[[email protected] httpd2.4]# ls
apr-1.6.3 apr-util-1.6.1 httpd-2.4.29
APR-1.6.3.TAR.BZ2 apr-util-1.6.1.tar.bz2 httpd-2.4.29.tar.bz2
[Email protected] httpd2.4]# CD apr-util-1.6.1
[[email protected] apr-util-1.6.1]# ls
APRUTIL.DEP build.conf Docs LICENSE Redis
APRUTIL.DSP BUILD-OUTPUTS.MK encoding makefile.in renames_pending
APRUTIL.DSW changes export_vars.sh.in Makefile.win strmatch
Aprutil.mak CMakeLists.txt Hooks memcache Test
Apr-util.pc.in config.layout include misc URI
Apr-util.spec Configure LDAP NOTICE xlate
Apu-config.in configure.in LIBAPRUTIL.DEP nwgnumakefile xml
Buckets Crypto LIBAPRUTIL.DSP README
Build DBD Libaprutil.mak Readme.cmake
buildconf dbm libaprutil.rc README. FreeTDS
[Email protected] apr-util-1.6.1]#/configure--prefix=/app/apr-util--with-apr=/app/apr
[[email protected] apr-1.6.3] #make-j 4 && make install

Part III: Compiling and installing httpd2.4
[Email protected] apr-util-1.6.1]# CD.
[Email protected] httpd2.4]# CD httpd-2.4.29
[Email protected] httpd2.4]#./configure--prefix=/app/httpd24 \
--ENABLE-SO \
--ENABLE-SSL \
--ENABLE-CGI \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-apr=/app/apr/\
--with-apr-util=/app/apr-util/\
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork
[[email protected] httpd-2.4.29]# make-j 4 && make install

[Email protected] httpd-2.4.29]# Cd/app
[[email protected] app]# ls
Apr apr-ut httpd24

Fourth step: Environment variables.
[[Email protected] httpd24]# CD bin
[[email protected] bin]# ls
AB apxs dbmmanage envvars-std htcacheclean htdigest httpd logresolve
Apachectl checkgid envvars fcgistarter htdbm htpasswd httxt2dbm rotatelogs

[Email protected] bin]# echo ' path=/app/httpd24/bin/: $PATH ' >/etc/profile.d/httpd24.sh
[Email protected] bin]#. /etc/profile.d/httpd24.sh
[[email protected] bin]# apachectl start
Fifth step: Users and Groups
(Note here: If the installation is minimized, Apache users do not have to create it manually.)
[Email protected] bin]# getent passwd Apache
Apache:x:48:48:apache:/var/www:/sbin/nologin
The method created is:
Useradd-r-s/sbin/nologin Apache
[[email protected] bin] #ss-NTLP

Part sixth: Configuration files
[Email protected] bin]# cd/root/httpd2.4/
[[email protected] httpd2.4]# ls
apr-1.6.3 apr-util-1.6.1 httpd-2.4.29
APR-1.6.3.TAR.BZ2 apr-util-1.6.1.tar.bz2 httpd-2.4.29.tar.bz2
[Email protected] httpd2.4]# CD httpd-2.4.29/
[[email protected] httpd-2.4.29]# ls
apr-1.6.3 apr-util-1.6.1 httpd-2.4.29
APR-1.6.3.TAR.BZ2 apr-util-1.6.1.tar.bz2 httpd-2.4.29.tar.bz2
[Email protected] httpd2.4]# CD httpd-2.4.29/
[Email protected] httpd-2.4.29]# cd/app/httpd24/conf/
[[email protected] conf]# ls
Extra httpd.conf Magic Mime.types Original
[Email protected] conf]# vim/app/httpd24/conf/httpd.conf

User Apache
Group Apache

[[email protected] conf]# apachectl Restart (restart service)
[[Email protected] conf]# PS aux

You can try it now:
[Email protected] ~]# Curl 192.168.10.107
Its path is placed in:

[Email protected] ~]# cd/app/httpd24/
[[email protected] httpd24]# ls
Bin build Cgi-bin conf error htdocs icons include logs man manual modules
[Email protected] httpd24]# CD Htdocs
[[email protected] htdocs]# ls
Index.html

Seventh Step: Boot script.

Set to boot:
[Email protected] conf]# echo "/app/httpd24/bin/apachectl start" >>/etc/rc.d/rc.local
Reboot.
The best script to write:
Cp/etc/init.d/httpd/etc/init.d/httpd24
Vim/etc/init.d/httpd24
Apachectl=/app/httpd24/bin/apachectl
HTTPD=${HTTPD-/APP/HTTPD24/BIN/HTTPD}
Pidfile=${pidfile-/app/httpd24/logs/httpd.pid}
LOCKFILE=${LOCKFILE-/VAR/LOCK/SUBSYS/HTTPD24}

[Email protected] ~]# LL/ETC/INIT.D/HTTPD24
Permission to read and write execution.
Chkconfig--add httpd24
Chkconfig httpd24 on
Service HTTPD24 Start
Reboot

Vim/etc/rc.d/rc.local

/app/httpd24/bin/apachectl start can be deleted.

In the CENTOS6 compilation installation httpd-2.4 method one

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.