2-apache2.4 in LAMP Environment
1. The default apr version of centos6 is no longer applicable to Apache2.4. We need to reinstall the new version of apr and apr-util (arp: Apache Portable Runtime, which can be transplanted to the Runtime Library, support for apache on multiple platforms) 2. MPM before 2.4 is set to prefork by default, and 2.4 has changed to event mode, in addition, there are many different configuration methods in version 2.4 and earlier version 2.2 (the configuration will be described in detail later) #1, download arp, arp-util, httpd2.4 source package cd/usr/local/srcwget http://mirrors.cnnic.cn/apache/apr/apr-1.5.1.tar.bz2wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.4.tar.gzwget http://mirrors.sohu.com/apache/httpd-2.4.10.tar.gz# 2, install apr-1.5.1, must follow this order tar jxvf apr-1.5.1.tar.bz2cd apr-1.5.1. /configure -- prefix =/usr/local/aprmakemake install #3. arp-1.5.1 zxvf apr-util-1.5.4tar with apr-util-1.5.4.tar.gzcd. /configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/aprmakemake install #4, #1). Many errors may occur during source code installation, for example, if gcc and pcre libraries are missing, the errors may be different for different machines. This is because the environment required for httpd2.4 installation is not sufficient and the processing is very simple, install the corresponding library according to the error prompted by make. If you have installed apache before, the next installation will be smooth, because the required environment is complete #2) select the "-devel" development version #3 when installing the library file) install some library files and tools yum-y install pcre-devel openssl-devel gcc #5. install httpd2.4tar zvxf httpd-2.4.10.tar.gzcd. /configure -- prefix =/usr/local/apache2-with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util/-- enable -so -- with-pcre -- enable-mod-shared = most # parameters: -- prefix =/usr/local/apache: Specify the installation target path -- enable-so: supports dynamic sharing modules. Without this module, PHP cannot work with apache -- with-pcre: identify perl regular expressions -- enable-modules = most: Install most modules -- with-apr =/usr/local/apr: specify the apr path -- with-apr-util =/usr/local/apr-util: Specify the apr-util path make install 6, apachectl common options: (Sysv style, therefore, parameters such as start and restart are also supported.) apachectl start service graceful reloads the configuration file restart help to view help information-t to view syntax errors, it is very important (before restarting the configuration file after modification, you must-t check whether there is an error and restart)-M View module information: static module, dynamic module (shared, depends on the configuration file)-l list the compiled modules