31.1 Quick Start

With the help of this section, quickly set up and start Apache. You must be root to install and configure Apache.

31.1.1 Requirements

Make sure the following requirements are met before trying to set up the Apache Web server:

  1. The machine's network is configured properly. For more information about this topic, refer to Section 22.0, Basic Networking.

  2. The machine's exact system time is maintained by synchronizing with a time server. This is necessary because parts of the HTTP protocol depend on the correct time. See Section 24.0, Time Synchronization with NTP to learn more about this topic.

  3. The latest security updates are installed. If in doubt, run a YaST Online Update.

  4. The default Web server port (80) is opened in the firewall. For this, configure the SuSEFirewall2 to allow the service HTTP Server in the external zone. This can be done using YaST. See Section 15.4.1, Configuring the Firewall with YaST, (↑Security Guide) for details.

31.1.2 Installation

Apache on SUSE Linux Enterprise Server is not installed by default. To install it with a standard, predefined configuration that runs out of the box, proceed as follows:

Installing Apache with the Default Configuration

  1. Start YaST and select Software > Software Management.

  2. Choose Filter > Patterns and select Web and LAMP Server int Server Functions.

  3. Confirm the installation of the dependent packages to finish the installation process.

The installation includes the multiprocessing module apache2-prefork as well as the PHP5 module. Refer to Section 31.4, Installing, Activating, and Configuring Modules for more information about modules.

31.1.3 Start

You can start Apache automatically at boot time or start it manually.

Starting Apache Automatically

  1. To make sure that Apache is automatically started during boot in runlevels 3 and 5, execute the following command:

    chkconfig -a apache2
  2. Alternatively, start YaST and select System > System Services (Runlevel).

  3. Search for apache2 and Enable the service.

    The Web server starts immediately.

  4. Save your changes with Finish.

    The system is configured to automatically start Apache in runlevels 3 and 5 during boot.

For more information about the runlevels in SUSE Linux Enterprise Server and a description of the YaST runlevel editor, refer to Section 10.2.3, Configuring System Services (Runlevel) with YaST.

To manually start Apache using the shell, run rcapache2 start.

Checking if Apache is Running

If you do not receive error messages when starting Apache, this usually indicates that the Web server is running. To test this:

  1. Start a browser and open http://localhost/.

    If Apache is up and running, you get a test page stating It works!.

  2. If you do not see this page, refer to Section 31.9, Troubleshooting.

Now that the Web server is running, you can add your own documents, adjust the configuration according to your needs, or add functionality by installing modules.