With a share of more than 70%, the Apache HTTP Server (Apache) is the world's most widely-used Web server according to the November 2005 Survey from http://www.netcraft.com/. Apache, developed by the Apache Software Foundation (http://www.apache.org/), is available for most operating systems. openSUSE™ includes Apache version 2.2. In this chapter, learn how to install, configure and set up a Web server; how to use SSL, CGI, and additional modules; and how to troubleshoot Apache.
With the help of this section, quickly set up and start Apache.
time. You must be
root to install and configure Apache.
Make sure that the following requirements are met before trying to set up the Apache Web server:
The machine's network is configured properly. For more information about this topic, refer to Chapter 21, Basic Networking.
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 Chapter 25, Time Synchronization with NTP to learn more about this topic.
The latest security updates are installed. If in doubt, run a YaST Online Update.
The default Web server port (port 80) is opened in the firewall. For this, configure the SUSEFirewall2 to allow the service Section 37.4.1, “Configuring the Firewall with YaST” gives details.in the external zone. This can be done using YaST.
Apache on openSUSE is not installed by default. To install it, start YaST and select+ . Now choose + and select under . Confirm the installation of the dependent packages to finish the installation process.
Apache is installed with a standard, predefined
configuration that runs “out of the box”. The installation
includes the multiprocessing module
apache2-prefork as well the PHP5 module. Refer
to Section 32.4, “Installing, Activating, and Configuring Modules” for more information about
To start Apache and make sure that it is automatically started during boot, start YaST and select Section 13.2.3, “Configuring System Services (Runlevel) with YaST”.+ . Search for and the service. The Web server starts immediately. By saving your changes with , the system is configured to automatically start Apache in runlevels 3 and 5 during boot. For more information about the runlevels in openSUSE and a description of the YaST runlevel editor, refer to
To start Apache using the shell, run rcapache2 start. To make sure that Apache is automatically started during boot in runlevels 3 and 5, use chkconfig -a apache2.
If you have not received error messages when starting Apache, the Web server should be running now. Start a browser and open http://localhost/. You should see an Apache test page starting with “If you can see this, it means that the installation of the Apache Web server software on this system was successful.” If you do not see this page, refer to Section 32.8, “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.