13.06.2015 Views

Introduction to the Apache Web Server - ApacheCon

Introduction to the Apache Web Server - ApacheCon

Introduction to the Apache Web Server - ApacheCon

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 3<br />

Starting and S<strong>to</strong>pping<br />

http://httpd.apache.org/docs/invoking.html<br />

http://httpd.apache.org/docs/s<strong>to</strong>pping.html<br />

In this section we discuss <strong>the</strong> utilities for starting and s<strong>to</strong>pping <strong>Apache</strong>, including persuading <strong>Apache</strong> <strong>to</strong><br />

start when your system boots up. Along <strong>the</strong> way, we’ll talk about <strong>the</strong> various <strong>Apache</strong> process architectures,<br />

and how <strong>to</strong> choose <strong>the</strong> one that’s right for you.<br />

3.1 <strong>Apache</strong> process architecture<br />

It is useful <strong>to</strong> understand <strong>the</strong> <strong>Apache</strong> architecture before we go much far<strong>the</strong>r.<br />

While this may seem like a bit of a tangent, this is by far <strong>the</strong> best place <strong>to</strong> put this in, and helps understand<br />

some basic things about how <strong>Apache</strong> uses your system. It also helps understand why you have <strong>to</strong> start it as<br />

root, but why this is still secure, as well as numerous o<strong>the</strong>r things which will be useful in <strong>the</strong> long run.<br />

This section is also crucial for understanding many future sections, such as performance, <strong>the</strong> User and Group<br />

directives, and security.<br />

3.1.1 <strong>Apache</strong> 1.3<br />

With <strong>Apache</strong> 1.3, <strong>Apache</strong> runs as multiple processes, each of which is capable of handling incoming HTTP<br />

requests. A single parent process, running as root, manages <strong>the</strong> pool of available servers, creating new ones<br />

as <strong>the</strong>y are needed, and reaping excess ones when load is reduced.<br />

The size of this pool of servers is controlled by <strong>the</strong> directivesMinSpare<strong>Server</strong>s and MaxSpare<strong>Server</strong>s, which<br />

specify how many idle processes <strong>the</strong>re should be at any given time. When a new client request comes in, one<br />

of <strong>the</strong> idle processes is delegated <strong>to</strong> handle that request. If this causes <strong>the</strong> number of idle processes <strong>to</strong> dip<br />

below MinSpare<strong>Server</strong>s, <strong>the</strong>n <strong>Apache</strong> will create a new child process <strong>to</strong> add <strong>to</strong> <strong>the</strong> pool. Likewise, when<br />

a client disconnects, <strong>Apache</strong> will, if necessary, kill off child processes <strong>to</strong> ensure that <strong>the</strong>re are no more than<br />

MaxSpare<strong>Server</strong>s idle processes in <strong>the</strong> pool.<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!