first, compile and installApache1. Environment Preparation:2. apache2.4.9+new Features
apache-2.4+ Some of the new features (see https://httpd.apache.org/docs/2.4/zh-cn/new_features_2_4.html)
1. MPM that can be loaded at run time
Many MPM can now be built as loadable modules at compile time. The selected MPM can be configured with the loadmodule instruction at run time.
2. event MPM (fully supported)
3. Asynchronous Support
Asynchronous read/write support for MPM and platform for better support.
4. loglevel configuration for each module and per directory
the LogLevel of the , now each module and each directory is configured. The new level TRACE1 to Trace8 above the debug log level that has been added.
5. configuration section for each request
< if > &NBSP, <elseif > < other >
6. General Expression Parser
A new expression parser allows you to specify under complex conditionslike directives using general syntax setenvifexpr, Rewritecondinstruction, Head, <if>, and other.
7. KeepAliveTimeout In milliseconds
It is now possible to specify of the KeepAliveTimeout milliseconds.
8. Namevirtualhost instruction
No longer needed, it is now obsolete.
9. Overwrite Configuration
New allowoverridelist The directive allows the directive to be allowed in a finer-grained controlled . htaccess file.
. configuration file Variables
it can now definition The structure of the variable allows for a clearer representation if the same value is used in many places of configuration.
One by one . Reduce memory usage
. Although there are many new features, 2.4.x tend to use than 2.2.x less memory in the
Of course, on the httpd2.4 also added a number of new modules, you can refer to the Apache website
3. Service Platform Building
Choose to compile the installation package, you must ensure that the development platform has been configured, and the development platform of the service
Yum Groupinstall "Development tools" "Server Platform development–y" Yum install–y "Pcre-devel" Yum install–y lrzsz #提供的 is the upload and download function
4. Compiling the installationApr
Tar XF apr-1.5.0.tar.bz2cd apr-1.5.0./configure--prefix=/usr/local/aprmake && make install
Role: Apr:apache Portable Run-time is the Apache runtime environment, in order to enable Apache to run on different platforms and can use the same mechanism, so APR can erase different systems of the database, so that Apache operating environment is the same mechanism, and allows some of Apache's features to be used across platforms.
5. Compiling the installationApr-util
# 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 && make install
2. Compiling the installationhttpd2.4.91.compilingApache2.4.9
# Tar XF httpd-2.4.9.tar.bz2# cd httpd-2.4.9#./configure--prefix=/usr/local/apache--sysconfdir=/etc/ Httpd24--enable-so--enable-ssl--enable-cgi--enable-rewrite--with-zlib--with-pcre--with-apr=/usr/local/apr-- With-apr-util=/usr/local/apr-util--enable-modules=most--enable-mpms-shared=all--with-mpm=event# Make && Make install
Note : During the installation process, there may be some errors that indicate what package is not installed and you can install it and recompile httpd
The problem I met has checking for OpenSSL version >= 0.9.8a ... FAILEd
My solution is " yuminstall-y openssl-devel"
2.Add:
(1) constructing MPM as static module
on all platforms, MPM can be built as static modules. Select a MPM at build time , linked to the server. If you want to change MPM, you must rebuild it. In order to use the specified MPM, use the parameter--with-mpm=name when executing the Configure script . name is the specified MPM name. After the compilation is complete, you can use ./httpd-l to determine the selected MPM. This command lists all modules that are compiled into the server program, including MPM.
(2) build MPM as dynamic module httpd-m
in the in Unix or similar platforms,MPM can be built as a dynamic module and loaded at run time as with other dynamic modules. Building mpm as a dynamic module allows you to change the MPM by modifying the contents of the LoadModule directivewithout rebuilding the server program. Use the--enable-mpms-shared option to enable this feature when you execute a configure script . all MPM modules supported by this platform will be installed when the given parameter is all. You can also give a list of modules in the parameters. The default MPM, which can be automatically selected or specified by the--WITH-MPM option when the Configure script is executed , then appears in the generated server configuration file. Edit The LoadModule instruction content to select a different MPM.
3.parameter Settings1.Export Library Settings
[Email protected] apache]# ln-s/usr/local/apache/include//usr/include/httpd24
2.Output Binary Program
Vim/etc/profile.d/httpd24.shexport Path=/usr/local/apach/bin: $PATHSource/etc/profile.d/httpd24.sh
3.ExportMansBrochures
Vim/etc/man.configmanpath/usr/local/apache/man
4.Test
Apachectl startcurl (native IP address)
5. Add a service script
Close Service
Apachectl stop
Modify The httpd Master profile, set the path to its Pid file, edit the/etc/httpd24/httpd.conf, and add the following line:
Pidfile "/var/run/httpd24.pid"
provide SysV Service Script ,
Cp/etc/rc.d/init.d/httpd{,.bak}
vim/etc/rc.d/init.d/httpd, Modify the content can be , paths are compiled and installed Apache the path
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7F/9F/wKioL1cmDXKiGFIDAABQaFQgnUY194.jpg "title=" Phase 1. jpg "alt=" Wkiol1cmdxkigfidaabqafqgnuy194.jpg "/>
Join the Service list:
# chkconfig--add httpd
The next step is to start the service and test it.
Service httpd Start
This article is from the "Touch Dream" blog, so be sure to keep this source http://xuelong.blog.51cto.com/10573089/1769383
HTTPD2.4B Compiling and installing