609Chapter 23Running (Web server certificate) a Linux, Apache, MySQL, and PHP

609Chapter 23Running a Linux, Apache, MySQL, and PHP (LAMP) ServerThis section refers to the Apache HTTPD binary as apache, which is what it isnamed on Debian systems. However, in most other distributions, the binary isnamed httpd. On different systems, you may need to substitute httpdfor apachewhen it appears by itself, although not for commands such as apachectl. Configuration ErrorsYou may occasionally run into configuration errors or script problems that preventApache from starting or that prevent specific files from being accessible. Most ofthese problems can be isolated and resolved using two Apache-provided tools: theapachectlprogram and the system error log. When encountering a problem, first use the apachectlprogram with the configtestparameter to test the configuration. In fact, it s a good idea to develop the habit ofrunning this every time you make a configuration change: # apachectl configtestSyntax OK# apachectl graceful/usr/sbin/apachectl graceful: httpd gracefully restartedIn the event of a syntax error, apachectlindicates where the error occurs and alsodoes its best to give a hint about the nature of the problem. You can then use thegracefulrestart option (apachectl graceful) to instruct Apache to reload itsconfiguration without disconnecting any active clients. The gracefulrestart option in apachectlautomatically tests the configurationbefore sending the reload signal to apache, but it is still a good idea to get in thehabit of running the manual configuration test after making any configurationchanges. Some configuration problems pass the syntax tests performed by apachectl, butthen result in the HTTP daemon exiting immediately after reloading its configura- tion. If this happens, use the tailcommand to check Apache s error log for usefulinformation. On Debian systems, the error log is in /var/log/apache/error.log. On other systems, the location can be found by looking for the ErrorLogdirectivein your Apache configuration. One of the more commonly encountered errors looks something like this: [crit] (98)Address already in use: make_sock: could not bind to port 80This error often indicates that something else is bound to port 80 (not very commonunless you have attempted to install another Web server), that another Apache process is already running (apachectlusually catches this), or that you have toldApache to bind the same IP address and port combination in more than one place. NoteNote32_
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply