3.1 Starting and Stopping Apache

After it is installed, Apache runs constantly, listening for and accepting requests. It starts automatically each time you restart the server.

When you stop Apache, all threads that are currently running are allowed to finish. Therefore, it might take a few seconds for Apache to complete its shutdown process and for the status to change to Down.The apache.nlm itself does not shut down, just the worker threads, so Apache restarts very quickly.

You can start and stop Apache using Apache Manager or the NetWare® system console.

3.1.1 Starting and Stopping Apache in Apache Manager

The Server Status page includes the capability of starting, restarting, and stopping Apache.

  1. Click Start Server or Stop Server.

    If the Apache Web server is already running, the Start Server button reads Restart Server. Click Restart Server to have it shut down and then start up again.

IMPORTANT:If you run Apache Manager in eDirectory™ mode, as described in Switching between File Mode and eDirectory Mode, you cannot verify whether Apache is running on the Server Status page. To verify whether Apache server is running in eDirectory mode, you must do so from the system console by listing the current screens or from a Web browser by viewing any URL typically displayed by the Web server. If you are able to view your Web content, Apache is running.

To easily restart multiple servers at once, you can use the Server Status page in the Multiple Apache Server interface, as described in Section 6.9, Checking the Status of Each Web Server.

3.1.2 Starting and Stopping Apache at the Server Console

To start Apache at the server console:

  1. Enter the following command:

    ap2webup

    This loads Apache into the operating system (OS) address space.

    or

    If you want to load Apache into protected address space, enter the following command:

    load address space = apache2 apache2

    This command loads the Apache NLM™ program (apache2.nlm) into an address space named apache2.

    After Apache starts, it listens on port 80 for requests from client Web browsers, unless you changed the Listen directive in the configuration files, as described in Section 3.8, Managing Listen Ports.

  2. After Apache is started, access the Apache home page:

    1. Open a Web browser either from the NetWare GUI or from a client computer in your network.

    2. Enter the URL of your Apache Web server, which can be either an IP address or a DNS name. For example:

      
      http://myserver.mycompany.com
      
      

      or

      
      http://172.16.5.18
      
      

      By default, Apache displays the index.html file in the volume:/apache2/htdocs directory, which is the directory defined by default as the root Web directory. When NetWare is first installed, the index.html file redirects you to the OES Welcome page.

      OES Welcome page

      If the index.html file is not found, Apache next tries to display a file named index.html.language_code, where language_code is a two-letter extension. If there is no response from Apache, look in the volume:/apache2/logs/error_log file for details.

  3. Replace the content in the index.html file or language-specific version with your own home page content.

    After Apache is running correctly, you can make changes to its default configuration by editing the files in the /apache2/conf directory if you prefer editing text files to using Apache Manager.

To stop Apache at the server console:

  1. To unload Apache running in the OS address space, enter the following command:

    ap2webdn

    or

    If Apache is running in a protected address space, specify the address space in the unload statement. For example:

    unload address space = apache2 apache2

    apache2 shutdown -p apache2

    Using either of these commands unloads the Apache NLM program (apache2.nlm) from an address space named apache2.

To display a list of command line options for the apache2 command, enter apache2 help when Apache is running. When Apache is not running, enter apache2 -h.

Running Additional Instances of Apache Simultaneously

You can run multiple instances of Apache concurrently on NetWare by loading each additional instance into its own protected address space.

To do so, each additional instance must have its own address space name. For example:


load address space = apache3 apache2


load address space = apache4 apache2

Using the examples above would create two additional instances of Apache with the unique address space names of apache3 and apache4.

However, each instance of Apache must have its own separate httpd.conf file where unique ports, error and access log filenames can be specified. Using the same configuration file for multiple instances of Apaches causes various errors, including port conflicts. Therefore, the load command must include the full pathname of the httpd.conf file for each instance:


load address space = instance apache2 -f \directory\httpd.conf

where instance represents either apache3 or apache4 from the previous example and directory represents the full path to the httpd.conf file.

Starting or Stopping the Administration Instance of Apache

To start the Apache Admin server, enter admsrvup at the system console. To stop the Apache Admin server, enter admsrvdn.

Verifying Server Status from the NetWare Console

The following command line directives can be used at the system console to modify or display information about Apache:

Table 3-1 Display Apache Information

Directive

Effect

DIRECTIVES

Displays a list of all available directives.

MODULES

Displays a list of loaded modules, both built-in and external.

RESTART

Instructs Apache to terminate all running worker threads as they become idle, reread the configuration file, then restart each worker thread based on the new configuration.

SETTINGS

Enables or disables the thread status display on the console. When enabled, the number of threads currently running is displayed along with the status of each thread.

SHUTDOWN

Terminates the running instance of the Apache Web server.

VERSION

Displays version information about the currently running instance of Apache.

IMPORTANT:At the NetWare console prompt, each directive must be preceded by apache2, as in servername:apache2 directive. Also, Apache must be running. (See Starting and Stopping Apache at the Server Console.)