example42 / puppet-apache

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

403 (forbidden) on Vhosts #43

Open erikaheidi opened 11 years ago

erikaheidi commented 11 years ago

Hello,

As I mentioned on Twitter, I'm having 2 small issues while using this apache module for a Vagrant box, with Ubuntu 12.04 . The apache version being installed is 2.4.6 .

First one is that when trying to override the default vhost conf file, following the readme instructions, it was creating a file named "000-default" on sites-enabled, not overriding the 000-default.conf file - which caused it to not change the doc root as expected (ofc).

I could fix this by adding priority => 000 on the vhost declaration.

The other bug annoyed me for quite a long time: I was getting a 403 forbidden error on the Vhost I just setup. Adding "AllowOverride All" and other options (to explicitly add the Directory block) didn't change anything. The log says:

[Fri Sep 20 12:00:00.312316 2013] [authz_core:error] [pid 17445] [client 192.168.33.1:57254] AH01630: client denied by server configuration: /vagrant/web/

Luckily(!), I had the same problem with my local environment (ubuntu 13.04) before, and after googling I found this: http://stackoverflow.com/questions/10351167/apache-client-denied-by-server-configuration

Looks like is something new from Apache, adding this line: Require all granted to the Directory block fixed the problem.

I think the default vhost template might need an update.

alvagante commented 11 years ago

For overriding the default file on Debian file something like what you did is what you need: apache::vhost { 'default': priority => '000', template => ... } if you saw some docs around stating different tings, please point me there.

For the client denied error we probably need to add an apache-version fact and provide different versions of the default template. The current workaround is to specify your own template with the content you need.

jimmykane commented 10 years ago

Is there any progress on this?

alvagante commented 10 years ago

I suppose that a "Require all granted" line on older Apache versions would bring a syntax error, so the only current solution is to provide a custom template and the right solution would be to introduce an apache fact that returns the version installed, and use it in the default template to manage the correct output.

jimmykane commented 10 years ago

Sure I was just asking if there was any plans on this to be implemented. I can check it out later. Of course the proposed solution worked.