example42 / puppet-apache

Apache Puppet Module
http://www.example42.com
Other
41 stars 79 forks source link

Unnecessary virtualhost file added on CentOS/Redhat systems #40

Open minorOffense opened 11 years ago

minorOffense commented 11 years ago

I've been trying to figure out why the apache::redhat class is included on centos/redhat systems. It defines an empty file which sets named hosts to work on port 80. In our case, we're deploying apache behind a proxy so we only want to listen on 8080. This file doesn't necessarily hurt anything but it add config when none is required.

https://github.com/example42/puppet-apache/blob/master/manifests/vhost.pp#L240

Which then loads this file

https://github.com/example42/puppet-apache/blob/master/templates/00-NameVirtualHost.conf.erb

I'd suggest just removing that line of code or that class altogether as it doesn't really do anything or respect config (i.e. port settings)

alvagante commented 11 years ago

That's an old piece of code, as far as I remember it was used to provide a NameVirtualHost directive to ensure that the created vhosts could use it as there wasn't such a (needed) line in the RedHat default configs. So I suppose that's why it was there. The fact the port 80 is encoded makes it useless when using vhosts on different ports, so I suppose it must be better parametrized. But I think it's still needed (haven't checked the effect of its removal on a real system, though).