cPanel IPv6 Woes

Hello,

cPanel has pushed updates again which re-enables IPv6 on any box greater than 11.40.

This can cause an issue when cPanel starts rebuilding the Apache configuration though because it adds one or both of these lines:

Listen[::]:80
Listen[::]:443

When IPv6 is installed on a server, the Listen directive is set to Listen[::]:80, which listens on all IPv6 addresses on the server. The above config is basically how Apache will listen for IPv6 addresses. So far I think this only works with Apache 2.0+.

When Apache encounters this problem on start/restart it will present an similar error to the following:

httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address
0.0.0.0:443

To resolve this temporarily just disable the lines that contain the ipv6 listen directives as such:

#Listen[::]:80
or
#Listen[::]:443

This can permanently be resolved by simply forcing EasyApache to rebuild the currently installed apache and php.

/scripts/easyapache --build

(NOTE: Never run easyapache without first making sure you backup current Apache config, php config, php information and installed modules)

From what I hear even this can upgrade your PHP version in certain circumstances when the currently installed version of PHP is no longer an option in EasyApache.

To be 100 percent safe and save yourself some time, always verify your current php version and make sure it is selected in EasyApache. if for any reason this doesn’t happen you may find that EasyApache upgraded the php version and some websites may not be working anymore.

Now that Apache has been covered, MySQL is also now trying to bind to IPv6 addresses. This will require you to add the following directive to the /etc/my.cnf and restart MySQL:

bind-address = 0.0.0.0

This should bind to IPv4, and allow all IPv4 addresses to connect.

+1
This one-liner backups up the current config to a .bak file and makes the needed changes for you…

cp /usr/local/apache/conf/httpd.conf{,.bak.`date +%s`} && sed -i 's/Listen \[::\]:80/\#Listen \[::\]:80/' /usr/local/apache/conf/httpd.conf && sed -i 's/Listen \[::\]:443/\#Listen \[::\]:443/' /usr/local/apache/conf/httpd.conf

You can also append
&& /etc/init.d/httpd restart
to the end if you wish.
Good luck…

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.