Chapter 11. Conclusion
What’s next?
University Computing Service courses that have this course as a prerequisite.
Tidying up
Some re-ordering of the final configuration file.
We have illustrated a number of facilities in the Apache 2 web server which can be
used to create a web server serving multiple web sites.
The configuration file we have built as we go along is syntactically valid, but reflects
its didactic origins. Our final act will be to tidy it up.
The first thing typically done is to move all the LoadModule commands to a block
near the start of the file. That allows us to use all their commands in whatever order
we want further down the file.
The next thing we would do is to reorder the commands to exploit this freedom. In
our case the only major shuffle will be to put the IndexIgnore statement next to the
FilesMatch block that cover the same files.
# These are the absolute basics to launch the web server.
Listen 80
User apache
Group apache
ServerRoot /etc/httpd
# Turn off all options for didactic reasons.
Options None
# Follow symbolic links
Options +FollowSymLinks
# Load the modules needed for this file
LoadModule mime_module modules/mod_mime.so
LoadModule dir_module modules/mod_dir.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule alias_module modules/mod_alias.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule access_module modules/mod_access.so
LoadModule auth_digest_module modules/mod_auth_digest.so
# Set up MIME type recognition by file name extension
TypesConfig /etc/mime.types
# Enable default documents for directory queries
DirectoryIndex index.html
# Enable automatic indexing of directories
Options +Indexes
# Make the indexes "fancy" and read HTML pages’ titles for descriptions
# Don’t show the size and timestamp columns.
# Let the name and description columns be as wide as they need to be
# Put folders first
# Use default sizes for icons
# Arrange that header files should have their own HTML preamble
IndexOptions FancyIndexing ScanHTMLTitles SuppressSize SuppressLastModified NameWidth=* DescriptionWidth=* FoldersFirst IconWidth IconHeight SuppressHTMLPreamble HTMLTable
81
Komentarze do niniejszej Instrukcji