Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Apache httpd - serving web documents from different directories

If you're running a web server, first simple logic says that you should keep all of your web pages in a single directory tree that's got the same directory structure as your web site. And you can do this and have it work well in a simple case.

But what if you want to do a major upgrade from time to time, but leave your icons and help pages untouched? What if you want to make the standard pages supplied with Apache available but from a different part of the disc? What if you want to provide users each with their own area as part of the tree? What if you want to have a separate area for executable programs so they don't get mixed in with the documents?

You can achieve all of these features via Apache's alias and scriptalias commands, and set up the permissions on different areas using directory instructions. You must do that latter in parallel to safeguard your security.

Alias /icons/ "/usr/share/httpd/icons/"
ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/"

Note the trailing slashes (important) and the difference between the alias and scriptalias commands - an alias is used for diverting directories of documents and a scriptalias for directories of programs; with a scriptalias, AS WELL AS diverting the URL, the web server will send out the results of RUNNING the file it points at rather than the CONTENTS of the file.

If you want to have one web page accessible under several names - for example is you're running a script to feed everything in a directory from a database - then have a look at mod_rewrite rather than aliases. A subject for another day.


(written 2005-12-12 09:39:57)

 
Associated topics are indexed under
A602 - Web Application Deployment - Apache httpd - Sourcing, Installation, Testing
A603 - Web Application Deployment - Further httpd Configuration

Back to
Vision AND venture
Previous and next
or
Horse's mouth home
Forward to
Greater Western Franchise Awarded
Some other Articles
Perl course during the week, getting married at the weekend
Halal in Melksham
Getting favicon to work - avoiding common pitfalls
Greater Western Franchise Awarded
Apache httpd - serving web documents from different directories
Vision AND venture
Santa comes to Melksham
Apache httpd release 2.2
Javascript events - a good example
Proof needed? Please just use common sense!
1892 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho