sudo apt-get install Zlib1g-dev
1. Download the website and unzip the httpd-2.4.18.tar.gz
2. Download apr-1.5.2.tar.gz and Unzip http://archive.apache.org/dist/apr/
Enter the APR home directory./configure
Make
sudo make install
./configure--prefix=/home/****/apache--enable-rewrite--enable-so--enable-headers--enable-expires--with-mpm= Worker--enable-modules=most--enable-deflate
3. Download apr-util-1.5.4.tar.gz and Unzip http://archive.apache.org/dist/apr/
./configure--with-apr=/usr/local/apr 这里配置的时候指定的目录就是之前安装的apr的目录,如果之前修改了默认路径的,这里也要对应修改。
Make
sudo make install
4. Download pcre-8.37.tar.gz
Http://sourceforge.net/projects/pcre/files/pcre/8.37/pcre-8.37.tar.gz/download
./configure--enable-utf8
Make
Make check (not required)
sudo make install
5. Installing Apache
./configure--prefix=/home/****/apache--enable-rewrite--enable-so--enable-headers--enable-expires--with-mpm= Worker--enable-modules=most--enable-deflate
Explanation of each parameter
--prefix indicates the installation path for the specified Apache
--enable-rewrite provides rewrite of URL rules to convert to other desired URL addresses based on a known URL address
--ENABLE-SO activation of the Apache service DSO (dynamic shared objects), that is, in the future can be in the form of DSO to compile the installation of shared modules, the module itself can not be built in the DSO mode.
The--enable-headers provides control of the HTTP request header that is allowed.
--enable-expires Activation Hongyu Control http "Expires:" and "Cache-control:" header content through the configuration file, that is, the website image, JS, CSS and other content, provide the client browser cache settings. This is one of the important options for Apache tuning.
--with-mpm=worker Select the Apache MPM mode for worker mode. The principle of worker mode is that more threads are used to process requests, so more concurrent requests can be processed. While the overhead of system resources is little jade based on the process of MPM prefork. If you do not specify this parameter, the default mode is Prefork process mode. This is one of the important options for Apache tuning.
--enable-deflate provides compression transmission encoding support for content, usually HTML, JS, CSS and other content of the site. Using this parameter will increase the transfer speed and enhance the visitor's experience. In a production environment, this is one of the important options for Apache tuning.
Make
sudo make install
Copy the Apache startup script to the/ETC/RC.D/INIT.D directory, as follows:
Cp/usr/local/apache2/bin/apachectl/etc/init.d/httpd
Start Apache as follows:
Ldconfig
/ETC/INIT.D/HTTPD start
Netstat-lntp|grep 80
Lsof-i: 80
Apache Linux Installation