Vagrant/Puphpet Apache Allow Override

Hi,

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;

apache:
    install: '1'
    settings:
        user: www-data
        group: www-data
        default_vhost: true
        manage_user: false
        manage_group: false
        sendfile: 0
    modules:
        - rewrite
    vhosts:
        gj0yau9eukqc:
            servername: admin-interface.dev
            serveraliases:
                - admin-interface.dev
            docroot: /var/www/html/admin-interface
            port: '80'
            directories:
                awjrohbhebqy:
                    provider: directory
                    path: ''
                    options:
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                    allow_override:
                        - All
                    require:
                        - 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?
SheppardDigitalAsked:
Who is Participating?
 
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.
0
 
gr8gonzoConsultantCommented:
Have you tried copying the directories item from vhosts into "settings:" ?
0
 
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/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

User www-data
Group www-data

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

<Directory />
  Options FollowSymLinks
  AllowOverride None
</Directory>

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

0
 
SheppardDigitalAuthor Commented:
Resolved myself
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.