Install a Basic Apache Web Server

To set up a basic Apache web server, you need to do the following:

■ Install the Required Software Packages

■ Start and Test the Web Server

■ Locate the DocumentRoot of the Web Server

Install the Required Software Packages

To run a basic Apache web server, you need to install the following packages with YaST:

■ apache2. The basic web server software.

■ apache2-prefork. An additional Apache package that influences the multiprocessing behavior of the web server.

■ apache2-example-pages. Sample HTML pages.

When you install the packages listed above, YaST prompts you to also install one or more additional packages required by Apache. Confirm the additional package installation by selecting OK to resolve all dependencies of the Apache packages.

Start and Test the Web Server

After installing the required software, you need to start the web server. Do this as the root user by entering the following:

rcapache2 start

As with all services, enter the following to stop the web server:

rcapache2 stop

1 HARDCOPY PERMITTED-NO DISTRIBUTION ALLOWED

If you want the web server to start up at boot time, you need to enter the following:

insserv apache2

To test whether the web server is properly installed, open a web browser and enter the following address:

The browser displays the following page:

Figure 6-4

Figure 6-4

If your SUSE Linux Enterprise Server 10 is connected to a network, you (and other hosts on the network) can remotely access the web server by entering the following:

http://your_system_IP_address/

If your network provides a DNS server, you can use the hostname instead of the IP address.

1 HARDCOPY PERMITTED-NO DISTRIBUTION ALLOWED

Locate the DocumentRoot of the Web Server

The default directory of the data provided by Apache is /srv/www/htdocs/.

This directory is also called the DocumentRoot of the web server. After the installation, it contains the Apache example pages, which are displayed above.

You can replace the data in the DocumentRoot directory to display your own web server content. Because the web server runs with the user id wwwrun, you have to make sure that this user has read access to files in the DocumentRoot directory.

If you create subdirectories in DocumentRoot, you can access those subdirectories with the following web address scheme:

http://your_server/name_of_subdirectory

If no specific file is requested in the address, Apache looks for a file with the name index.html. You can change the name of this default file in the Apache configuration files.

1 HARDCOPY PERMITTED-NO DISTRIBUTION ALLOWED

Was this article helpful?

0 0

Post a comment