Page 1 of 1

Server Side Includes (SSI) deactivated

PostPosted: 14. December 2007 21:35
by Goofy2k
When I look in my XAMMP status (via http://localhost) I see a red indicator with "deactivated" for Server Side Includes.

Originally the sign was green. How do I activate this ?

PostPosted: 15. December 2007 01:46
by Izzy
This section of the httpd.conf file explains things for you.
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)

#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml


The Options drective is contained in the <Directory> directive in the httpd.conf file or the httpd-vhost.conf file.
http://httpd.apache.org/docs/2.2/mod/core.html#options

<Directory "C:/xampp/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options MultiViews Indexes FollowSymLinks Includes ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

If you are using a virtualhost container for the localhost in the httpd-vhost.conf file then make sure it has an entry similar to this or your entry may override the httpd.conf file's entry.
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Save any changes you make and then restart Apache.
Don't forget to make backups of any conf or ini file before editing.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 15. December 2007 10:41
by Goofy2k
My httpd.conf contains the Include in the <Directory> part.

There is httpd-vhosts.conf in my XAMPP folder.

PostPosted: 15. December 2007 10:59
by Goofy2k
Oops. I did find the httpd-vhosts.conf file now.

But all lines are preceeded by ##, which probably (?) means that the lines are commented out and not active.

PostPosted: 15. December 2007 12:56
by Izzy
If you have not used the httpd-vhost.conf file then it should not be affecting this, as you say it will all be commented out.

Check this line in the httpd.conf file is uncommented.

Should be:
LoadModule include_module modules/mod_include.so

Not this:
#LoadModule include_module modules/mod_include.so

Other than that and as you say the Include option is included in the <directory> directive then we have seen that SSI should now be activated.

You could try adding a + in front of the Include option so it looks like this:
+Includes

Don't forget to save the httpd.conf file and restart Apache to get any changes you made recognized.

Just another thing to do is clear your browser's cache because when working at localhost level it can keep giving you a cached page instead of a fresh loaded file.

This Apache SSI tutorial gives activation details plus much more:
http://httpd.apache.org/docs/2.2/howto/ssi.html
(Ignore the references to the XBitHack as it is not relevant to Windows Apache installations).



===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 15. December 2007 20:53
by Goofy2k
Checked the commenting: this was allright

Changed Includes to +Includes

Now reads:
------------
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks +Includes ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
---------------

Done restart etc. Situation is still the same. I'm going to have a look in the link that you've sent.

Had all indicators green some days ago, but somehow it changed. And I haven't been digging in these setup files before.

Do you have a tip to distiguish if SSI is actually working or not? Now I'm not sure that some errors are not caused by having SSI off.

Re: Server Side Includes (SSI) deactivated

PostPosted: 11. May 2009 23:30
by gshiga
Hi Izzy,

Thank you for your detailed responses on this topic! I was lucky to stumble across this message board while searching for SSI troubleshooting w/ XAMPP. I recently installed XAMPP onto my computer (including adding a virtual host) and I've spent the last 2 days trying to figure out why SSI wouldn't work with my pages. I found this post and read your comment re: adding the Options directive ("Options Indexes FollowSymLinks Includes ExecCGI") to the virtual host file and it worked! I'm a newbie to website development, so I would never have figured that out without your help. I know this is an old post, but wanted to let you know that your posts were still helping newbies like myself (and I'm sure countless others).

Cheers,

Genji