The content of this document may be incorrect or outdated.
Print this article Edit this article
Apache transition
A lot of effort has been put into making the transition from NCSA HTTPd to Apache transparent, but there will be some problems. These problems should only affect "above-basic" users who hopefully will know enough about HTTPd to be able to make the necessary modifications to their materials so that they will function properly under Apache.
- cgi-bin and www-bin gone
- Long ago, sites said that they didn't like having to make www-bin/user directories in order for users to be able to use CGI programs. NCSA HTTPd 1.4.2 was documented as allowing users to put CGI programs in their own directories, but it didn't work so an ECN modification to httpd was made to allow operation as documented.
Since then, we have discouraged the use of www-bin directories and stopped making new ones, but we have never eliminated them. In some cases this was necessary because even with the fix, 1.4.2 did not support all CGI functionality when programs were run from user's own directories instead of the www-bin directories.
Apache now fully supports CGI programs in arbitrary directories. All remaining www-bin/ programs should be moved into "normal" directories.
- CGI kludge
- In the .htaccess file, a line like
AddType text/gibberish .foo
informs the server that all files ending in ".foo" are to be treated as type "text/gibberish". Users often used a line likeAddType application/x-httpd-cgi .cgi
to tell the server to treat all files ending in ".cgi" as CGI programs.Some hacks soon realized that files without extensions could also be made to run as CGI by using a line like
AddType application/x-httpd-cgi myprog
because NCSA HTTPd did simple string matching to determine the type.Apache interprets file extensions much better, but as a result, this kludge no longer works. To fix this, the user needs to enable "Options MultiViews" (which is on by default) and rename the file with a .cgi extension. The URL will remain the same (no ".cgi" on the end), but Apache will locate the file and interpret it correctly.
- /var/www/htdocs
- The "DocumentRoot" for each host is now /usr/local/etc/httpd/DocumentRoot instead of /var/www/htdocs. This makes a lot of automation possible, but it also makes maintenance and debugging of sites much easier. The most obvious effect is that a request from any Apache host for "/something/" should succeed as long as "something" is served by some ECN host. (For example, "http://pasture.ecn.purdue.edu/ECE/" will eventually get the user to "http://ece.www.ecn.purdue.edu/ECE/".)
The problem that might be encountered is that people may have created arbitrary files and directories in /var/www/htdocs. These will eventually need to be moved to more appropriate places, but for now they are usually found by the "hunt module" and a redirect to that location is made. (For example, "http://www.ecn.purdue.edu/grad.current.html" redirects to "http://www.ecn.purdue.edu/v1/grad.current.html".) This will not work with CGI programs which use POST.
- /~user/
- A request for "/~user/" from any Apache host on which "user" has an account (but which does not host her home directory) will redirect to the host which does serve the home directory. Under NCSA HTTPd, such requests yielded a "403 Forbidden" error. (For example, a user requesting "http://asphodel.ecn.purdue.edu/~carmicha/" will end up at "http://atom.ecn.purdue.edu/~carmicha/" and thoroughly clog the 'net with images...)
- /var/www/logs
- Since the WWW includes more than just HTTP, HTTPd logs are now in /var/www/logs/httpd. The lines in /var/www/httpd/access have also changed slightly. Now, instead of the referring URL for a request being logged in a separate file, it is logged right along with the other information about the request. This makes log analyzing (and archiving) programs such as Analog much more efficient and accurate, but it will break any that depend on the old format.
Access logs are now archived in /var/www/httpd using a format which makes archiving and analysis much easier. Instead of rotating logs through access.0.gz through access.x.gz, logs are saved in files according to the date of the entries which they hold. (For example, access.19970416.gz has all entries for April 16, 1997.)
Access logs are not currently destroyed automatically. Development is still underway for a good algorithm. Error logs are removed nightly.
- pagecount
- Pagecount used an awful kludge (involving parsing two server configuration files) to try to guess the directory path of the file in which it was called. (This happened every time someone loaded a pagecount-ed page!) This information is usually provided to programs executed via server-side includes, but not when called the way that pagecount has usually been called.
Under Apache, the path guessing algorithm would need to change a lot, so pagecount was instead modified so that it wouldn't need to do such guessing. Before, pagecount was called as
<!--#exec cgi="/cgi-bin/pagecount"-->
but in order to get the server to send the necessary data (and for other improvements in efficiency), it now must be called as<!--#exec cmd="/usr/local/etc/httpd/apache/tools/legacy/pagecount.cgi"-->
Hopefully pagecount will die as users discover Analog.
- .htaccess
- Although all .htaccess commands (except for the above kludge) should still work, most are now unnecessary and unwanted. The server now knows about .cgi, .inc, .shtml, .whtml, .wshtml by default so users do not need to specify these. Also, all Options are enabled by default so that users don't need to use "Options ExecCGI Includes Indexes ..." Additionally, a new option "MultiViews" is on by default, but will be turned off if a user sets Options without including "MultiViews".
Last Modified:
Dec 19, 2016 11:12 am US/Eastern
Created:
Mar 20, 2007 5:23 pm GMT-4
by
admin
JumpURL: