SOURCE Installation Apache

Source: Internet
Author: User


[Email protected] ~]# yum-y install gcc gcc++ zlib zlib-devel

[Email protected] ~]# wget http://apache.fayea.com/httpd/httpd-2.2.27.tar.gz

[Email protected] ~]# rpm-qa |grep httpd

Httpd-2.2.15-39.el6.centos.x86_64

Httpd-manual-2.2.15-39.el6.centos.noarch

Httpd-tools-2.2.15-39.el6.centos.x86_64

[Email protected] ~]# rpm-e--nodeps httpd-2.2.15-39.el6.centos.x86_64 httpd-manual-2.2.15-39.el6.centos.noarch Httpd-tools-2.2.15-39.el6.centos.x86_64

[Email protected] ~]# rpm-qa |grep httpd

[Email protected] ~]#

[Email protected] ~]# tar-zxf httpd-2.2.27.tar.gz

[Email protected] ~]# CD httpd-2.2.27

[Email protected] httpd-2.2.27]# /configure--prefix=/usr/local/apache2--enable-rewrite--enable-so-- Enable-headers--enable-expires--with-mpm=worker--enable-modules=most--enable-deflate

--prefix=/usr/local/apache2 #指定apache的安装路径, the default installation path is/usr/local/apache2
--enable-rewrite #提供URL规则的重写
--enable-so #激活apache服务的DSO (Dynamic shared objects dynamically share the target), that is, in the future can be the DSO to compile the installation of the shared module, the module itself can not be compiled by DSO.
--enable-headers #提供允许对HTTP请求头的控制.
--enable-expires #通过配置文件控制HTTP的 "Expires:" and "Cache-control:" header content, that is, the site pictures, JS, CSS and other content, provide client browser cache settings. This is one of the important options for Apache tuning.
--with-mpm=worker The mode for #选择apache MPM is 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 #提供对内容的压缩传输编码支持, is generally 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.

[[email protected] httpd-2.2.27]# make && make install

[Email protected] httpd-2.2.27]# ls-al/usr/local/apache2/

Total 68

Drwxr-xr-x. Root root 4096 Dec 12 21:42.

Drwxr-xr-x. Root root 4096 Dec 12 21:42..

Drwxr-xr-x. 2 root root 4096 Dec 21:42 bin

Drwxr-xr-x. 2 root root 4096 Dec 21:42 build

Drwxr-xr-x. 2 root root 4096 Dec 21:42 Cgi-bin

Drwxr-xr-x. 4 root root 4096 Dec 21:42 conf

Drwxr-xr-x. 3 root root 4096 Dec 21:42 error

Drwxr-xr-x. 2 root root 4096 Dec 21:42 htdocs

Drwxr-xr-x. 3 root root 4096 Dec 21:42 icons

Drwxr-xr-x. 2 root root 4096 Dec 21:42 include

Drwxr-xr-x. 3 root root 4096 Dec 21:42 Lib

Drwxr-xr-x. 2 root root 4096 Dec 21:42 logs

Drwxr-xr-x. 4 root root 4096 Dec 21:42 man

Drwxr-xr-x. Root root 12288 Dec 21:42 manual

Drwxr-xr-x. 2 root root 4096 Dec 21:42 modules

[Email protected] httpd-2.2.27]#

[Email protected] httpd-2.2.27]# cp/usr/local/apache2/bin/apachectl/etc/init.d/httpd


http://192.168.18.131/

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/56/AB/wKioL1SKhznDs3drAACs8dtUV1c970.jpg "title=" Qq20141212140824.png "alt=" Wkiol1skhznds3draacs8dtuv1c970.jpg "/>


[Email protected] httpd-2.2.27]# echo "/usr/local/apache2/bin/apachectl start" >>/etc/rc.local


Apache configuration file:

[[email protected] ~]# egrep -v  ' ^[ ]*#|^$ '  /usr/local/apache2/conf/ httpd.conf | nl     1servername localhost:80      2ServerRoot  "/usr/local/apache2"      3Listen 80      4<ifmodule !mpm_netware_module>     5<ifmodule !mpm_ winnt_module>     6user daemon     7group  daemon     8</ifmodule>     9</ifmodule>     10ServerAdmin [email protected]    11DocumentRoot  "/usr/ Local/apache2/htdocs "    12<Directory />    13     Options FollowSymLinks    14    AllowOverride  none    15    Order deny,allow    16    Deny from  all    17</directory>    18<directory  "/usr/local/ Apache2/htdocs ">    19    options indexes followsymlinks     20    AllowOverride None    21     Order allow,deny    22    Allow from  All    23</directory>    24<ifmodule dir_module>     25    DirectoryIndex index.html    26< /ifmodule>    27<filesmatch  "^\.ht" >    28     order allow,deny    29    deny from all     30    satisfy all    31</filesmatch>     32errorlog  "Logs/error_log"     33LogLevel warn    34< ifmodule log_config_module>    35    logformat  "%h % L %u %t \ "%r\"  %>s %b \ "%{referer}i\"  \ "%{user-agent}i\" " combined     36    LogFormat  "%h %l %u %t \"%r\ "  %>s %b " common    37    <ifmodule logio_module >    38      LogFormat  "%h %l %u %t  \ "%r\"  %>s %b \ "%{referer}i\"  \ "%{user-agent}i\"  %i %o " combinedio     39    </IfModule>    40     CustomLog  "logs/aCcess_log " common    41</IfModule>    42<IfModule  alias_module>    43    scriptalias /cgi-bin/  "/usr/local/ apache2/cgi-bin/"    44</ifmodule>    45<ifmodule cgid_ module>    46</ifmodule>    47<directory  "/usr/local/ Apache2/cgi-bin ">    48    AllowOverride None     49    options none    50    order  allow,deny    51    Allow from all     52</Directory>    53DefaultType text/plain    54< ifmodule mime_module>    55    typesconfig conf/ mime.types    56    addtype application/x-compress . z    57    addtype application/x-gzip .gz .tgz     58</IfModule>    59<IfModule ssl_module>     60sslrandomseed startup builtin    61sslrandomseed connect  builtin    62</ifmodule>[[email protected] ~]#

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/56/AE/wKiom1SKkNqCY5yXAAMs2OZrP3Y449.jpg "title=" QQ picture 20141212145330.png "alt=" Wkiom1skknqcy5yxaams2ozrp3y449.jpg "/>

This article is from the "Perfection" blog, please make sure to keep this source http://alipay.blog.51cto.com/7119970/1589296

SOURCE Installation Apache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.