ssi on apache2 doesn't work
I know nothing about apache[2], but I've inherited the responsibility to move a web site from a Solaris box to Debian Etch (Yea!).
I've installed apache2 and gotten the site moved over, and it seems that everything works (it's a simple site), but I've noticed that some links give 404s. On closer inspection, these links point to
index.shtml files rather than index.html files. I understand that's a hint to the apache server to look for server-side includes in the file.
I've been googling all evening, and am running out of time before I have to re-enable the Solaris box if I don't get this running (Boo-o-o-oo!), but much of the documentation seems out of date or doesn't actually answer the issue.
As I understand it, apache2 uses "/etc/apache2/apache2.conf" as its main config file rather than "httpd.conf". I further understand that this file looks to other files for "virtual web servers", so I also need to consider the file "/etc/apache2/sites-enabled/000-default" (which symlinks to "/etc/apache2/sites-available/default".
I've found references to adding "+Includes" to your "Options" section, but no indication whatsoever where that "Options" section is. I've pretty much decided this needs to go into the "000-default" file, which now looks like this:
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /home/web/htdocs
<Directory />
Options FollowSymLinks +Includes
AllowOverride None
</Directory>
<Directory /home/web/htdocs/hughes/148/072/>
Options FollowSymLinks +Includes
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>
(and etc etc)
Notice I've changed the default document root from /var/www in order to match the file structure brought over from the Solaris box. I've also added three instances of "+Includes".
I've also found references to including some module, but I know nothing about what that means. I did find a specific reference to run the command "a2enmod include", which I did.
I'm restarting apache2 between each of my modifications.
Here's an example of what the directory looks like that generates the error:
westk@goshen:/home/web/html/tdh/325$ sudo ls -l
total 1084
-rw-r--r-x 1 tdh tdh 38 2007-01-13 16:22 coursefinal.shtml
-rw-r--r-x 1 tdh tdh 44 2007-01-13 16:22 courseroom.shtml
-rw-r--r-x 1 tdh tdh 12 2007-01-13 15:00 coursesemester.shtml
-rw-r--r-x 1 tdh tdh 12 2007-01-13 16:28 course.shtml
-rw-r--r-x 1 tdh tdh 45 2007-01-13 16:23
coursesyllabus.shtml
-rw-r--r-x 1 tdh tdh 24 2007-01-13 16:23 coursetime.shtml
-rw-r--r-x 1 tdh tdh 16 2007-01-13 16:23 coursetitle.shtml
-rw-r--r-x 1 tdh tdh 648 2007-01-13 14:58 footer.shtml
-rw-r--r-x 1 tdh tdh 13561 2007-04-20 08:56
index.shtml
-rw-rw-r-x 1 tdh tdh 42091 2007-01-19 13:02 info-sheet.pdf
-rw-r--r-x 1 tdh tdh 1555 1998-11-20 22:11 maple00-matrix.gif
-rw-r--r-x 1 tdh tdh 6788 2007-01-19 13:05 maple00.shtml
-rw-r--r-x 1 tdh tdh 5259 2007-01-19 13:05
project.shtml
-rw-r--r-x 1 tdh tdh 3403 2007-01-16 21:26 sect-1.1-elemrowops.mws
-rw-r--r-x 1 tdh tdh 21198 2007-01-16 21:26 sect-1.1-elemrowops.pdf
-rw-r--r-x 1 tdh tdh 86690 2007-02-11 20:17
sect-2.2-inverse.mw
-rw-r--r-x 1 tdh tdh 864805 2007-02-11 20:05 sect-2.2-inverse.pdf
westk@goshen:/home/web/html/tdh/325$ sudo ls -ld ../../325
lrwxrwxrwx 1 tdh tdh 13 2007-04-26 10:28 ../../325 -> old/325-20071
westk@goshen:/home/web/html/tdh/325$ sudo ls -ld ../325-20071
drwxr-xr-x 2 tdh tdh 4096 2007-02-12 07:33 ../325-20071
If I rename the "index.shtml" file to "index.html", I get a file listing of that directory.
Here's the tail end of the apache2 log:
westk@goshen:/var/log/apache2$ sudo tail error.log
[Thu Apr 26 21:05:27 2007] [notice] caught SIGTERM, shutting down
[Thu Apr 26 21:05:37 2007] [notice] Apache/2.2.3 (Debian) configured -- resuming normal operations
[Thu Apr 26 21:05:41 2007] [error] [client 150.252.166.116] Directory index forbidden by Options directive: /home/web/htdocs/hendricks/325/, referer:
http://math.acu.edu/hendricks/
[Thu Apr 26 21:05:45 2007] [error] [client 150.252.166.116] Directory index forbidden by Options directive: /home/web/htdocs/hendricks/325/, referer:
http://math.acu.edu/hendricks/
[Thu Apr 26 21:05:48 2007] [error] [client 150.252.166.116] Directory index forbidden by Options directive: /home/web/htdocs/hendricks/120/, referer:
http://math.acu.edu/hendricks/
[Thu Apr 26 21:10:25 2007] [notice] caught SIGTERM, shutting down
[Thu Apr 26 21:10:35 2007] [notice] Apache/2.2.3 (Debian) configured -- resuming normal operations
[Thu Apr 26 21:10:52 2007] [error] [client 150.252.166.116] Directory index forbidden by Options directive: /home/web/htdocs/hughes/148/072/, referer:
http://math.acu.edu/hughes/
[Thu Apr 26 21:11:08 2007] [error] [client 150.252.110.216] File does not exist: /home/web/htdocs/favicon.ico
[Thu Apr 26 21:11:08 2007] [error] [client
150.252.110.216] File does not exist: /home/web/htdocs/favicon.ico
This is also happening with at least one other directory that uses "index.shtml" files.
If you want to get a feel for the site,
http://www.acu.edu/math
then "Faculty and Staff" on the left,
then "David Hendricks",
then one of his schedule links. Depending on if this site is still on the Debian box or the Solaris box will depend on if it works properly or not.
Thanks for any help you can provide!
--
Kent West
Westing Peacefully - http://kentwest.blogspot.com
Reply to: