Apache
  Home arrow Apache arrow Page 13 - Getting Started with Apache
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
APACHE

Getting Started with Apache
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 16
    2004-12-13


    Table of Contents:
  • Getting Started with Apache
  • Installing Apache
  • Installing Apache from Binary Distribution
  • Installing Apache from Prebuilt Packages
  • Installing Apache by Hand
  • Upgrading Apache
  • Basic Configuration
  • Administrator’s E-Mail Address
  • Starting, Stopping, and Restarting the Server
  • Generic Invocation Options
  • Windows-Specific Invocation Options
  • Testing the Server
  • Testing the Server Configuration Without Starting It
  • Using Graphical Configuration Tools

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Getting Started with Apache - Testing the Server Configuration Without Starting It
    ( Page 13 of 14 )

    If you want to check that Apache’s configuration is valid without actually starting the server, you can do so by passing the server executable the -t option. The following uses a Unix installation path as an example:

    $ /usr/local/apache/bin/httpd -t

    This will report any problems with the configuration or return a “Syntax OK” message if all is well. If you included any directories into the configuration, then you’ll also get a list of the configuration files Apache found and processed. The document roots of the primary server and any virtual hosts you have created are also checked, and a warning is issued in each case if the associated directory is not present. You can disable this check by using the -T option, which is in all other respects identical to -t:

    $ /usr/local/apache/bin/httpd -T

    You can also use apachectl, which will test the configuration inclusive of document root checks using the configtest mode:

    $ apachectl configtest

    To test a Windows service configuration, use the -t or -T options in conjunction with -n:

    c:\> apache -n Apache2 -t

    This is just a convenience wrapper around a call to the server executable using -t; in a default installation, it’s identical to the first command given previously. If you want to change it to -T or add a corresponding configtestnoroot mode, then it’s simple to adapt apachectl accordingly.

    Windows installations performed by the installer additionally create a menu item to test the configuration.

    Getting the Server Status from the Command Line

    If you have mod_status configured into the server, you can also test it from the command line using apachectl and the status or fullstatus options. These extract a status report from the server:

    $ apachectl status

    or for a full status report (note that this option is called extendedstatus in earlier versions of apachectl):

    $ apachectl fullstatus

    Nice though this seems, it’s really just a wrapper around a conventional HTTP request that you might equally have made with a browser or a telnet command. As such, it will work only if apachectl is configured to point to a URL that will return a status page. If you have modified how and where a status page is delivered, you’ll need to modify apachectl. In addition, apachectl uses an external program, by default the text-only Lynx browser, to actually do the work, so the fullstatus option is actually equivalent (on a default Unix installation where the port is set to 80 with Listen or Port) to the following:

    lynx -dump http://localhost:80/server-status

    This is actually what the default Apache configuration responds to, so out of the box it should work (so long as you have Lynx actually installed, of course). In addition, if you build Apache with a different initial configuration—for instance, a different default listening port or a different name for the server binary—then apachectl will be installed with that port number or server name preset in the program.

    It’s entirely possible and actually easy to extend apachectl to produce other kinds of test reports, for instance, adding the apachectl info command to retrieve the information page produced by mod_info. You just need to add a clause for info and maybe add an INFOURL constant at the top of the program. After viewing the apachectl script in an editor, the changes to make should be self-evident. Given time, it’s possible and quite appealing to turn apachectl into a custom Web server tuning and monitoring tool. 

    This chapter is from Pro Apache by Peter Wainwright. (Apress, 2004, ISBN: 1590593006). Check it out at your favorite bookstore today. Buy this book now.

     



     
     
    >>> More Apache Articles          >>> More By Apress Publishing
     

       

    APACHE ARTICLES

    - Creating a VAMP (Vista, Apache, MySQL, PHP) ...
    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek