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.

Note that <strong>the</strong> -z flag is a gnu-tar thing, and may not be available in all versions of tar, although it is more<br />

common now than it used <strong>to</strong> be.<br />

Change in<strong>to</strong> <strong>the</strong> direc<strong>to</strong>ry<br />

Build it ...<br />

./configure --prefix=/usr/local/apache<br />

make<br />

make install<br />

Note that if you run ./configure as a non-root user, <strong>Apache</strong> will be configured <strong>to</strong> run on port 8080. This<br />

is very annoying, but being aware of it mostly solves <strong>the</strong> problem. Tell students that <strong>the</strong>y really only need<br />

<strong>to</strong> be root in order <strong>to</strong> make install, and <strong>the</strong>n see what happens. This is mostly for your own information,<br />

since at least one student will do this, and <strong>the</strong>n you’ll be left wondering why it’s not working.<br />

2.3 Contents of distribution file, 1.3<br />

We now take a brief step back <strong>to</strong> look at <strong>the</strong> contents of <strong>the</strong> distribution file, so that <strong>the</strong> student knows<br />

what we’re working with. You’ll need <strong>to</strong> familiarize yourself with <strong>the</strong> contents of each of <strong>the</strong> direc<strong>to</strong>ries in<br />

<strong>the</strong> distribution, so that you can explain any files that <strong>the</strong>y may ask about. Note that <strong>the</strong> layout for 2.0 is<br />

different from that for 1.3, having been reorganized for a variety of reasons.<br />

• cgi-bin<br />

• conf<br />

– Sample CGI programs<br />

– Usually not executable, for security reasons<br />

The rationale here is that, if every web server on <strong>the</strong> planet has a particular CGI program installed<br />

and enabled, and some day, for some reason, someone finds a security exploit in it, it will be a<br />

simple matter <strong>to</strong> crack any server on <strong>the</strong> planet. Thus, we ship sample cgi programs, but don’t<br />

enable <strong>the</strong>m by default, and recommend that <strong>the</strong>y be used for testing only.<br />

– --cgidir=DIR<br />

– Starter configuration files<br />

– Will not overwrite your existing configs<br />

That is, if you modify your configuration file, and <strong>the</strong>n reinstall <strong>Apache</strong>, your changes will be<br />

preserved. This is particularly important for this exercise, as, after installing <strong>Apache</strong> <strong>the</strong> first<br />

time, we want <strong>to</strong> install it again, perhaps several times, with a very different configuration. Thus,<br />

each time, we want <strong>to</strong> remove our configuration file before installing <strong>Apache</strong> again. Make sure<br />

that you explicitly talk about this at this point, as at least one student will forget <strong>to</strong> do this, and<br />

you need <strong>to</strong> have mentioned it so that you don’t look like this problem caught you off-guard.<br />

– Variables filled in based on your build arguments<br />

<strong>Server</strong>Root @@<strong>Server</strong>Root@@<br />

LockFile @rel_logfiledir@/accept.lock<br />

7

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

Saved successfully!

Ooh no, something went wrong!