The Structure

The Structure

Virtually every Linux distribution comes with Apache, the free WWW server. We cover details of customizing Apache eleswhere in this book. See Chapter 9 for details. Different distributions place the served content in different places. SuSE, for ex ample, puts the Apache content directories at /var/www. SuSE 6.4 puts them at /usr/local/httpd. For the purposes of this discussion, we will assume that the Web content is deployed in /var/www. This does not reflect any preference on our part. It is simply less to type!

The most common tree structure under a Web server looks something like this:

/<basedir> Debian uses "/var/www"
 \
 |-- cgi-bin Debian keeps these in /usr/lib/cgi-bin
 |-- htdocs (perhaps "html") Debian doesn't have this.
 |-- icons

Depending on your distribution and options you may have installed, there may be several more directories at this level, such as logs, servlets and so on.

Most distributions place some sort of standard content in this structure. Debian, for instance, puts up a slightly modified standard Apache postinstall index file. SuSE puts in a homepage with links to the online documentation and to pages that show the present system configuration. Other distributions will vary.

For the purposes of this chapter, I'm going to assume a Debian file layout. As in Chapter 4 , this choice was made through exhasutive analysis of which distribution offered the greatest pedagogical potential and also because I was using a Debian machine when I wrote this chapter.

None of the pre-existing content just mentioned will be significant for your undernet. The best thing to do is to cd to the /var/www directory and (as root) run rm -rf ./*, which, when done, will have deleted everything in and below the www directory.

From this point on, you deploy documents in the /var/www/ directory. You should immediately create a file in this directory called index.html, which is the file the Web server will try to present whenever anyone tries to visit your machine with an empty file URL (meaning http://your.host.com/ , which is equivalent to http://your.host.com/index.html ).

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net