SSI not working - Apache under Windows |
SSI not working - Apache under Windows |
Dr Z |
Sep 12 2006, 07:12 PM
Post
#1
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
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 |
Sep 12 2006, 08:27 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
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 |
Sep 12 2006, 10:08 PM
Post
#3
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
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 |
Sep 12 2006, 10:46 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
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. I have this. AddType text/html .shtml AddHandler server-parsed .shtml .html .inc |
pandy |
Sep 12 2006, 10:48 PM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Come on! That isn't a bad word in this context!
I did *not* say the F word. I said the S word. Like in a S-driver. Dumb board - go beeping on me. |
Dr Z |
Sep 12 2006, 11:31 PM
Post
#6
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
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. 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 |
Sep 12 2006, 11:56 PM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I think your *beep* server is *beep* *beep* *beep*!
|
Dr Z |
Sep 13 2006, 12:54 AM
Post
#8
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
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. 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 |
Sep 13 2006, 06:25 AM
Post
#9
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
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 |
Sep 13 2006, 08:43 AM
Post
#10
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
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 |
Sep 13 2006, 07:52 PM
Post
#11
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
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). |
Lo-Fi Version | Time is now: 24th April 2024 - 06:26 AM |