Can't get SSI working on Ubuntu 9.04
I have run````
sudo a2enmod include
And this is the vhost that's in (or symlinked in) /etc/apache2/sites-enabled/
Place any notes or comments you have here
It will make any customisation easier to understand in the weeks to come
domain: mydomain.com
public: /var/www/mydomain.com/
ServerAdmin mydomain@gmail.com
ServerName mydomain.com
ServerAlias www.mydomain.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /var/www/mydomain.com/httpdocs
<directory var="" www="" mydomain.com="" httpdocs="">Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
allow from all</directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog /var/www/mydomain.com/log/error.log
CustomLog /var/www/mydomain.com/log/access.log combined</virtualhost>
````
Any help would be greatly appreciated.
13 Replies
There's nothing in /etc/apache2/httpd.conf, and nothing referencing Includes in apache2.conf.
Is there anywhere else this could be getting overridden?
here
I didn't set up a separate virtual host this time.. I'm working off of the default_site vhost that was set up and working with the default Debian install. I'm just adding +Includes to appropriate directory sections. Nothing is working though.
I have run a2enmod include, and the mod appears in mods-enabled.
I'm so lost here..
/etc/init.d/apache2 restart
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
I can't even output non file-include server side directives, like
The SSI code is not parsed, and is output in the HTML code.
The code that hybinet suggested only effects .shtml files..
1. mod_include compiled in Apache:
[root@vps] cd /usr/local/apache2/bin
[root@vps] ./httpd -l | grep mod_include
mod_include.c
Your path to the httpd binary may be different. If you don't see "mod_include.c" then it's not compiled.
2. SSI directives active:
The following lines must appear in httpd.conf (for global application – i.e., all domains) or in a specific virtualhost:
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
3. Option 'Includes' (or '+Includes' to merge it with existing options) for the directory where the file is being served (applies to subdirectories):
<directory some="" path="" here="">Options +Includes</directory>
4. An HTML file with the extension ".shtml". An example include might be:
" ".
I didn't understand the way output filters were working. I was trying to include .shtml files into an .html file… I was adding output filters for .shtml, but I needed to add
AddType text/html .html
AddOutputFilter INCLUDES .html
Thanks everyone!
Read
Scroll to the section "Configuring your server to permit SSI":
> You'll occasionally see people recommending that you just tell Apache to parse all .html files for SSI, so that you don't have to mess with .shtml file names. These folks have perhaps not heard about XBitHack. The thing to keep in mind is that, by doing this, you're requiring that Apache read through every single file that it sends out to clients, even if they don't contain any SSI directives. This can slow things down quite a bit, and is not a good idea.