HugeServer Blog

Updates and News about HugeServer !
ipv6

How to use IPv6 on Apache?

Nowadays IPv6 is getting more and more common to be used on web servers. It’s better to implement IPv6 on servers in order to be accessible on IPv6 networks.  Here it is a really quick instruction how to get ready for IPv6 on your Apache web servers.

I have installed a fresh CentOS and a fresh apache on my test server, without any control panel. If you are using a control panel or any other operation systems, the way of preparing should be the same, however, if you have any problem during your configuration, you can ask me in the comments.

Let’s start with the apache configuration file. Open “/etc/httpd/conf/httpd.conf” with your text editor in the server. I am using nano.

 nano /etc/httpd/conf/httpd.conf

Now add your IPv6 address to the “listen” options in the file. You should search for “listen” and edit or add the line with your own IPv6. For this tutorial I am using the private prefix “fd13:01ec:a560:534f::/64”

Listen [fd13:01ec:a560:534f::100]:80

Save and exit this file. Now we should change the virtual hosts to add a new IPv6 record into this.  Here is an example of a virtual host with IPv6.

<VirtualHost [fd13:01ec:a560:534f::100]:80 >
ServerName test-lab.hugeserver.com
ServerAlias test-lab.hugeserver.com
ServerAdmin test-lab@hugeserver.com
DocumentRoot /home/test-lab/public_html
<Directory /home/test-lab/public_html>
</Directory>
</VirtualHost>

You should change this configuration in order to be fit into your server configuration. What you actually can do, is copying the VirtualHost configuration of your IPv4 and edit the first line to IPv6. Do not forget to use brackets for your IPv6.

After configurations are done, we are going to restart apache and try to access our web server over IPv6 from Browser.

/etc/init.d/httpd restart

Now it’s accessible from browsers

http://[fd13:01ec:a560:534f::100]/

If you have any problem or question please leave a comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *