Vagrant synced folder permission issue with apache -


i'm running centos6.4 box.

running vagrant up without synced folder config in vagrant file fine. can access on host machine via http://localhost:8080 , displays apache page. create index.html in /var/www/html folder , displays fine too.

however after adding line below in vagrant file, visiting page displays 403 forbidden don't have permission access / on server. error instead:

config.vm.synced_folder "./source", "/var/www/html", :extra=>"dmode=777,fmode=777" 

going vm see permission set below in /var/www:

drwxr-xr-x.  6 root    root    4.0k jul 20 23:15 . drwxr-xr-x. 18 root    root    4.0k jul 20 23:15 .. drwxr-xr-x.  2 root    root    4.0k may 14 06:12 cgi-bin drwxr-xr-x.  3 root    root    4.0k jul 20 23:15 error drwxrwxrwx.  1 vagrant vagrant  102 jul 21 23:14 html drwxr-xr-x.  3 root    root    4.0k jul 20 23:18 icons 

so tried setting apache ownership it,

   config.vm.synced_folder "./source", "/var/www/html", :owner=>"apache",:group=>"apache",:extra=>"dmode=777,fmode=777" 

but doesn't work too.

apparently has full read/write permissions , have no clue why apache complaining.

figure out user/group runs httpd, make sure user has execute permission on /var/www , subfolders.

also, in apache site configuration files, make sure have correct directives /var/www, below

    documentroot /var/www     <directory />             options followsymlinks             allowoverride none     </directory>     <directory /var/www/>             options indexes followsymlinks multiviews             allowoverride none             order allow,deny             allow     </directory> 

disable selinux in guest, it's useless development env

edit /etc/selinux/config

change selinux disabled

selinux=disabled

reboot vagrant box => vagrant reload

see if #1 #2 helps.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -