You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Greene, Gregory" <gr...@unh.edu> on 2009/12/17 17:52:16 UTC

[users@httpd] Enabling Server Side Includes in Apache2.2

Can anyone help a new user of Apache2.2?  I'm trying to enable SSI on the server but don't seem to
be having much luck.  I've looked on google and in the FAQ and put into place what seems to be fairly
straightforward edits but it never works.  Hoping someone can point me in the right direction.

Here's what I put in my httpd.conf file:

<Directory "/var/www/html">
    Options Indexes FollowSymLinks Includes

    AllowOverride None

    Order allow,deny
    Allow from all

    AddType text/html .html
    AddOutputFilter INCLUDES .html
    AddType text/html .htm
    AddOutputFilter INCLUDES .htm
</Directory>

I also tried experimenting with the XBitHack directive but it didn't help either.  Beginning to wonder if
my HTML code to include is just not in the right format.  It did work when I ran this webserver on
Windows 2003 Server but perhaps it's not compatible with Apache/Linux.  Here is the line I'm looking
to include:

<!-- #include file="game.htm" -->

I have a bunch of galleries of images in a directory structure in /var/www/html.  Do you have to define
each and every one in the httpd.conf file?  I tried doing that for one gallery but it didn't work either.

Any thoughts?  Thanks in advance.

Greg

Re: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by Charan <ch...@gmail.com>.
try this

<IfModule mod_include.c>
    <Directory "/var/www/html">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes .html
        AddType text/html .shtml
        AddType text/html .htm
        AddOutputFilter INCLUDES .shtml
        AddHandler type-map var
        Order allow,deny
        Allow from all
    </Directory>

On Thu, Dec 17, 2009 at 8:52 AM, Greene, Gregory <gr...@unh.edu> wrote:
> Can anyone help a new user of Apache2.2?  I’m trying to enable SSI on the
> server but don’t seem to
>
> be having much luck.  I’ve looked on google and in the FAQ and put into
> place what seems to be fairly
>
> straightforward edits but it never works.  Hoping someone can point me in
> the right direction.
>
>
>
> Here’s what I put in my httpd.conf file:
>
>
>
> <Directory "/var/www/html">
>
>     Options Indexes FollowSymLinks Includes
>
>
>
>     AllowOverride None
>
>
>
>     Order allow,deny
>
>     Allow from all
>
>
>
>     AddType text/html .html
>
>     AddOutputFilter INCLUDES .html
>
>     AddType text/html .htm
>
>     AddOutputFilter INCLUDES .htm
>
> </Directory>
>
>
>
> I also tried experimenting with the XBitHack directive but it didn’t help
> either.  Beginning to wonder if
>
> my HTML code to include is just not in the right format.  It did work when I
> ran this webserver on
>
> Windows 2003 Server but perhaps it’s not compatible with Apache/Linux.  Here
> is the line I’m looking
>
> to include:
>
>
>
> <!-- #include file="game.htm" -->
>
>
>
> I have a bunch of galleries of images in a directory structure in
> /var/www/html.  Do you have to define
>
> each and every one in the httpd.conf file?  I tried doing that for one
> gallery but it didn’t work either.
>
>
>
> Any thoughts?  Thanks in advance.
>
>
>
> Greg



-- 
Thanks,
Charan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by Zachary Uram <ne...@gmail.com>.
On Thu, Dec 17, 2009 at 3:46 PM, Greene, Gregory <gr...@unh.edu> wrote:
> Wanted to say thank you to all the people who offered help.  I was finally
> able to figure it out.  It was the space between the <!-- and the # in the
> include statement in the htm file that was causing the problem.  Apparently
> Linux/Apache is much more strict about the formatting then the Windows server with IIS.

Cool. So you changed this: <!-- #include file="game.htm" --> to this:
<!--#include file="game.htm" -->

?

Zach

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by "Greene, Gregory" <gr...@unh.edu>.
Wanted to say thank you to all the people who offered help.  I was finally
able to figure it out.  It was the space between the <!-- and the # in the
include statement in the htm file that was causing the problem.  Apparently
Linux/Apache is much more strict about the formatting then the Windows server with IIS.

My ultimate httpd.conf really was very simple:

<Directory "/var/www/html">
    Options Indexes FollowSymLinks IncludesNoExec
    AddType text/html .html .htm
    AddOutputFilter INCLUDES .html .htm
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

That's all I needed.  Now I have to change about 100 files to take out that
space.  Urghhh.  

Greg
      

-----Original Message-----
From: Greene, Gregory [mailto:gregory.greene@unh.edu] 
Sent: Thursday, December 17, 2009 2:57 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Enabling Server Side Includes in Apache2.2

