Forum Moderators: phranque

Message Too Old, No Replies

Trouble with Server Side Includes

         

acer34e

7:20 pm on Nov 22, 2010 (gmt 0)

10+ Year Member



I've been trying to get SSI's enable on a server I've been working on. It is an Ubuntu 10.10 Server running Apache2, PHP5 and MySQL. The default page loads correctly and soon I will need to deploy it with html includes available. No amount of configuration on my part has fixed this. These are my notable config files. Does anybody see what I am doing wrong? And I am restarting the apache server after changes to the config files:

From /etc/apache2/apache2.conf
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>

/etc/apache2/sites-available/default
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch +Includes
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks +Includes
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

/var/www/.htaccess
AddType text/html .shtml .html .htm
AddHandler server-parsed .shtml .html .htm
Options Indexes FollowSymLinks Includes


The .htaccess file does work properly because when I put gibberish into it I receive a 500 Internal Server Error. Does anyone see the error of my ways?

acer34e

12:22 pm on Nov 23, 2010 (gmt 0)

10+ Year Member



Can anybody see what I'm missing? This is a fresh LAMP install. I ran into the same problem getting it up and running on a Zend Server as well. Here is a sample of the index.html page I'm testing it with:

<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
<!--#include virtual="/footer.shtml" -->
</body></html>

tangor

4:00 pm on Nov 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your last three lines should be the first three in the .htaccess and add the following right below:

Options SymLinksIfOwnerMatch Includes

There are other SymLinks possible, do a search, but without the line above with the word Includes SSI won't be activated.

acer34e

4:12 pm on Nov 23, 2010 (gmt 0)

10+ Year Member



I added
Options SymLinksIfOwnerMatch Includes
to the .htaccess file at the bottom but there was no change.
I've also these includes to test out and still a no go. Am I missing something in the apache2.conf or default configurations?
<!--#include virtual="/footer.shtml" -->
<!--#include virtual="footer.shtml" -->
<!--#include file="/footer.shtml" -->
<!--#include file="footer.shtml" -->