Contrary to the old solution, there is now a patch available. You can now setup the IPv6-rewrite within the Interface. There is no IPv4 rewrite via the interface, as this should be implemented in 3.0.6. It also requires a different approach.
A rewrite of IPv4 addresses will continues to be controlled by the patch on
/usr/local/ispconfig/server/lib/config.inc.local.php and is only valid if the IP is not a wildcard. See at the end of the post.
I use the rewrite for several months on my servers. They all have a 64er subnet and the vhosts are written correctly on each mirror. I assume that the whole system works flawlessly on others. However, it should be checked after the first run, if the IPv6 was on the mirror set correctly. For example, by
grep "\<VirtualHost \[" /etc/apache2/sites-enabled/100-mydomain.de.vhost
For problems (and also with non-problems;)) please use the comment function or send me an email to firstname.lastname@example.org.
How it works
Under Serverconfig is a new field “IPv6 Prefix” available. Here the IPv6 prefix of the server is entered (for a 64er subnet eg 2a01:4f8:150:2262 ::). When writing to a mirror of the vhost, then IPv6 is replaced in part by the subnet. Suppose the mirror has the subnet 2a01:4f8:150:aaaa::, then on the mirror the (master) IPv6 2a01:4f8:150:2262::1 will be changed to 2a01:4f8:150:aaaa::1.
As long under Serverconfig / Web option “Rewrite IPv6 on Mirror” is not selected, there is no rewrite, and the IPv6 is written identically to the master. So you can decide per mirror whether IPv6 is to be re-written or not (for example, failover-IP).
A new created IPv6 Is matched against the prefix, and must match. The same applies when you create a prefix – this must match the shortest IPv6 address.
Install or update ISPconfig 3.0.5
Change to the directory of ISPConfig
Back up the files that are changed by the patch
cp -p interface/lib/classes/tform.inc.php interface/lib/classes/tform.inc.php.orig
cp -p interface/web/admin/form/server_config.tform.php interface/web/admin form/server_config.tform.php.orig
cp -p interface/web/admin/form/server_ip.tform.php interface/web/admin/form/server_ip.tform.php.orig
cp -p interface/web/admin/lib/lang/en_server_config.lng interface/web/admin/lib/lang/en_server_config.lng.orig
cp -p interface/web/admin/lib/lang/en_server_ip.lng interface/web/admin/lib/lang/en_server_ip.lng.orig
cp -p interface/web/admin/templates/server_config_server_edit.htm interface/web/admin/templates/server_config_server_edit.htm.orig
cp -p interface/web/admin/templates/server_config_web_edit.htm interface/web/admin/templates/server_config_web_edit.htm.orig
cp -p server/plugins-available/apache2_plugin.inc.php server/plugins-available/apache2_plugin.inc.php.orig
Download the patch and apply.
patch -Np1 -i ispconfig305-rewritev6.patch
If everything worked correctly, the output looks like this:
patching file interface/lib/classes/tform.inc.php
patching file interface/web/admin/form/server_config.tform.php
patching file interface/web/admin/form/server_ip.tform.php
patching file interface/web/admin/lib/lang/en_server_config.lng
patching file interface/web/admin/lib/lang/en_server_ip.lng
patching file interface/web/admin/templates/server_config_server_edit.htm
patching file interface/web/admin/templates/server_config_web_edit.htm
patching file server/plugins-available/apache2_plugin.inc.php
Define the IPv4 for the server (mirror) in
IPV4 will only be rewritten, if a local IPv4 is defined and you didn´t set * in ISPConfig for the IP-address.
As long as you created backup, a restore is possible. Just copy the