I've been trying different things that I run across on google searches but so far nothing seems to work.  It seems so simple yet is beyond me right
now.  My latest attempt had me adding a wildcard to the path in the directory line but it didn't help.  

Current config:

<IfModule mod_include.c>
<Directory "/var/www/html">
    Options Indexes FollowSymLinks IncludesNoExec
    AllowOverride None
    AddType text/html .html
    AddOutputFilter INCLUDES .html
    AddType text/html .htm
    AddOutputFilter INCLUDES .htm
    Order allow,deny
    Allow from all
    XBitHack on
</Directory>
<Directory "/var/www/html/*">
    Options Indexes FollowSymLinks IncludesNoExec
    AddType text/html .html
    AddOutputFilter INCLUDES .html
    AddType text/html .htm
    AddOutputFilter INCLUDES .htm
    AllowOverride None
    Order allow,deny
    Allow from all
    XBitHack on
</Directory>
</IfModule>

greg


-----Original Message-----
From: Greene, Gregory [mailto:gregory.greene@unh.edu] 
Sent: Thursday, December 17, 2009 1:57 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Enabling Server Side Includes in Apache2.2

I found the loadmodule line in the httpd.conf file and confirmed that it is also listed out using httpd -M.  I've got no errors in the logfile.  It's like it just ignores the include code.  I found something on a google search
about changing the double quotes in the include line to single quotes but
that didn't help.  I also used the addhandler directives that were an older
usage but that didn't work either.  

Not really sure what's going on.  Not much to go on.  I would really like to 
avoid going back to a Windows server.    

Greg

>I can't give specifics for httpd under RHEL, but you're looking for a 
>line that is similar to this:
>
>LoadModule include_module /usr/lib/apache2/modules/mod_include.so
>
>To determine which modules are loaded into the server (both static and 
>dynamic), run "httpd -M". The <IfModule> directive simply checks to make 
>sure the module is loaded before attempting to set the directives within >it.
>
>Make sure you check your Apache logs too for any errors or notifications.
>
>-- 
>Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by "Greene, Gregory" <gr...@unh.edu>.
I've been trying different things that I run across on google searches but so far nothing seems to work.  It seems so simple yet is beyond me right
now.  My latest attempt had me adding a wildcard to the path in the directory line but it didn't help.  

Current config:

<IfModule mod_include.c>
<Directory "/var/www/html">
    Options Indexes FollowSymLinks IncludesNoExec
    AllowOverride None
    AddType text/html .html
    AddOutputFilter INCLUDES .html
    AddType text/html .htm
    AddOutputFilter INCLUDES .htm
    Order allow,deny
    Allow from all
    XBitHack on
</Directory>
<Directory "/var/www/html/*">
    Options Indexes FollowSymLinks IncludesNoExec
    AddType text/html .html
    AddOutputFilter INCLUDES .html
    AddType text/html .htm
    AddOutputFilter INCLUDES .htm
    AllowOverride None
    Order allow,deny
    Allow from all
    XBitHack on
</Directory>
</IfModule>

greg


-----Original Message-----
From: Greene, Gregory [mailto:gregory.greene@unh.edu] 
Sent: Thursday, December 17, 2009 1:57 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Enabling Server Side Includes in Apache2.2

I found the loadmodule line in the httpd.conf file and confirmed that it is also listed out using httpd -M.  I've got no errors in the logfile.  It's like it just ignores the include code.  I found something on a google search
about changing the double quotes in the include line to single quotes but
that didn't help.  I also used the addhandler directives that were an older
usage but that didn't work either.  

Not really sure what's going on.  Not much to go on.  I would really like to 
avoid going back to a Windows server.    

Greg

>I can't give specifics for httpd under RHEL, but you're looking for a 
>line that is similar to this:
>
>LoadModule include_module /usr/lib/apache2/modules/mod_include.so
>
>To determine which modules are loaded into the server (both static and 
>dynamic), run "httpd -M". The <IfModule> directive simply checks to make 
>sure the module is loaded before attempting to set the directives within >it.
>
>Make sure you check your Apache logs too for any errors or notifications.
>
>-- 
>Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by "Greene, Gregory" <gr...@unh.edu>.
I found the loadmodule line in the httpd.conf file and confirmed that it is also listed out using httpd -M.  I've got no errors in the logfile.  It's like it just ignores the include code.  I found something on a google search
about changing the double quotes in the include line to single quotes but
that didn't help.  I also used the addhandler directives that were an older
usage but that didn't work either.  

Not really sure what's going on.  Not much to go on.  I would really like to 
avoid going back to a Windows server.    

Greg

