Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I installed ubuntu server 12.04 and used windows 7 folder as shared folder using guestadditions. I can see the folder as sf__projects, so i symlinked it to var/www/_projects

But the issue is all folders have user root assigned to them. I tried so many options from different blogs but nothing works.

This is what I am getting on apache error log:

[Tue Jul 17 17:43:27 2012] [crit] [client 192.168.0.108] (13)Permission denied: /var/www/_projects/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

screenshot of folders: [http://www.diigo.com/item/image/80d3/d3ha]

/etc/hosts:

127.0.0.1       bab.local   www.bab.local

/etc/apache2/sites-available/bab

<VirtualHost *:80>
    ServerAdmin emailxxx@gmail.com

    DocumentRoot "/var/www/_projects/bab/master"

    ServerName bab.local
    ServerAlias www.bab.local

    ErrorLog /var/www/_projects/bab/master/var/logs/apache_error.log
    CustomLog /var/www/_projects/bab/master/var/logs/access.log combined

    <Directory /var/www/_projects/bab/master/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride all
            Order allow,deny
            Allow from all
    </Directory>

my windows host file:

192.168.0.79    bab.local   www.bab.local

when i try to access site through browser, i get:

You don't have permission to access / on this server.

I am exactly not sure why it's trying to access: var/www/_projects/.htaccess

NOTE: 192.168.0.79 is ubuntu's ip 192.168.0.108 windows ip

Has anyone experienced this and fixed it?

share|improve this question

1 Answer 1

up vote 3 down vote accepted
  1. It's trying to read the .htaccess file because it's there. Your httpd (apache) is set to read the filename set in the AccessFileName directive and you have AllowOverride All. If you don't need the settings in the .htaccess file then you can just delete that file.
  2. It can't read the .htaccess file because only root and vboxsf can read/write from/to it. Your httpd is probably running as www-data since you're on Ubuntu 12.04. Check your httpd configuration which User it is running as. You can add an entry in your /etc/fstab for your VirtualBox shared folder to set the uid (and gid) when mounting it. Looks like you can't rely on fstab to successfully mount the volume on boot because, apparently, fstab gets read before the sf (sharedfolder) module gets loaded so you should use the mount command in /etc/rc.local if you want it to mount automatically (https://forums.virtualbox.org/viewtopic.php?f=3&t=15868).
  3. Same thing with '/'; only root and vboxsf can read it.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.