1.2-apache Compiling and installing

Source: Internet
Author: User

Installing Apache

Apache also need to download the appropriate version of the official website, currently using a larger version of 2.0 or 2.2 Amin recommended download version 2.2. Apache Official website: http://www.apache.org/dyn/closer.cgi You can also use the address provided by Amin to download.

[Email protected] mysql]# cd/usr/local/src/[[email protected] src]# wget http://www.lishiming.net/data/attachment/ forum/httpd-2.2.24.tar.bz2

Extract:

[Email protected] src]# tar jvxf httpd-2.2.24.tar.bz2

To configure the compilation parameters:

[Email protected] src]# CD Httpd-2.2.24[[email protected] httpd-2.2.24]#./configure--prefix=/usr/local/apache2-- WITH-INCLUDED-APR--enable-so--enable-deflate=shared--enable-expires=shared--enable-rewrite=shared--with-pcre

--prefix Specifies where to install the --with-included-arp httpd dependency package, which supports cross-platform run --enable-so means enable DSO [1] -- The with-pcre associated with a regular library --enable-deflate=shared represents a shared way of compiling deflate, followed by the same parameters. If you have such an error in this step:

Error:mod_deflate have been requested but can is built due to prerequisite failures

The solution is:

Yum Install-y zlib-devel

To avoid errors in make, it is best to install some library files in advance:

Yum install-y pcre pcre-devel Apr apr-devel

Compile:

[[email protected] httpd-2.2.24] #make

Installation:

[[email protected] httpd-2.2.24] #make Install

The above two steps can use echo $ to check whether it is executed correctly, otherwise you will need to solve the problem according to the error prompt.



List of modules supported by Apache (with static modules and dynamic modules)

/usr/local/apache2/bin/apachectl-m

Dynamic Module Catalog ls/usr/local/apache2/modules/Multiple dynamic modules, when required when loading

static module files ls/usr/local/apache2/bin/httpd All static, packaged into one file


/usr/local/apache2/bin/apachectl- l list static modules only

/usr/local/apache2/bin/apachectl -T Check configuration file for syntax errors

ls/usr/local/apache2/conf/httpd.conf Apache configuration file Location

/usr/local/apache2/bin/apachectl start|sotp|restart Start | stop | restart Apache

/usr/local/apache2/bin/apachectl Graceful do not turn off the service, reload the configuration file


The httpd service does not support chkconfig when it uses Chkconfig to set the self-compilation to system service. The resolution process is as follows:

1. Edit/ETC/INIT.D/HTTPD

#!/bin/bash
#chkconfig: 345 61 61



1.2-apache Compiling and installing

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.