Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Trouble enabling SSI in Apache/2.2.6 (Win32) - ALL SET! |
|
Author |
|
memnoch
Joined: 01 Jan 2008 Posts: 8
|
Posted: Tue 01 Jan '08 22:15 Post subject: Trouble enabling SSI in Apache/2.2.6 (Win32) - ALL SET! |
|
|
Hello Fellow Apacherians,
This is a newbie question....thanks for any assistance you could give.
I have Apache/2.2.6 (Win32) installed on XP, and I'm trying to enable SSI but running into trouble. Here's what I have:
- mod_include.so *is* in the modules directory
- in httpd.conf I have:
Code: | LoadModule include_module modules/mod_include.so
DocumentRoot "C:/Apache2/htdocs"
<Directory "C:/Apache2/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 Indexes FollowSymLinks
#
# 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 None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
# Lines below added by memnoch to enable SSI
Options Indexes FollowSymLinks Includes
AddHandler server-parsed .shtml
</Directory> |
When I restart apache after this, it is seemingly unable to load anything at all. I get "The page cannot be displayed", and in the error log I get:
Code: | [Tue Jan 01 14:59:47 2008] [crit] (OS 10106)The requested service provider could not be loaded or initialized. : alloc_listener: failed to get a socket for (null)
Syntax error on line 53 of C:/Apache2/conf/httpd.conf:
Listen setup failed
[Tue Jan 01 14:59:47 2008] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting. |
If I look on line 53 of httpd.conf (line 53 is the "Listen 80" line below), I see:
Code: | # Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80 |
The above line is obviously the default setting, so I don't see why there would be a syntax error as a result of the other settings.
NOTE: the above problem occurs only when I have added the lines in httpd.conf to enable SSI. If I comment them out, Apache works fine.
So, I'm wondering what I should do to resolve this problem and enable SSI.
Some other questions:
- Am I correct that with the "AddHandler" directive in the <Directory "C:/Apache2/htdocs"> container *should* enable SSI for *all* .shtml files in C:/Apache2/htdocs and subdirectories?
- Is there anything else I need to do, such as grant "Everyone" read/execute permissions on the .shtml files?
- The SSI lines specify virtual files in other directories, for example:
Code: | <!--#include virtual="/includes/hu.txt" -->
<!--#fsize virtual="/images/hu.gif" --> |
Are there restrictions on where the included virtual files may reside, or can they be anywhere? Anything else I need to do with the files?
Thank you so much for any assistance you can give.
memnoch
Last edited by memnoch on Thu 03 Jan '08 14:49; edited 4 times in total |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 02 Jan '08 4:35 Post subject: |
|
|
You have something else listening on port 80 ... maybe IIS? |
|
Back to top |
|
memnoch
Joined: 01 Jan 2008 Posts: 8
|
Posted: Wed 02 Jan '08 14:54 Post subject: Re: Trouble enabling SSI in Apache/2.2.6 (Win32) |
|
|
Thanks glsmith....I forgot to mention (now updated above) that the above problem occurs only when I have added the indicated lines in httpd.conf to enable SSI. If I comment them out, Apache works fine. So, I don't think it's due to using port 80. Any other ideas? |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Wed 02 Jan '08 16:40 Post subject: |
|
|
It is very odd that when you enable SSI (which has nothing to do with sockets) you get symptoms of Winsock2 corruption, like the kind described here.
Some things you could try:* Open the Windows Task Manager [Ctrl-Shift-Esc] "Processes" tab and check that there are no httpd processes running before you start Apache.
* Comment out any LoadModule directives that you don't need (especially any 3rd-party modules) - in case the problem is insufficient memory or memory address conflicts.
* Remove your AddHandler directive and use these directives instead: Code: | AddType text/html .shtml
AddOutputFilter INCLUDES .shtml |
* Add the Win32DisableAcceptEx directive to your httpd.conf file - in case you have some 3rd-party network software which interferes with the Windows AcceptEx function. I hope one of these suggestions helps.
-tom- |
|
Back to top |
|
memnoch
Joined: 01 Jan 2008 Posts: 8
|
Posted: Wed 02 Jan '08 17:36 Post subject: |
|
|
Thanks Tom....that seems to have helped. Here's what I found:
- There were no httpd processes running before I started Apache.
- The only LoadModules enabled, aside from what comes enabled by default, was for mod_per:
LoadFile "C:/Perl/bin/perl58.dll"
LoadModule perl_module modules/mod_perl.so
which had worked fine without SSI anyway.
- I replaced my AddHandler with the directives you specified, and restarted Apache....it seems to work now.
- I haven't done anything yet with Win32DisableAcceptEx yet.
I have done some more testing and see that even with your changes, I started getting the same error again. It seems that if Apache is UP and I run "httpd -k restart", I get the error. But if instead I run "httpd -k stop" followed by "httpd -k start", it works fine. Any comments?
I also see that I had been looking at the Apache 1.3 documentation when I added the AddHandler directive. I now see that the 2.2 documentation has the directives you mentioned.
One other question, though. The httpd.conf file also has the following has the AddType and AddOutputFilter directives inside of the <IfModule mime_module> container. Right now, I have those commented out, and the have them enabled in the <Directory "C:/Apache2/htdocs"> container...does this matter?
Thank you very much!
memnoch |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Wed 02 Jan '08 18:16 Post subject: |
|
|
I have also noticed that Apache 2.2.6 can not do a graceful restart when mod_perl is loaded. "httpd -k stop" followed by "httpd -k start" is the way to go until this gets fixed.
I found a coding error in mod_perl and reported a bug (and proposed patch) to the mod_perl list here. Coincidentally, this was just a few days ago.
re: "inside of the <IfModule mime_module> container"
The only advantage to putting these directives inside a <IfModule mime_module> container is that if you remove (or comment out) the LoadModule for mod_mime, these statements will be skipped - so you don't need to remove them too. Not a big advantage unless you think you will be enabling/disabling SSI frequently.
FYI - You can put the <IfModule mime_module>...</IfModule> container inside your <Directory "C:/Apache2/htdocs">...</Directory> container if you want to.
-tom- |
|
Back to top |
|
memnoch
Joined: 01 Jan 2008 Posts: 8
|
Posted: Wed 02 Jan '08 18:24 Post subject: |
|
|
Tom...thank you so much....I'm glad you had found that mod_perl defect!
memnoch |
|
Back to top |
|
|
|
|
|
|