Installing the Apache Web server

Source: Internet
Author: User
Tags browser cache

█ installation Apache2.4.23

New Modules:

MOD_PROXY_FCGI (fcgi agent available)

Mod_ratelimit (limit user broadband)

Mod_request (Request module, filter on request)

MOD_REMOTEIP (matches the IP address of the client)

IP-based access control has been modified to no longer support the Allow,deny,order mechanism, but is unified using require

new features added:

MPM supports running a fashion load, but to turn on this feature, you need to enable--enable-mpms-shared=all--with-mpm=event when compiling the installation

Support Event

Supports asynchronous read and write

Specify the log level on each module and per directory

Enhanced version of the expression parser

Configure:<if>,<elseif> per request

Millisecond-level keepalive timeout

FQDN-based virtual machines no longer require namevirtualhost directives

Support for using custom variables

Installation environment: centos7.2, turn off SELinux

1. Compile and install Apache2.4.23

Download the source package:

Http-2.4.23.tar.gz

apr-1.5.2.tar.gz (Portable runtime, used to implement the operating system of Apache internal components, improve system portability)

Apr-util-1.5.4.tar.gz

Zlib-1.2.8.tar.gz

Pcre-8.39.tar.gz

① Installing Apr

Tar zxf apr-1.5.2.tar.gz

CD APR-1.5.2/

./configure--PREFIX=/USR/LOCAL/APR

Make && make install

② installation Apr-util

Tar zxf apr-util-1.5.4.tar.gz

CD apr-util-1.5.4.tar.gz

./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR

Make && make install

③ installation Zlib

Tar zxf zlib-1.2.8.tar.gz

CD zlib-1.2.8/

./configure--prefix=/usr/local/zlib

Make && make install

④ installation Pcre

Tar zxf pcre-8.39.tar.gz

CD pcre-8.39/

./configure--prefix=/usr/local/pcre

Make && make install

⑤ installing OpenSSL (Centos7 with version openssl-1.0.1e, version too low)

Download Openssl:wget https://www.openssl.org/source/openssl-1.0.1u.tar.gz

Tar zxf openssl-1.0.1u.tar.gz

CD openssl-1.0.1u/

./config-fpic--prefix=/usr/local/openssl enable-shared

Make && make install

mv/usr/bin/openssl/usr/bin/openssl.1.0.1u

Ln-s/usr/local/openssl/bin/openssl/usr/bin/openssl

⑥ installation Apache2.4.34

Tar zxf httpd-2.4.23.tar.gz

CD httpd-2.4.23/

./configure--prefix=/usr/local/http-2.4.23--enable-so--enable-cgi--enable-cgid--enable-ssl--with-ssl--with-ssl =/usr/local/openssl--enable-rewrite--with-pcre=/usr/local/pcre--with-z=/usr/local/zlib--with-apr=/usr/local/ Apr--with-apr-util=/usr/local/apr-util--enable-modules=most--enable-mods-shared=most--enable-mpms-shared=all-- With-mpm=event--enable-proxy--enable-proxy-fcgi--enable-expires--enable-deflate

★ Note: Explanation of relevant parameters

--ENABLE-SO: Support dynamic sharing module (that is, open DSO support)

--ENABLE-CGI: Enable CGI

--ENABLE-CGID:MPM: Using an event or worker to enable Cgid

--ENABLE-SSL: Support SSL

--WITH-SSL=/USR/LOCAL/OPENSSL: Specify the SSL installation location

--enable-rewrite: Support URL rewriting

--with-pcre=/usr/local/pcre: Support Pcre

--with-z=/usr/local/zlib: Using zlib compression Library

--WITH-APR=/USR/LOCAL/APR: Specify the installation path for APR

--with-apr-util=/usr/local/apr-util: Specify the installation path for Apr-util

--enable-modules=most: explicitly specifies that modules to be statically compiled into httpd binaries,<module-list> a space-delimited list of modules, all or Most,all to contain all modules, Most include most common modules

--enable-mods-shared=most: explicitly specifies that the module to be compiled in DSO,<module-list> a space-delimited list of modules, all or most,all to include all modules, Most include most common modules

--enable-mpms-shared=all: Enable MPM for all supported modes so that the event, worker, and Prefork will be installed in a modular manner, so that you can configure it in httpd.conf.

--with-mpm=event: Specifies the enabled MPM mode, which uses the event mode by default, in earlier versions of Apache 2.0 the default prefork,2.2 version is the worker,2.4 version is the event

--enable-expires: Activates or controls HTTP's "Expires:" and "Cache-control:" header content via the configuration file, which provides client browser cache settings for content such as Web site pictures, JS, CSS, and more

--enable-deflate: To provide compression transmission encoding support for content, usually HTML, JS, CSS and other content of the site. Using this parameter can greatly improve the transfer speed and enhance the visitor's experience.

Make && make install

Optimizing HTTP Program execution paths

Ln-s/usr/local/http-2.4.23/bin/*/usr/local/bin/

Modify the configuration file httpd.conf, set the servername value

For example: ServerName www.test.com

Open Apache Server

/usr/local/http-2.4.23/bin/apachectl start

Auto start after boot

Cp/usr/local/http-2.4.23/bin/apachectl/etc/init.d/httpd

Edit the/etc/init.d/httpd file and add it below the first line:

#chkconfig: 35 85 15

#description: apache-2.4.23

Add Apache to boot automatically

Chkconfig--add httpd

Chkconfig httpd on

Launch the compiled Apache 2.4.23

Service httpd Start

NETSTAT-ANPLT | grep 80

2. Yum installs Apache

Update native service: Yum update

Installing apache:yum-y Install Apache

Start Apache:service httpd Start

This article is from the "Operations" blog, please be sure to keep this source http://cherryliang.blog.51cto.com/12911935/1937345

Installing the Apache Web server

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.