Main page 1. Network scanning 2. Knowledge gathering 3. Advice Database browsing
#Title
0IPv6 configuration of network interfaces and domain name resolution under RedHat Linux
1IPv6 configuration of network interfaces and domain name resolution under Debian Linux
2The installation and configuration of Postfix server on Linux
3The installation and configuration of Dovecot on Linux
4The installation and configuration of Apache HTTP Server on Debian Linux
5The installation and configuration of Sendmail on Linux
6IPv6 support in Linux
7The IPv6 routing configuration in RedHat Linux system
8The Instalation and configuration of Apache HTTP Server under RedHat Linux
9Instalation and configuration Postfix on Suse
<<
>>

Advice
Knowledge

The Instalation and configuration of Apache HTTP Server under RedHat Linux

The instalation from a repository
The installation from source code
The Apache HTTP Server verification
The distinction of Apache HTTP Server installation type (repo or source code)
The configuration of Apache HTTP Server installed from repository
The configuration of Apache HTTP Server installed from source code
The verification if Apache is working poperly
 
There are 2 ways of installation Apache HTTP Server under Linux. The first one is the installation using distribution repositories and the second is the installation from latest source code from Apache vendor's website.
Each method of the installation requires administrator privileges.
The installation from source code is described in Apache documentation.
The installation from repository (special designed packages for specific linux distribution) is prepared by developers of concrete distribution. The installation from a package is not described on the official Apache documentation. However there are many documents in the Internet that describe certain package installation on almost every linux distribution. Every repository package is well adjusted for operating system (e.g. directory hierarchy).
 
The installation from a repository
To install the Apache HTTP Server from the repository, enter the following command in the command line:
yum install httpd
 
The installation from source code
For proper installation there are required:
  • C++ compilator
  • make utility.
In the beginning there is a need of downloading Apache HTTP Server from http://httpd.apache.org/download.cgi
After downloading the file, unzip it by entering the following command:
tar xvf httpd-VERSION_NUMBER.tar.gz
where VERSION_NUMBER stands for the version of downloaded Apache HTTP Server.
 
Enter to the http-VERSION_NUMBER directory by typing the command:
cd httpd-VERSION_NUMBER/
 
The next step is preparing the configuration files to a compilation. It is done by the following command:
./configure –prefix=PREFIX
where PREFIX is a path where the Apache HTTP Server should be installed .
 
Then compile the Apache HTTP Server by typing the command:
make
 
The last step is a final installation of an application by using the command:
make install
 
To check which version of Apache HTTP Server is installed execute the following commands in the command line:
apachectl=`find / -name apachectl -type f | grep bin/apachectl`
$apachectl -v
 
Figure 1. Displaying installed version of Apache HTTP Server
 
Aby dowiedzieć się, którą wersję instalacyjną się posiada wystarczy wprowadzić polecenie:
yum list httpd
 
As a resault there should be displayed a httpd package available in repository. If a line, which decribes a package, is under the "Installed Packages" words, that means Apache HTTP Server is installed from a repository. If Apache HTTP Server is installed from source code, there should line "Available Packages".

The configuration of Apache HTTP Server installed from repository
The version installed from a repository is in /etc/httpd directory. There are the configuration files.
 
At the beginning there is a need of verification if Apache HTTP Server is listening on all IP addresses or only on some of them. It can be checked by viewing /etc/httpd/conf/httpd.conf file and searching lines with the key word "listen". The file can be displayed by a command:
cat /etc/httpd/conf/httpd.conf
 
Here are sample options for listening on port number 80:
•         Listen 80 – an application server is listening on all IP addresses assigned to network interfaces on port nember 80 (this is default configuration)
•         Listen 192.168.0.2:80 – an application server is listening only on IPv4 address 192.168.0.2 on port nember 80
•         Listen [2001:db8::2]:80 – an application server is listening only on IPv6 address 2001:db8::2 on port number 80
 
