Professional web hosting - 611Chapter 23Running a Linux, Apache, MySQL, and PHP

611Chapter 23Running a Linux, Apache, MySQL, and PHP (LAMP) ServerIf you aren t getting enough information in the ErrorLog, you can configure it to logmore information using the LogLeveldirective. The options available for this direc- tive, 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 importantas the LogLevelyou select will be stored in the ErrorLog. On a typical server, thisis set to warn. You should not set it to any lower than critand should avoid leav- ing it set to debugbecause that can slow down the server and result in a very largeErrorLog. As a last resort, you can also try running apachemanually to check for crashes orother error messages: # /usr/sbin/apache -d /etc/apache -F ; echo $? The -dflag tells apachewhere to look for its configuration file, and the -Fflag tellsit to run in the foreground. The semicolon separates this command from the echocommand, which will display the return code ($?) from Apache after it exits. In theevent that apachecrashes during this step, you can use tools such as gdbandstraceto trace the problem. Access Forbidden and Server Internal ErrorsThere are two common types of errors that you may encounter when attempting toview specific pages on your server: 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 below 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). File not found errors can be checked in the same way as access forbidden andserver internal errors. You may sometimes find that Apache is not looking whereyou think it is for a specific file. Generally, the entire path to the file shows up inthe error log. Make sure you are accessing the correct virtual host, and check forany Aliassettings that might be directing your location to a place you don texpect. A file permissions prevent access error indicates that the apacheprocess is run- ning as a user that is unable to open the requested file. Make sure that the accounthas execute permissions on the directory and every directory above it, as well asread permissions on the files themselves. Read permissions on a directory are alsonecessary if you want Apache to generate an index of files. See the manual page forchmodfor more information about how to view and change permissions. Note32_
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Leave a Reply