Compiling and installing apache2.4

Source: Internet
Author: User



Apache Software Description: Apache is a Web services software, is the core of the lamp architecture, support port-and IP-based virtual machines, support port mapping, URL rewriting, processing dynamic and static Web resources, the power of Can be combined with PHP through the CGI module to handle Dynamic Web resources, supporting the module is much more than nginx, there are prefork,event,wprker three MPM mode, support the DSO module dynamic loading mechanism, and can be combined with MySQL database for Web resource storage, However, the processing of static resources is not as powerful as nginx; typically nginx is used as a static resource processing server or reverse proxy server, which Apache uses to process Dynamic Web resources.

According to www.netcraft.com statistics Apache-web Service software Long-term market share of more than 50%, up to 80%, so compile and install Apache is the basic skills that Web engineers must master.



1: Prepare the development environment, install the development environment whenever you want to compile the installation


Yum Groupinstall "Development Tools" "Server Platform Development"-Y

Installing Pcre-devel

Yum Install Pcre-devel-y



2: Install Apr and Apr-util package

#tar XF apr-1.5.0.tar.gz

#cd apr-1.5.0

#./configure--PREFIX=/USR/LOCAL/APR

#make && make Install

#tar XF apr-util-1.5.3.tar.gz

#cd apr-util-1.5.3

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

#make && make Install



3: Compile and install Apache

#tar-XF httpd-2.4.10.tar.gz

#cd httpd-2.4.10

#./configure--prefix=/usr/local/apache24

--with-mpm=worker \apache Working mode is the event model

--enable-cache \ Cache-related

--enable-disk-cache

--enable-modules=most \ Compiles most of the common modules

--enable-file-cache

--with-pcre \ Support for Perl extended regular expressions

--enable-mods-shared=most \ Compile all three MPM modules Prefork.event.worker

--ENABLE-SO \ Support DSO dynamic loading, module can be loaded on demand (LoadModule)

--enable-rewrite \ Support URL Rewriting

--ENABLE-SSL \ Support SSL Protocol

--with-apr=/usr/local/apr/\APR Installation path

--with-apr-util=/usr/local/apr-util/\apr-util Installation path

--ENABLE-CGI \ Support for Dynamic Web page processing with PHP through CGI

--with-zlib \ Support Zlib compression

--SYSCONFDIR=/ETC/HTTP24 \ Specify the httpd profile path for the newly installed

#make && make Install



4: File after installation is complete

#cd/usr/local/apache24

[email protected] apache24]# LL

Total 52

Drwxr-xr-x. 2 root root 4096 Oct 14:20 bin/apache own binary command

Drwxr-xr-x. 2 root root 4096 Oct 14:20 build/apache24/build/config.nice file You can check/See the commands you use when compiling your installation

Drwxr-xr-x. 2 root root 4096 Oct 14:20 Cgi-bin

Drwxr-xr-x. 3 root root 4096 Oct 14:20 error/error page display content

Drwxr-xr-x. 2 root root 4096 Oct 13:46 htdocs/web file storage location, not/var/www

Drwxr-xr-x. 3 root root 4096 Oct 14:20 icons

Drwxr-xr-x. 2 root root 4096 Oct 14:20 include/installed Apache header file

Drwxr-xr-x. 2 root root 4096 Oct 14:35 logs/log

Drwxr-xr-x. 4 root root 4096 Oct 14:20 man/manual, Help document

Drwxr-xr-x. Root Ro:ot 12288 Jul 1 01:15 manual/Official documentation

Drwxr-xr-x. 2 root root 4096 Oct 14:20 modules/module



5: Installation Complete, start


#/usr/local/apache24/bin/apachectl start

#火狐浏览器输入192.168.139.3

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/89/79/wKiom1gUUSOQPEs_AAq4Qkz7vzU981.png-wh_500x0-wm_3 -wmp_4-s_3381846679.png "title=" Qqworks.png "alt=" Wkiom1guusoqpes_aaq4qkz7vzu981.png-wh_50 "/>




6: Output Header file

#[[email protected] apache24]# ln-sv/usr/local/apache24/include//usr/include//httpd

/usr/include//httpd '/usr/local/apache24/include/'



7: Output Library file

[Email protected] apache24]# vim/etc/ld.so.conf.d/httpd.conf

Write/usr/local/apache24/lib

#ldconfig-v \ Let the dynamic link library be shared by the system



8: Add path Path

#export Path=/usr/local/apache24/bin: $PATH (so you can manage Apache directly with Apachectl start|stop)

#apachectl stop



9: Output Help Manual

#vim/etc/man.conf

Join Manpath=/usr/local/apache24/man


This article is from the "11097124" blog, please be sure to keep this source http://11107124.blog.51cto.com/11097124/1867120

Compiling and installing apache2.4

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.