Vagrant/Puphpet Apache Allow Override


I've started looking at Vagrant and today I've created a vagrant box using a config I've put together using puphpet.

The box seems to work fine, however for some reason .htaccess files were not working. I checked the config and Allow Override was set to All for the vhost that I'd setup, but in httpd.conf it was set to none. Once I changed this to All, the .htaccess file started working.

My question is, in the yaml.conf file is there anyway to set the apache default to Allow Override On?

Here's the relevant section of my yaml.conf file;

    install: '1'
        user: www-data
        group: www-data
        default_vhost: true
        manage_user: false
        manage_group: false
        sendfile: 0
        - rewrite
            docroot: /var/www/html/admin-interface
            port: '80'
                    provider: directory
                    path: ''
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                        - All
                        - all
                        - granted
                    custom_fragment: ''
            engine: php
            custom_fragment: ''
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''
    mod_pagespeed: 0

Open in new window

I think I somehow need to set the Allow Override All in the apache > settings section as well as in the vhost section.

Is this possible? or would i have to manually need to edit the httpd.conf file to set this?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Have you tried copying the directories item from vhosts into "settings:" ?
SheppardDigitalAuthor Commented:
I've tried moving 'directors' into settings but it generated errors when I tried to provision the VM. I moved it to beneath the main apache: section, and it didn't generate errors but it also didn't set the Allow Override option in httpd.conf.

There must be a way to do it, but Google doesn't bring anything up. I can set Allow Override for vhosts, but not the default option in httpd.conf, and without that being set to 'All' the option in each vhost is ignored. It's as if the vhosts option isn't being set at all.

The VM is running Centos. Does anyone know where I can view the vhosts file for apache? I can't seem to find it and the vhosts are not set in httpd.conf.

Here's the httpd.conf file

# Security
ServerTokens OS
ServerSignature On
TraceEnable On

ServerName "localhost"
ServerRoot "/etc/httpd"
PidFile run/
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

User www-data
Group www-data

AccessFileName .htaccess
<FilesMatch "^\.ht">
    Require all denied

<Directory />
  Options FollowSymLinks
  AllowOverride None

DefaultType none
HostnameLookups Off
ErrorLog "/var/log/httpd/error_log"
LogLevel warn
EnableSendfile Off

#Listen 80

Include "/etc/httpd/conf.d/*.load"
Include "/etc/httpd/conf/ports.conf"

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

IncludeOptional "/etc/httpd/conf.d/*.conf"

Open in new window

SheppardDigitalAuthor Commented:
I've found a solution for the time being, during the PuPHPet configuration if you set it to use PHP_MOD then this problem doesn't occur.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SheppardDigitalAuthor Commented:
Resolved myself
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.