[BUG] rewrite_confs breaks httpd-vhosts.conf

interfasys

Verified User
Joined
Oct 31, 2003
Messages
1,816
Location
Switzerland
httpd-vhosts.conf template has an IP token which gets populated by the script
Code:
<VirtualHost |IP|:80>

Unfortunately, custombuild, or perhaps DA 1.44.1?, writes the IPv6 in the wrong format, forgetting the brackets, which breaks all SSL sites

Code:
<VirtualHost 1.2.3.4 aaaa:bbbb:cccc:dddd::2:80>
should be
Code:
<VirtualHost 1.2.3.4:80 [aaaa:bbbb:cccc:dddd::2]:80>
 
Last edited:
Please post the output of the following command:
Code:
grep `hostname` /etc/hosts | awk '{print $1}'
 
Yes, that's a bug in CustomBuild. It will be reviewed soon. Thank you for the report.
 
Thanks for the report. Added to all 3 custombuilds on files1.
Allow 24 hours if you're using a different files server.

John
 
Just tested on RC7 and we only get the IPV4, so this is not fixed

That's on FreeBSD 9 with /etc/hosts properly populated
 
How does your /etc/hosts file look like? I think it has something like the following:
Code:
IPv4_address hostname.com
IPv6_address hostname.com

Am I right? CustomBuild's tokenize_IP() function takes the first line found with the hostname in /etc/hosts file (in the mentioned example, it would be IPv4_address line), then it saves the IP (1st column, IPv4_address) and uses it for httpd-vhosts.conf.
 
How does your /etc/hosts file look like? I think it has something like the following:
Code:
IPv4_address hostname.com
IPv6_address hostname.com

Am I right? CustomBuild's tokenize_IP() function takes the first line found with the hostname in /etc/hosts file (in the mentioned example, it would be IPv4_address line), then it saves the IP (1st column, IPv4_address) and uses it for httpd-vhosts.conf.
OK, but why ignore IPv6 addresses?
 
A few reasons..
1) Back in the day (no longer applies) when proftpd used vhost for each IP, the hostname had to resolve to the server IP or it wouldn't start up (forget exactly why).. but now with the unified_ftp_password_file option enabled by default, there are no more proftpd VHs, so it doesn't really matter.

2) As for the httpd-vhosts.conf, that's just the baseline default VH. Anything that isn't found by other VHs will still default to the /var/www/html folder anyway, so having or not having an IPv6 also listed there shouldn't make much difference.

If you're noticing something such that it isn't working as expected, then let me know and we can re-assess...
but as I'm currently understanding it, we don't "need" the IPv6 in the httpd-vhosts.conf file, as it would default to the same path anyway.

John
 
I believe this "bug" has surfaced again.
after ./build rewrite_confs my /etc/httpd/conf/httpd-vhosts.conf has the wrong format.
it now shows
<code><VirtualHost [1.2.3.4 aaaa:bbbb:cccc:dddd::2]:80></code>
 
Back
Top