|Linux 16 March 2014 -|
Being able to run your systems on IPv6, have automatic address assignment and the ability to resolve host names are the necessary building blocks in your IPv6 network infrastructure. Now, that everything is in place it is about time that we are going to enable another service to respond to IPv6 requests. The following article will guide through the steps on how to enable Apache2 httpd to listen and respond to incoming IPv6 requests.
This is the fourth article in a series on IPv6 configuration:
Piece of advice: This is based on my findings on the internet while reading other people's helpful articles and going through a couple of man-pages on my local system.
Surfing the web - IPv6 style
Enabling IPv6 connections in Apache 2 is fairly simply. But first let's check whether your system has a running instance of Apache2 or not. You can check this like so:
In case that you got a 'service unknown' you have to install Apache to proceed with the following steps:
Out of the box, Apache binds to all your available network interfaces and listens to TCP port 80. To check this, run the following command:
In this case Apache2 is already binding to IPv6 (and implicitly to IPv4). If you only got a tcp output, then your HTTPd is not yet IPv6 enabled.
Check your Listen directive, depending on your system this might be in a different location than the default in Ubuntu.
Just in case that you don't have a ports.conf file, look for it like so:
And modify the related file instead of the ports.conf. Which most probably might be either apache2.conf or httpd.conf anyways.
Okay, please bear in mind that Apache can only bind once on the same interface and port. So, eventually, you might be interested to add another port which explicitly listens to IPv6 only. In that case, you would add the following in your configuration file:
But this is completely optional... Anyways, just to complete all steps, you save the file, and then check the syntax like so:
Ok, now let's apply the modifications to our running Apache2 instances:
There we have two daemons running and listening to different TCP ports.
Now, that the basics are in place, it's time to prepare any website to respond to incoming requests on the IPv6 address. Open up any configuration file you have below your sites-enabled folder.
Here, we have to check and modify the VirtualHost directive and enable it to respond to the IPv6 address and port our web server is listening to. Save your changes, run the configuration test and reload Apache2 in order to apply your modifications. After successful steps you can launch your favourite browser and navigate to your IPv6 enabled web server.
That looks like a successful surgery to me...
Note: In case that you received a timeout, check whether your client is operating on IPv6, too.