B.4 Common Problems on Windows

Windows has its own distinct set of problem areas that don't apply to Unixish environments.

B.4.1 Cannot Determine Hostname

When trying to start Apache from a DOS window, you receive a message like "Cannot determine hostname. Use ServerName directive to set it manually."

If you don't explicitly supply Apache with a name for your system, it tries to figure it out. This message is the result of that process failing.

The cure for this is really quite simple: edit your conf\httpd.conf file, look for the string ServerName, and make sure there's an uncommented directive such as:

ServerName localhost

or:

ServerName www.foo.com

in the file. Correct it if there is one there with wrong information, or add one if you don't already have one.

Also, make sure that your Windows system has DNS enabled. See the TCP/IP setup component of the Networking or Internet Options control panel.

After verifying that DNS is enabled and that you have a valid hostname in your ServerName directive, try to start the server again.

B.4.2 Finding WS2_32.DLL on Windows

When trying to start Apache on Windows 95, a message like Unable To Locate WS2_32.DLL... appears. This file is necessary for Apache to function properly.

Prior to Version 1.3.9, Apache for Windows used Winsock 1.1. Beginning with Version 1.3.9, Apache began using Winsock 2 features (specifically, WSADuplicateSocket( )). WS2_32.DLL implements the Winsock 2 API. Winsock 2 ships with Windows NT 4.0 and Windows 98. Some of the earlier releases of Windows 95 did not include Winsock 2.

To fix it, install Winsock 2, available at http://www.microsoft.com/windows95/downloads/. Then restart your server, and the problem should be gone.

B.4.3 Fixing WSADuplicateSocket Errors

If, when trying to start Apache on Windows, it fails and the Apache error log contains this message:

[crit] (10045) The attempted operation is not supported for the type of object  referenced: Parent: WSADuplicateSocket failed for socket ###

it indicates that your system is using a firewall product that has inserted itself into the network software but doesn't fully provide all the functionality of the native network calls.

To get rid of the problem, you need to reconfigure, disable, or remove the firewall product that is running on the same box as the Apache server.

This problem has been seen when Apache is run on systems along with Virtual Private Networking (VPN) clients such as Aventail Connect. Aventail Connect is a Layered Service Provider (LSP) that inserts itself, as a shim, between the Winsock 2 API and Windows' native Winsock 2 implementation. The Aventail Connect shim does not implement WSADuplicateSocket, which is the cause of the failure.

The shim is not unloaded when Aventail Connect is shut down. Once observed, the problem persists until the shim is either explicitly unloaded or the machine is rebooted.

Another potential solution (not tested) is to add apache.exe to the Aventail Connect exclusion list (see below).

Apache is affected in a similar way by any firewall program that isn't correctly configured. Assure you exclude your Apache server ports (usually port 80) from the list of ports to block. Refer to your firewall program's documentation for the how-to.

Relevant information specific to Aventail Connect can be found at How to Add an Application to Aventail Connect's Application Exclusion List at http://support.aventail.com/akb/article00586.html.

B.4.4 Handling System Error 1067

Sometimes, when starting Apache on Windows, you might get a message like "System error 1067 has occurred. The process terminated unexpectedly." This unfortunately uninformative message means that the Web server was unable to start correctly as a service for one reason or another.

As with any error, the first step should be to check your Apache error log. If that doesn't reveal anything useful, try checking the Windows application event log to find out why Apache won't start. If that doesn't help, try:

D:\>c: C:\>cd "\Program Files\Apache Group\Apache" C:\Program Files\Apache Group\Apache>apache

(If you don't get the prompt back, hit Ctrl-C to cause Apache to exit.)

This will run Apache interactively rather than as a service; any error messages should show up on your screen rather than being concealed behind a System Error 1067 alert box.



Apache Cookbook
Apache Cookbook: Solutions and Examples for Apache Administrators
ISBN: 0596529945
EAN: 2147483647
Year: 2006
Pages: 215

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net