For listening in Dual Stack: if there is listen entry only for IPv4 addresses, there is a need of adding IPv6 addresses in httpd.conf file.
For listening in Native IPv6: if there is listen entry for IPv4 addresses, there is a need of replacing that addresses by IPv6 ones in httpd.conf file.
 
To add, modify or check such IP addresses, there is a need o finding the lines with key word "VirtualHost". That line are usualy at the end of httpd.conf file.
 
The IP addresses, by which there should be an access for each website, are contained in <VirtualHost> directive.
 
Here are example options for websites availability:
•         <VirtualHost *:80> - a website is available on all IP addresses assigned to network interfaces on port number 80
•         <VirtualHost 192.168.0.2:80> - a website is available only on IPv4 address 192.168.0.2 on port number 80
•         <VirtualHost [2001:db8::2]:80> - a website is available only on IPv6 address 2001:db8::2 on port number 80
•         <VitrualHost 192.168.0.2:80 [2001:db8::2]:80> - a website is available on specified IPv4 and IPv6 addresses on port number 80
 
In VirtualHost configuration there is no need of specifying a port - this is optional.
Figure 2 shows a sample configuration of VirtualHost for website available on IPv4 and IPv6 addresses.
 
Figure 2. A sample VirtualHost configuration for listening on IPv4 and IPv6 addresses
 
After changing the configuration, there must be a restart of Apache application:
/etc/init.d/httpd restart
 
The configuration of Apache HTTP Server installed from source code
Before attempting any operations related to viewing or modify the Apache configuration, the path where Apache has its configuration files must be located.
 
The Apache HTTP Server configuration files path can be found by a command:
find / -name httpd.conf
 
At the beginning there is a need of verification if Apache HTTP Server is listening on all IP addresses or only on some of them. It can be checked by viewing httpd.conf and finding lines with the key word "listen".
 
Here are sample options for listening on port number 80:
•         Listen 80 – an application server is listening on all IP addresses assigned to network interfaces on port nember 80 (this is default configuration)
•         Listen 192.168.0.2:80 – an application server is listening only on IPv4 address 192.168.0.2 on port nember 80
•         Listen [2001:db8::2]:80 – an application server is listening only on IPv6 address 2001:db8::2 on port number 80
 
For listening in Dual Stack: if there is listen entry only for IPv4 addresses, there is a need of adding IPv6 addresses in httpd.conf file.
For listening in Native IPv6: if there is listen entry for IPv4 addresses, there is a need of replacing that addresses by IPv6 ones in httpd.conf file.
 
The IP addresses, by which there should be an access for each website, are contained in <VirtualHost> directive.
To add, modify or check such IP addresses, there is a need o finding the lines with key word "VirtualHost". That line are usualy at the end of httpd.conf file.
 
Here are example options for websites availability:
•         <VirtualHost *:80> - a website is available on all IP addresses assigned to network interfaces on port number 80
•         <VirtualHost 192.168.0.2:80> - a website is available only on IPv4 address 192.168.0.2 on port number 80
•         <VirtualHost [2001:db8::2]:80> - a website is available only on IPv6 address 2001:db8::2 on port number 80
•         <VitrualHost 192.168.0.2:80 [2001:db8::2]:80> - a website is available on specified IPv4 and IPv6 addresses on port number 80
 
In VirtualHost configuration there is no need of specifying a port - this is optional.
Figure 3 shows a sample configuration of VirtualHost for website available on IPv4 and IPv6 addresses.
 
 
Figure 3. A sample VirtualHost configuration for listening on IPv4 and IPv6 addresses
 
After changing the configuration, there must be a restart of Apache application. Locate the "apachectl" binary and run it with "restart" parameter. It can be done, by typing following commands:
apachectl=`find / -name apachectl | grep "bin/apachectl"`
apachectl restart
 
The verification if Apache is working properly
To verify that the webserver configuration is proper, type the IPv6 address in square brackets into web browser as shown in Figure 4:

Figure 4. The verification if Apache is working properly with selected IPv6 address

©2012 IIP