Compile and install Apache and specify working mode as work

Source: Internet
Author: User
Tags fully qualified domain name

a , Apache mode view

If Apache is already installed, we can use the Httpd-l command to view the current mode (there may only be one), if found PREFORK.C indicates that the current work in prefork mode, the same way WORKER.C is working in worker mode.

If Apache is not yet installed, we can add--with-pem= (prefork|worker) when compiling

option determines what mode is enabled.

Of course if you have installed (author mode is prefork) You can also use the following command to switch

MV HTTPd Httpd.prefork
MV Httpd.worker httpd

after rebooting, the mode will change.

Second, installation Apche


Because Apache relies on APR, Apr-util, and pcre, it needs to be downloaded:

APR + apr-util:http://apr.apache.org/download.cgi

PCRE:http://sourceforge.net/projects/pcre/files/pcre/

1. Install Apr

Tar zxvf apr-1.5.1.tar.gz (extract files to directory/home/gaoqing/software/apache)

./CONFIGURE--PREFIX=/HOME/GAOQING/SOFTWARE/APACHE/APR Configuring the installation directory

Make

Make install

2, installation Apr-util

./configure--prefix=/home/gaoqing/software/apache/apr-util--WITH-APR=/HOME/GAOQING/SOFTWARE/APACHE/APR


Make && make install

3, installation Pcre

./configure--prefix=/home/gaoqing/software/apache/pcre


4, install Apache, and specify the working mode for work

: http://httpd.apache.org/

./configure--prefix=/home/gaoqing/software/apache/apache--WITH-APR=/HOME/GAOQING/SOFTWARE/APACHE/APR-- With-apr-util=/home/gaoqing/software/apache/apr-util--with-pcre=/home/gaoqing/software/apache/pcre--with-mpm= Worker

Make && make install


Third, the configuration

Modify the configuration file, or the problem will occur:

AH00558:httpd:Could notreliably determine the server ' s fully qualified domain name, using 127.0.1.1.Set the ' ServerName ' Directive globally to suppress this message

Workaround: Modify the conf/httpd.conf :

# servernamewww.example.com:80

instead:

Servernamelocalhost:80

IV: Start, stop, restart of Apache service


Assuming your APAHCE installation directory is/usr/local/apache2, these methods are suitable for any situation

Apahce Start command:
Recommended/usr/local/apache2/bin/apachectl Start APACEH startup

Apache Stop Command
/usr/local/apache2/bin/apachectl Stop Stop

Apache Restart command:
/usr/local/apache2/bin/apachectl Restart Restart

To restart the Apache server without interrupting the current connection, you should run:

/usr/local/sbin/apachectl Graceful

Service httpd Start

Service httpd Restart Restart

servicehttpd Stop Stop Service







Compile and install Apache and specify working mode as work

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.