Help - Search - Members - Calendar
Full Version: SSI not working - Apache under Windows
HTMLHelp Forums > Programming > Web Server Configuration
Dr Z
I bought a new lap-top and installed apache... Its working, including the vhosts.

I can not make SSI work (for include).

I have apache running on my PC (with SSI working) and I have been comparing the config files on the two. For the life me I can not find where I may have goofed.

Please note:
include module loaded and enabled (config file)

Added "Includes" on all directory Options

Added "AddType text/html" & "AddHandler server-parsed" for .shml .txt .inc
(I use txt and inc extensionsion for different type of files to be included)

No error messages in the apache error log.

If anyone can guess what I am doing wrong, or failing to do, I would appreciate the input.
pandy
Did you add Options Includes in the right place? I know I've made that mistake. I only have Apace 1.3 here. In httpd.conf there's first this bit:

# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>


Right below is this. Here's where you should add it, not above. At least if your document root is somewhere else than ...Apache/htdocs .


# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/path/to/document/root">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews Includes
Dr Z
QUOTE(pandy @ Sep 12 2006, 06:27 PM) *

Did you add Options Includes in the right place? I know I've made that mistake. I only have Apace 1.3 here. In httpd.conf there's first this bit:

# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>


Right below is this. Here's where you should add it, not above. At least if your document root is somewhere else than ...Apache/htdocs .


# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/path/to/document/root">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews Includes




Thank you.
I did have "Includes" in all relevant directories...

However, in the mean time I solved the problem!

I commented out "AddType" for all extensions
and
I added

"AddHandler server-parsed" for .html & .htm

I know it does not jive with Apache SSI related page instructions (I have beeen looking at it for some time now), but it worked!

Perhaps, this may be useful to anyone trying to attempt to do the same




pandy
Do you mean it just didn't work for .html before but you could use .shtml? Cause you already has AddHandler for .shtml.

I don't think you should comment out all AddType directives or you'll *beep* up Mime types. glare.gif

I have this.
AddType text/html .shtml
AddHandler server-parsed .shtml .html .inc
pandy
Come on! That isn't a bad word in this context! laugh.gif

I did *not* say the F word. I said the S word. Like in a S-driver. cool.gif

Dumb board - go beeping on me. ninja.gif
Dr Z
QUOTE(pandy @ Sep 12 2006, 08:46 PM) *

Do you mean it just didn't work for .html before but you could use .shtml? Cause you already has AddHandler for .shtml.

I don't think you should comment out all AddType directives or you'll *beep* up Mime types. glare.gif

I have this.
AddType text/html .shtml
AddHandler server-parsed .shtml .html .inc



After I read your reply, I tried something stupid for the fun of it ...

I commented out :
AddHandler server-parsed .inc

and went to a page that uses inc extensions for include files.... What would you guess? It still works!

Me thinketh that "AddHandler server-parsed" directive applies to the main file extension, not to the included files. If the main file extension is html or htm or shtml, who cares what the file extesion is for inclusions......

Good morning after supper! Or am I loosing my marbles?
pandy
I think your *beep* server is *beep* *beep* *beep*! tongue.gif
Dr Z
QUOTE(Dr Z @ Sep 12 2006, 09:31 PM) *

QUOTE(pandy @ Sep 12 2006, 08:46 PM) *

Do you mean it just didn't work for .html before but you could use .shtml? Cause you already has AddHandler for .shtml.

I don't think you should comment out all AddType directives or you'll *beep* up Mime types. glare.gif

I have this.
AddType text/html .shtml
AddHandler server-parsed .shtml .html .inc



After I read your reply, I tried something stupid for the fun of it ...

I commented out :
AddHandler server-parsed .inc

and went to a page that uses inc extensions for include files.... What would you guess? It still works!

Me thinketh that "AddHandler server-parsed" directive applies to the main file extension, not to the included files. If the main file extension is html or htm or shtml, who cares what the file extesion is for inclusions......

Good morning after supper! Or am I loosing my marbles?



I do not know which beeber you are refering to...
Christian J
QUOTE(Dr Z @ Sep 13 2006, 07:54 AM) *

After I read your reply, I tried something stupid for the fun of it ...

I commented out :
AddHandler server-parsed .inc


I don't use that at all. Or is it required for virtual hosts (I don't use them either)?

QUOTE

If the main file extension is html or htm or shtml, who cares what the file extesion is for inclusions......


No I don't think you need to specify the included files' extensions (.inc etc), at least I haven't.

But there are some issues with running both SSI and PHP on the same parent file extension (say .html). Here's my very kludgy configuration:

Run PHP as default on .html extensions:

CODE
    AddType application/x-httpd-php .phtml .php .html .htm


Then make exceptions for SSI in some sub directories, using the Location directive:

CODE
    <Location /foo/ >
    AddType text/html .shtml .html .htm
    </Location>


Make SSI work in files with .asp extensions in any(?) directory with

CODE
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml .html .htm .asp


(not sure if that "AddType text/html .shtml" line is really necessary, but like I said it's a bit kludgy).
pandy
QUOTE
No I don't think you need to specify the included files' extensions (.inc etc), at least I haven't.


You do if you want them, too, to be parsed for SSI. If you just want them to be included you don't have to list them.
Dr Z
QUOTE(Christian J @ Sep 13 2006, 04:25 AM) *

QUOTE(Dr Z @ Sep 13 2006, 07:54 AM) *

After I read your reply, I tried something stupid for the fun of it ...

I commented out :
AddHandler server-parsed .inc


I don't use that at all. Or is it required for virtual hosts (I don't use them either)?

QUOTE

If the main file extension is html or htm or shtml, who cares what the file extesion is for inclusions......


No I don't think you need to specify the included files' extensions (.inc etc), at least I haven't.

But there are some issues with running both SSI and PHP on the same parent file extension (say .html). Here's my very kludgy configuration:

Run PHP as default on .html extensions:

CODE
    AddType application/x-httpd-php .phtml .php .html .htm


Thank you Pandy... I guess I must have been too tired last night and, threfore was in the state of confusion. Today after going over everything once more, it became relatively clear.

Yes, I do not nedd the inclusion files' extensions.

I intend was to use html extension for all files except php. In other words, if a html file needed to use "include", this would be implemented through SSI.

PHP files will need to have php extension, and the will be included as "AddType application".

Thanks again.

Then make exceptions for SSI in some sub directories, using the Location directive:

CODE
    <Location /foo/ >
    AddType text/html .shtml .html .htm
    </Location>


Make SSI work in files with .asp extensions in any(?) directory with

CODE
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml .html .htm .asp


(not sure if that "AddType text/html .shtml" line is really necessary, but like I said it's a bit kludgy).

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.