http-2.4
1) new features (1) MPM support Run as DSO mechanism; load on demand as a module (2) Event MPM production environment available (3) asynchronous read-write mechanism (4) supports individual log level definitions per module and per directory (5) per request-related private configuration (6) Enhanced expression Parsing (7) Millisecond Persistent connection length definition (8) FQDN-based virtual host does not require the Namevirutalhost Directive (9) New instruction, Allowoverridelist (10) supports user-defined variables (11) More Low memory consumption 2) modified some configuration mechanisms no longer support the use of order, Deny, allow to do IP-based access control 3) new module (1) mod_proxy_fcgi FastCGI Protocol backend for Mod_proxy (2) Mod_remoteip replaces the apparent client remote IP address and hostname for the request with the IP address List presented by a proxies or a load balancer via the request headers. (3) Mod_ratelimit provides Bandwidth rate limiting for clients 4) CENTOS7 HTTPD Program Environment 1) CentOS 7:httpd-2.4 2) Installation method: RPM, compile and install 3) RPM installation program Environment: Configuration file:/etc/httpd/conf/httpd.conf/etc/httpd/conf.d/*.co NF Module Related configuration file:/etc/httpd/conf.modules.d/*.conf systemd Unit File/usr/lib/systemd/syst Em/httpd.service Main program file:/USR/SBIN/HTTPD httpd-2.4 support for MPM log files:/var/log/httpd access_log: Access log error_log: Error log Site Documentation:/var/www/html module file path:/usr/lib64/httpd/modules Service control: systemctl {E Nable|disable} httpd.service systemctl {start|stop|restart|status} httpd.service5) configuration Configuration Application: (1) switch the MPM used CENTOS7:/etc/httpd/conf.modules.d/00-mpm.conf enable MPM-related loadmodule instructions to be enabled CENTOS6 compile and install : vim/etc/httpd24/httpd.conf include/etc/httpd24/extra/httpd-mpm.conf Loadmodul E mpm_event_module modules/mod_mpm_event.so (2) Home directory: Documentroot/path (3) IP-based access control: non-clear Authorized directory, default deny allow all host access: Require All granted deny all host access: Require all denied control specific IP access: Require IP IPADDR: Authorizing IP access to the specified source Require not IP ipaddr: Deny specific host access to a particular IP access control: Require host HOSTNAME: authorizing specific host access Require notHost HOSTNAME: Deny specific host access HOSTNAME:FQDN: Specific host Domin.tld: All hosts under the specified domain name There can be no failure, at least one successful match <RequireAll> Require all granted Require not IP 172.16.10 0.2 deny specific IPs </RequireAll> multiple statements have a success, that is, success <RequireAny> ... </RequireAny> (4) The virtual host FQDN-based virtual host also no longer requires the Namevirutalhost directive <virtualhost *:80> Serv Ername www.b.net documentroot "/apps/b.net/htdocs" <directory "/apps/b.net/htdocs" > Options none allowoverride None # #Apache是否允许另一配置文件覆盖现有配置文件. Require All granted </Directory> </VirtualHost> Note: Pages in any directory can only be accessed by explicit authorization (5) SSL: Installation Mod_ssl, same configuration as httpd-2.2 (6) KeepAlive on KeepAliveTimeout #ms maxkeepaliverequests 100 ms Persistent connection duration Definition (7) Implement virtual host vim/etc/httpd/conf on Cento7.d/vhosts.conf <virtualhost *:80 > ServerName www.a.com documentroot "/app/ a.com/"Proxypass"/"http://www.a.com:8080/" # #请求转发 Proxypassreverse "/" "HTTP://WWW.A . com:8080/"# #配置总是和ProxyPass consistent, its role is reverse proxy, if there is 302 redirect in response, Proxypassreverse comes in handy. <directory/app/a.com> Require all granted </directory> </virt Ualhost> Listen 8080 <virtualhost *:8080 > ServerName www.b.com DocumentRoot "/app/b.com/" <directory/app/b.com> Require all Grant Ed </directory> </virtualhost> <virtualhost *:80 > ServerName www.c.com <directory/app/c.com> Require all granted </directory> DocumentrOot "/app/c.com/" </virtualhost> in CENTOS6 compile install httpd-2.4 install httpd-2.4 dependent on apr-1.4+, apr-util-1.4+, [ APR-ICONV] Apr:apache Portable runtime, solving the cross-platform implementation CentOS 6: Default: apr-1.3.9, apr-util-1.3.9 prepare the development package before installation: on Hair Environment Package Group: Development Tools,server Development Package: Pcre-devel, openssl-devel download source code and extract: Http://www.apac He.org/index.html#projects-list apr-1.5.2.tar.bz2 apr-util-1.5.4.tar.bz2 Httpd-2.4.27.tar . BZ2 (1) Install apr-1.4+./configure--prefix=/usr/local/apr make && make install ( 2) Install apr-util-1.4+./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr make && ; Make install (3) compile and install httpd-2.4./configure--prefix=/usr/local/httpd24--sysconfdir=/etc/httpd24--enabl E-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=prefork make && make install or below Method 1 mv apr- 1.5.2/HTTPD-2.4.27/SRCLIB/APR 2 "MV Apr-util-1.5.4/httpd-2.4.27/srclib/apr-util 3" CD HTTPD-2.4.27/4 "./configure--prefix=/usr/local/httpd24--enable-so--enable-ssl--enable-cgi--enable-rewrite--with-zlib-- With-pcre--with-included-apr--enable-modules=most--enable-mpms-shared=all--with-mpm=prefork 5 "Make && m Ake Install 6 "HTTPD compilation process:/usr/local/apache24/build/config.nice 7" comes with a service control script:/usr/local/httpd24/bin/apachectl 8 "vim/etc/profile.d/httpd24.sh Export Path=/app/http24/bin: $PATH 9" Vim/etc/man.config Manpath/usr/local/apache24/man 10 Custom Startup script (refer to httpd-2.2 's service script) Cp/etc/rc.d/init.d/httpd/etc/rc.d/ini T.D/HTTPD24 vim/etc/rc.d/init.d/httpd24 Apachectl=/usr/local/httpd24/bin/apachectl httpd=${httpd-/usr/local/httpd24/BIN/HTTPD} pidfile=${pidfile-/usr/local/httpd24/logs/httpd.pid} Lockfile=${lockfile-/var/loc K/SUBSYS/HTTPD24} chkconfig–add httpd24; chkconfig–list httpd24
http-2.4