Page 238 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 238

Network Operating Systems-I




                    notes          If you did not do a binary install, Apache will in some situation complain about the missing
                                   registry key. This warning can be ignored if the server was otherwise able to find its configuration
                                   file.
                                   The value of this key is the ServerRoot directory which consist the conf subdirectory. When
                                   Apache starts it reads the httpd.conf file from that directory. If this file contains a ServerRoot
                                   directive which contains a different directory from the one obtained from the registry key above,
                                   Apache  will  forget  the  registry  key  and  use  the  directory  from  the  configuration  file.  If  you
                                   copy the Apache directory or configuration files to a new location it is vital that you update the
                                   ServerRoot directive in the httpd.conf file to reflect the new location.




                                      Task     Describe the various ways of specifying configuration file on the command
                                     line.

                                   running apache as a service

                                   Apache can be run as a service on Windows NT. There is some highly experimental support for
                                   related behavior on Windows 9x.You can install Apache as a service automatically during the
                                   installation. If you chose to install for all users, the installation will make an Apache service for
                                   you. If you specify to install for yourself only, you can manually register Apache as a service after
                                   the installation. You have to be a member of the Administrators group for the service installation
                                   to succeed.
                                   To be able to manage an Apache service with the monitor, you have to first install the service
                                   (either automatically via the installation or manually).
                                   You can install Apache as a Windows NT service as follows from the command prompt at the
                                   Apache bin subdirectory:

                                   httpd -k install
                                   If you need to specify the name of the service you wish to install, use the following command. You
                                   have to do this if you have several different service installations of Apache on your computer.

                                   httpd -k install -n “MyServiceName”
                                   If you need to have specially named configuration files for different services, you must use this:

                                   httpd -k install -n “MyServiceName” -f “c:\files\my.conf”
                                   If you use the first command without any special parameters except -k install, the service will be
                                   called Apache2 and the configuration will be understood to be conf\httpd.conf.
                                   Removing an Apache service is easy. Just use:

                                   httpd -k uninstall
                                   The specific Apache service to be uninstalled can be specified by using:

                                   httpd -k uninstall -n “MyServiceName”
                                   Normal starting, restarting and shutting down of an Apache service is generally done via the
                                   Apache Service Monitor, by using commands like NET START Apache2 and NET STOP Apache2
                                   or via normal Windows service management. Before starting Apache as a service by any means,
                                   you should test the service’s configuration file by using:
                                   httpd -n “MyServiceName” -t






          232                              LoveLy professionaL university
   233   234   235   236   237   238   239   240   241   242   243