Page 233 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 233

Unit 12: Server Role: Linux as Web Server




          Running Apache by means of a terminal window is good for debugging, though it blocks that   notes
          shell. You can, certainly, type Ctrl+C to kill that job, but in that case Apache won’t exit cleanly.
          Ideally, you should open another command window and cd to the Apache directory, then run
          the command:
          apache -k shutdown
          If you are running an edition of Windows that supports services, for example Windows NT or
          Windows 2000, you can install Apache as a service using the following command:

          apache -d path_to_apache -i
          In the above example, the path_to_apache variable should be replaced by the path to your Apache
          directory. Thus, if you accepted the defaults in your install, this command will appear like:

          apache -d C:\lyris\apache -i
          If you would like to uninstall the Apache service, run the following command:
          apache -u
          If the Apache service is installed, and you want to rapidly start and stop it without using the
          “Services”  applet,  you  can  use  the  “net”  utility  given  by  Windows.  The  syntax  of  the  “net”
          command, with respect to stopping and starting services, is:
          net [stop | start] apache




             Note     Most of the Apache configuration features are cross platform. That means that
             if you make a modification to Apache on Linux, that same adjustment, or one extremely
             similar, is available on other various flavors of Linux using the same syntax!

          12.4 Configuring your Server for Apache

          Once you’ve got the files, you need to tell your machine where to find everything by configuring
          the source files. The easiest way is to believe all the defaults and just type:
          ./configure
          Of course, most people don’t want to accept just the default choices. The most significant option is
          the prefix=PREFIX option. This specifies the directory where the Apache files will be installed.
          You can also set specific environment variables and modules. Some of the modules I like to have
          installed include:
          mod_alias - to map different parts of the URL tree
          mod_include - to parse Server Side Includes
          mod_mime - to associate file extensions with its MIME-type
          mod_rewrite - to rewrite URLs on the fly
          mod_speling (sic) - to help your readers who might misspell URLs
          mod_ssl - to allow for strong cryptography using SSL
          mod_userdir - to allow system users to have their own web page directories












                                           LoveLy professionaL university                                   227
   228   229   230   231   232   233   234   235   236   237   238