Startup Errors


This section explains a number of problems that may prevent Apache from starting and the error that you will receive for each.

Syntax Error

Syntax error on line xxx of /etc/httpd/httpd.conf:


Invalid command 'PiidFile', perhaps misspelled or defined by a module not included in the server configuration

A syntax error indicates that you have misspelled a directive (in this case, PidFile) in the configuration file or that you have included one or more directives used by a module that has not been added to the server. Check the syntax of the configuration file indicated in the error message. See Chapter 1 for details on using an <ifModule> directive to conditionally exclude directives so that the configuration file can still be processed when a module is not available.

Address Already in Use

"Address already in use: make_sock: could not bind to port"


An address already in use error means that another program is using the port Apache is trying to bind to. To solve the problem, either stop the program that is using that port before starting Apache, or edit the httpd.conf configuration file and change the port on which Apache will listen for requests by adjusting the values given after the Listen and Port directives.

In most cases an address already in use error happens because another Apache server is already running on your system or, in the case of Windows, an Internet Information Server or Microsoft Personal Web Server instance is running on the port Apache has been configured to use. Other popular programs, such as Skype, are also known to use port 80 on certain occasions.

Could Not Bind to Port

[Mon Jan 9 20:09:50 2005] [crit] (13)Permission denied: make_sock: could not bind to port 80


A could not bind to port error indicates that you do not have the necessary permissions to request that Apache bind to the port specified in the Apache configuration file. On Unix, only privileged users can bind to ports between 1 and 1024. To solve this problem, log in as root or issue the su command and try to start the server again. If you do not have root access, edit your httpd.conf file and change the port that Apache uses to a number greater than 1024.

Module Not Compatible

"module xxx is not compatible with this version of Apache"


A module not compatible error occurs when Apache tries to load a module that was compiled for a newer (or older) Apache server than the one currently installed. If you have the source code for the module, you may be able to recompile it using your current Apache installation, as shown in Chapter 1. If you do not have source code for or are unable to recompile a module whose functionality is essential to you, upgrade (or downgrade) your Apache server to a version compatible with the module.

Name Resolution

"Cannot determine hostname"


Several Apache directives, including ServerName and Listen, accept hostnames as arguments. However, if Apache is not able to resolve a supplied hostname to an IP address at startup time using the Domain Name Service (DNS) or your system's host list, you will receive the cannot determine hostname error. To solve the problem, verify your DNS and /etc/hosts settings and the spellings of hostnames supplied in httpd.conf. Whenever possible, use IP addresses for directives such as Listen and <VirtualHost> instead of hostnames.

Cannot Open Log or Configuration File

(13)Permission denied: httpd: could not open error log file /usr/local/apache/logs/error_log.


A permission denied error indicates that you do not have sufficient permissions either to read the Apache configuration file(s) or to write to the Apache log files.

This problem often happens when Apache is launched by a different user than the one who built and installed it. Either start Apache as superuser or as the user that installed it, or, if you have sufficient permission to do so, use chmod to change ownership of the file named in the error message.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

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