How to Enable IPv6 in Apache


enable ipv6 in apache

IPv6 is the latest Internet Protocol that improve website speed and performance by improving network connectivity and routing. It also provides better security to your website. However, it is disabled by default on Apache web server. Let’s take a look at how to enable IPv6 in Apache for your website.

 

How to Enable IPv6 in Apache

Here are the steps to enable IPv6 in Apache web server.

 

1. Open Apache config file

Open Apache config file in a text editor. You will find it at one of the following locations:

  • /etc/apache2/httpd.conf
  • /etc/apache2/apache2.conf
  • /etc/httpd/httpd.conf
  • /etc/httpd/conf/httpd.conf

 


$ sudo vim /etc/apache2/httpd.conf

 

 

2. Enable IPv6

Add the following line to your Apache config file to enable IPv6, along with the port number 80 for http requests.

Listen [2400:6180:0:d0::1f33:d001]:80

Ensure that there are square braces [ ] in listen directive.

 

3. Restart Apache web server

Restart Apache web server to apply changes


$ sudo /etc/init.d/apache2 start [Debian or Ubuntu]
# sudo apachectl restart [RHEL, CentOS or Fedora]

 

4. Test IPv6

To test if your server port listens to IPv6, just run the netstat command in terminal

# netstat -anlp |grep 80
tcp        0      0 139.59.227.20:80        0.0.0.0:*               LISTEN      23047/httpd         
tcp6       0      0 2400:6180:0:d0::1f33:80 :::*                    LISTEN      23047/httpd         

 

 

That’s it! Now Apache will serve through IPv6 protocol and you should see better website performance.

About Sreeram Sreenivasan

Sreeram Sreenivasan is the Founder of Ubiq, a business dashboard & reporting platform for small & medium businesses. Ubiq makes it easy to build business dashboards & reports for your business. Try it for free today!