>I can't give specifics for httpd under RHEL, but you're looking for a 
>line that is similar to this:
>
>LoadModule include_module /usr/lib/apache2/modules/mod_include.so
>
>To determine which modules are loaded into the server (both static and 
>dynamic), run "httpd -M". The <IfModule> directive simply checks to make 
>sure the module is loaded before attempting to set the directives within >it.
>
>Make sure you check your Apache logs too for any errors or notifications.
>
>-- 
>Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by Justin Pasher <ju...@newmediagateway.com>.
Greene, Gregory wrote:
> I tried what Charan suggested but it didn't work either.  In answer to what Justin asked, yes, my files that contain the SSI are in either .htm or .html.  The files are in a subdirectory structure below /var/www/html.  Do 
> I have to specify the absolute directory path in the httpd.conf?  I have a 
> bunch of gallery directories and that would be a pain to be honest.  
>
> The one thing I don't know about is the include_module.  This is a Red Hat R5 Linux install configured as a webserver.  Is the include_module compiled
> into Apache by default?  The RH install really didn't offer much in the way 
> of customizations.  One thing I did do was to add these lines around the 
> <Directory> code in the httpd.conf file.  I didn't realize they were needed. 
>
> <Ifmodule mod_include.c>
> </IfModule>
>
> Is there a way for me to tell if that module is enabled.  Even with that in
> the httpd.conf it still doesn't work. 
>   

I can't give specifics for httpd under RHEL, but you're looking for a 
line that is similar to this:

LoadModule include_module /usr/lib/apache2/modules/mod_include.so

To determine which modules are loaded into the server (both static and 
dynamic), run "httpd -M". The <IfModule> directive simply checks to make 
sure the module is loaded before attempting to set the directives within it.

Make sure you check your Apache logs too for any errors or notifications.

-- 
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by Iñigo Medina <im...@grosshat.com>.
> Is there a way for me to tell if that module is enabled.  Even with that in
> the httpd.conf it still doesn't work.

Just type /etc/init.d/apache -l to get a list of modules.


   iñigo

>
> Greg
>
>
>> Make sure all of the following are true:
>>
>> 1. The file that contains the SSI directive actually ends in .htm or
>> .html (per your config)
>> 2. The file is located under /var/www/html
>> 3. The includes module (include_module) is being loaded in your config.
>>
>> Try checking your apache error log too to make sure it's not complaining
>> about anything.
>>
>> --
>> Justin Pasher
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

RE: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by "Greene, Gregory" <gr...@unh.edu>.
I tried what Charan suggested but it didn't work either.  In answer to what Justin asked, yes, my files that contain the SSI are in either .htm or .html.  The files are in a subdirectory structure below /var/www/html.  Do 
I have to specify the absolute directory path in the httpd.conf?  I have a 
bunch of gallery directories and that would be a pain to be honest.  

The one thing I don't know about is the include_module.  This is a Red Hat R5 Linux install configured as a webserver.  Is the include_module compiled
into Apache by default?  The RH install really didn't offer much in the way 
of customizations.  One thing I did do was to add these lines around the 
<Directory> code in the httpd.conf file.  I didn't realize they were needed. 

<Ifmodule mod_include.c>
</IfModule>

Is there a way for me to tell if that module is enabled.  Even with that in
the httpd.conf it still doesn't work. 

Greg
  

>Make sure all of the following are true:
>
>1. The file that contains the SSI directive actually ends in .htm or 
>.html (per your config)
>2. The file is located under /var/www/html
>3. The includes module (include_module) is being loaded in your config.
>
>Try checking your apache error log too to make sure it's not complaining 
>about anything.
>
>-- 
>Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Enabling Server Side Includes in Apache2.2

Posted by Justin Pasher <ju...@newmediagateway.com>.
Greene, Gregory wrote:
>
> <Directory "/var/www/html">
>
> Options Indexes FollowSymLinks Includes
>
> AllowOverride None
>
> Order allow,deny
>
> Allow from all
>
> AddType text/html .html
>
> AddOutputFilter INCLUDES .html
>
> AddType text/html .htm
>
> AddOutputFilter INCLUDES .htm
>
> </Directory>
>
> I also tried experimenting with the XBitHack directive but it didn’t 
> help either. Beginning to wonder if
>
> my HTML code to include is just not in the right format. It did work 
> when I ran this webserver on
>
> Windows 2003 Server but perhaps it’s not compatible with Apache/Linux. 
> Here is the line I’m looking
>
> to include:
>
> <!-- #include file="game.htm" -->
>

Make sure all of the following are true:

1. The file that contains the SSI directive actually ends in .htm or 
.html (per your config)
2. The file is located under /var/www/html
3. The includes module (include_module) is being loaded in your config.

Try checking your apache error log too to make sure it's not complaining 
about anything.

-- 
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org