{"id":4395,"date":"2015-03-18T11:18:15","date_gmt":"2015-03-18T03:18:15","guid":{"rendered":"http:\/\/rmohan.com\/?p=4395"},"modified":"2015-03-18T11:32:54","modified_gmt":"2015-03-18T03:32:54","slug":"apache-on-centos-6-6-and-rhel-6-6","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=4395","title":{"rendered":"Apache on Centos 6.6 and RHEL 6.6"},"content":{"rendered":"<p><strong>CentOS compile and install httpd-2.4 and 2.4 versions of the 6.5 features introduced<\/strong><\/p>\n<p><strong>httpd-2.4&#8217;s new features:<\/strong><\/p>\n<p>1) MPM is loaded at run-time support;<br \/>\n&#8211;enalbe All-mpm-shared &#8211;with-mpm = prefork = {| worker | Event}<br \/>\n2) Support Event mpm<br \/>\n3) asynchronous read and write<br \/>\n4) in each module and each directory separately use a different log levels<br \/>\n5) configure each request: &lt;If&gt;, &lt;Else if&gt;<br \/>\n6) Enhanced expression parser<br \/>\n7) millisecond keep alive the timeout<br \/>\n8) FQDN based virtual hosts NameVirtualHost directive is no longer needed;<br \/>\n9) supports user-defined variables<\/p>\n<p>Additional modules :<\/p>\n<p>mod_proxy_fcgi: support for ways to connect with fastcgi backend php<\/p>\n<p>mode_ratelimit: speed limit, restrict user access to the transmission rate<\/p>\n<p>mod_request: user requests to do more filtering<\/p>\n<p>mod_remoteip: user access to IP addresses have more control<\/p>\n<p>Modify some configuration mechanism :<\/p>\n<p>No longer supports the use of order, allow, deny ip based access control definitions, to require<\/p>\n<p>Dependencies :<\/p>\n<p>Because httpd program relies on apr and apr-util so before installing httpd need to install apr and apr-util, apr yum source centos6.5 provided for httpd 1.3.9 version 1.4.0 version supports more than needed, so apr and apr-util also need to be manually installed<\/p>\n<p>yum install openssl*<br \/>\nyum -y install arp apr-devel apr-util apr-util-devel pcre pcre-devel (Important one )<br \/>\nyum groupinstall &#8216;Development tools&#8217;<br \/>\nyum groupinstall &#8216;Server Platform Development&#8217;<br \/>\nwget https:\/\/archive.apache.org\/dist\/apr\/apr-1.5.0.tar.gz<br \/>\nwget https:\/\/archive.apache.org\/dist\/apr\/apr-util-1.5.4.tar.gz<br \/>\nwget http:\/\/mirror.nus.edu.sg\/apache\/\/httpd\/httpd-2.4.12.tar.gz<\/p>\n<p>wget ftp:\/\/ftp.csx.cam.ac.uk\/pub\/software\/programming\/pcre\/pcre2-10.10.tar.gz<\/p>\n<p>tar zxvf apr-1.5.0.tar.gz<br \/>\ntar zxvf apr-util-1.5.4.tar.gz<br \/>\ntar zxvf httpd-2.4.12.tar.gz<br \/>\ntar -zxvf pcre2-10.10.tar.gz<\/p>\n<p>cd \/root\/software\/apr-1.5.0<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/apr<br \/>\nmake &amp;&amp; make install<\/p>\n<p>[root@cluster1 apr-1.5.0]# ls \/usr\/local\/apr\/<br \/>\nbin build-1 include lib<br \/>\n[root@cluster1 apr-1.5.0]#<\/p>\n<p>cd apr-util-1.5.4<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/apr-util &#8211;with-apr=\/usr\/local\/apr<br \/>\nmake &amp;&amp; make install<\/p>\n<p>cd \/root\/software\/pcre2-10.10<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/pcre<br \/>\nmake &amp;&amp; make install<\/p>\n<p>[root@cluster1 httpd-2.4.12]# ls -ltr \/usr\/local\/<br \/>\ntotal 52<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 src<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 sbin<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 libexec<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 lib64<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 lib<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 include<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 games<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 etc<br \/>\ndrwxr-xr-x. 2 root root 4096 Sep 23 2011 bin<br \/>\ndrwxr-xr-x. 5 root root 4096 Feb 19 19:54 share<br \/>\ndrwxr-xr-x. 6 root root 4096 Mar 18 18:43 apr<br \/>\ndrwxr-xr-x. 5 root root 4096 Mar 18 18:45 apr-util<br \/>\ndrwxr-xr-x. 6 root root 4096 Mar 18 18:55 pcre<\/p>\n<p>cd \/root\/software\/httpd-2.4.12<\/p>\n<p>.\/configure &#8211;prefix=\/usr\/local\/apache &#8211;sysconfdir=\/etc\/httpd &#8211;enable-so &#8211;enable-ssl &#8211;enable-cgi &#8211;enable-rewrite &#8211;with-pcre &#8211;with-zlib &#8211;with-apr=\/usr\/local\/apr &#8211;with-apr-util=\/usr\/local\/apr-util &#8211;enable-mpms-shared=all &#8211;with-mpm=event &#8211;enable-modules=most &#8211;enable-file-cache &#8211;enable-cache &#8211;enable-disk-cache &#8211;enable-mem-cache &#8211;enable-deflate &#8211;enable-expires &#8211;enable-headers &#8211;enable-usertrack<br \/>\n.\/configure &#8211;enable-file-cache &#8211;enable-cache &#8211;enable-disk-cache &#8211;enable-mem-cache &#8211;enable-deflate &#8211;enable-expires &#8211;enable-headers &#8211;enable-usertrack &#8211;enable-ssl &#8211;enable-cgi &#8211;enable-vhost-alias &#8211;enable-rewrite &#8211;enable-so &#8211;with-apr=\/usr\/local\/apr\/<br \/>\nmake &amp;&amp; make install<\/p>\n<p>elinks http:\/\/localhost<br \/>\nIt works!<\/p>\n<p>&nbsp;<\/p>\n<p>[root@test2 httpd]# vim httpd.conf<br \/>\n# Server-pool management (MPM specific)<br \/>\nInclude \/etc\/httpd\/extra\/httpd-mpm.conf<br \/>\n[root@cluster1 extra]# ls<br \/>\nhttpd-autoindex.conf httpd-default.conf httpd-languages.conf httpd-mpm.conf httpd-ssl.conf httpd-vhosts.conf<br \/>\nhttpd-dav.conf httpd-info.conf httpd-manual.conf httpd-multilang-errordoc.conf httpd-userdir.conf proxy-html.conf<br \/>\n[root@cluster1 extra]# cat httpd-mpm.conf<br \/>\n#<br \/>\n# Server-Pool Management (MPM specific)<br \/>\n#<\/p>\n<p>#<br \/>\n# PidFile: The file in which the server should record its process<br \/>\n# identification number when it starts.<br \/>\n#<br \/>\n# Note that this is the default PidFile for most MPMs.<br \/>\n#<br \/>\n&lt;IfModule !mpm_netware_module&gt;<br \/>\nPidFile &#8220;logs\/httpd.pid&#8221;<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p>#<br \/>\n# Only one of the below sections will be relevant on your<br \/>\n# installed httpd. Use &#8220;apachectl -l&#8221; to find out the<br \/>\n# active mpm.<br \/>\n#<\/p>\n<p># prefork MPM<br \/>\n# StartServers: number of server processes to start<br \/>\n# MinSpareServers: minimum number of server processes which are kept spare<br \/>\n# MaxSpareServers: maximum number of server processes which are kept spare<br \/>\n# MaxRequestWorkers: maximum number of server processes allowed to start<br \/>\n# MaxConnectionsPerChild: maximum number of connections a server process serves<br \/>\n# before terminating<br \/>\n&lt;IfModule mpm_prefork_module&gt;<br \/>\nStartServers 5<br \/>\nMinSpareServers 5<br \/>\nMaxSpareServers 10<br \/>\nMaxRequestWorkers 250<br \/>\nMaxConnectionsPerChild 0<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p># worker MPM<br \/>\n# StartServers: initial number of server processes to start<br \/>\n# MinSpareThreads: minimum number of worker threads which are kept spare<br \/>\n# MaxSpareThreads: maximum number of worker threads which are kept spare<br \/>\n# ThreadsPerChild: constant number of worker threads in each server process<br \/>\n# MaxRequestWorkers: maximum number of worker threads<br \/>\n# MaxConnectionsPerChild: maximum number of connections a server process serves<br \/>\n# before terminating<br \/>\n&lt;IfModule mpm_worker_module&gt;<br \/>\nStartServers 3<br \/>\nMinSpareThreads 75<br \/>\nMaxSpareThreads 250<br \/>\nThreadsPerChild 25<br \/>\nMaxRequestWorkers 400<br \/>\nMaxConnectionsPerChild 0<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p># event MPM<br \/>\n# StartServers: initial number of server processes to start<br \/>\n# MinSpareThreads: minimum number of worker threads which are kept spare<br \/>\n# MaxSpareThreads: maximum number of worker threads which are kept spare<br \/>\n# ThreadsPerChild: constant number of worker threads in each server process<br \/>\n# MaxRequestWorkers: maximum number of worker threads<br \/>\n# MaxConnectionsPerChild: maximum number of connections a server process serves<br \/>\n# before terminating<br \/>\n&lt;IfModule mpm_event_module&gt;<br \/>\nStartServers 3<br \/>\nMinSpareThreads 75<br \/>\nMaxSpareThreads 250<br \/>\nThreadsPerChild 25<br \/>\nMaxRequestWorkers 400<br \/>\nMaxConnectionsPerChild 0<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p># NetWare MPM<br \/>\n# ThreadStackSize: Stack size allocated for each worker thread<br \/>\n# StartThreads: Number of worker threads launched at server startup<br \/>\n# MinSpareThreads: Minimum number of idle threads, to handle request spikes<br \/>\n# MaxSpareThreads: Maximum number of idle threads<br \/>\n# MaxThreads: Maximum number of worker threads alive at the same time<br \/>\n# MaxConnectionsPerChild: Maximum number of connections a thread serves. It<br \/>\n# is recommended that the default value of 0 be set<br \/>\n# for this directive on NetWare. This will allow the<br \/>\n# thread to continue to service requests indefinitely.<br \/>\n&lt;IfModule mpm_netware_module&gt;<br \/>\nThreadStackSize 65536<br \/>\nStartThreads 250<br \/>\nMinSpareThreads 25<br \/>\nMaxSpareThreads 250<br \/>\nMaxThreads 1000<br \/>\nMaxConnectionsPerChild 0<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p># OS\/2 MPM<br \/>\n# StartServers: Number of server processes to maintain<br \/>\n# MinSpareThreads: Minimum number of idle threads per process,<br \/>\n# to handle request spikes<br \/>\n# MaxSpareThreads: Maximum number of idle threads per process<br \/>\n# MaxConnectionsPerChild: Maximum number of connections per server process<br \/>\n&lt;IfModule mpm_mpmt_os2_module&gt;<br \/>\nStartServers 2<br \/>\nMinSpareThreads 5<br \/>\nMaxSpareThreads 10<br \/>\nMaxConnectionsPerChild 0<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p># WinNT MPM<br \/>\n# ThreadsPerChild: constant number of worker threads in the server process<br \/>\n# MaxConnectionsPerChild: maximum number of connections a server process serves<br \/>\n&lt;IfModule mpm_winnt_module&gt;<br \/>\nThreadsPerChild 150<br \/>\nMaxConnectionsPerChild 0<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p># The maximum number of free Kbytes that every allocator is allowed<br \/>\n# to hold without calling free(). In threaded MPMs, every thread has its own<br \/>\n# allocator. When not set, or when set to zero, the threshold will be set to<br \/>\n# unlimited.<br \/>\n&lt;IfModule !mpm_netware_module&gt;<br \/>\nMaxMemFree 2048<br \/>\n&lt;\/IfModule&gt;<br \/>\n&lt;IfModule mpm_netware_module&gt;<br \/>\nMaxMemFree 100<br \/>\n&lt;\/IfModule&gt;<br \/>\n[root@cluster1 extra]#<\/p>\n<p>vi httpd.conf<br \/>\nmodule is loaded<\/p>\n<p>#LoadModule lbmethod_heartbeat_module modules\/mod_lbmethod_heartbeat.so<br \/>\nLoadModule mpm_event_module modules\/mod_mpm_event.so<br \/>\nCHECK THE MODULES LOADED<\/p>\n<p>[root@cluster1 httpd]# \/usr\/local\/apache\/bin\/httpd -M<br \/>\nLoaded Modules:<br \/>\ncore_module (static)<br \/>\nso_module (static)<br \/>\nhttp_module (static)<br \/>\nauthn_file_module (shared)<br \/>\nauthn_core_module (shared)<br \/>\nauthz_host_module (shared)<br \/>\nauthz_groupfile_module (shared)<br \/>\nauthz_user_module (shared)<br \/>\nauthz_core_module (shared)<br \/>\naccess_compat_module (shared)<br \/>\nauth_basic_module (shared)<br \/>\nreqtimeout_module (shared)<br \/>\nfilter_module (shared)<br \/>\nmime_module (shared)<br \/>\nlog_config_module (shared)<br \/>\nenv_module (shared)<br \/>\nheaders_module (shared)<br \/>\nsetenvif_module (shared)<br \/>\nversion_module (shared)<br \/>\nmpm_event_module (shared)<br \/>\nunixd_module (shared)<br \/>\nstatus_module (shared)<br \/>\nautoindex_module (shared)<br \/>\ndir_module (shared)<br \/>\nalias_module (shared)<br \/>\n[root@cluster1 httpd]#<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS compile and install httpd-2.4 and 2.4 versions of the 6.5 features introduced<\/p>\n<p>httpd-2.4&#8217;s new features:<\/p>\n<p>1) MPM is loaded at run-time support; &#8211;enalbe All-mpm-shared &#8211;with-mpm = prefork = {| worker | Event} 2) Support Event mpm 3) asynchronous read and write 4) in each module and each directory separately use a different log levels [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4395"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4395"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4395\/revisions"}],"predecessor-version":[{"id":4397,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4395\/revisions\/4397"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}