Chapter 24 . Running a Linux, Apache, MySQL, (Web hosting providers)
Chapter 24 . Running a Linux, Apache, MySQL, and PHP (LAMP) Server 665 Generally, it is a good idea to use only one type of these directives to avoid confusion. Of the three, Listen is the most flexible, so it is probably the one you want to use the most. A common error when using Listen is to specify a port on all IP addresses (*:80) as well as that same port on a specific IP address (1.2.3.4:80), which results in the error from make_sock. Configuration errors relating to SSL (discussed later in this chapter) commonly result in Apache not starting properly. Make sure all key and certificate files exist and that they are in the proper format (use openssl to examine them, as shown later in this chapter). For other error messages, try doing a Web search to see if somebody else has encountered the problem. In most cases, you can find a solution within the first few matches. If you aren t getting enough information in the ErrorLog, you can configure it to log more information using the LogLevel directive. The options available for this directive, in increasing order of verbosity, are emerg, alert, crit, error, warn, notice, info, and debug. Select only one of these. Any message that is at least as important as the LogLevel you select will be stored in the ErrorLog. On a typical server, this is set to warn. You should not set it to any lower than crit and should avoid leaving it set to debug because that can slow down the server and result in a very large ErrorLog. As a last resort, you can also try running apache manually to check for crashes or other error messages: # /usr/sbin/apache -d /etc/apache -F ; echo $? The -d flag tells apache where to look for its configuration file, and the -F flag tells it to run in the foreground. The semicolon separates this command from the echo command, which displays the return code ($?) from Apache after it exits. In the event that apache crashes during this step, you can use tools such as gdb and strace to trace the problem. Access Forbidden and Server Internal Errors Two common types of errors that you may encounter when attempting to view specific pages on your server are permission errors and server internal errors. Both types of errors can usually be isolated using the information in the error log. After making any of the changes described in the following list to attempt to solve one of these problems, try the request again and then check the error log to see if the message has changed (for example, to show that the operation completed successfully).
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.