1

My Raspian Apache2 does not seem to like the www folder on a RAspberry-3B USB drive, which I can easily access from my Windows network.
It keeps giving me
You don't have permission to access / on this server. Apache/2.4.25 (Raspbian) Server at 192.168.200.99 Port 80
All works OK however if the /var/www folder is used. And even PHP works OK.
My (abbreviated) setup is as follows-
FSTAB:

UUID=1375-E205 /media/USBdrive32 vfat auto,sync,umask=000,gid=root,uid=root,rw 0 0 

I can easily access this from Windows+Samba.
The Apache conf file is as follows-

##### <Directory /var/www/>  
<Directory **/media/USBdrive32/www/**>
    Options Indexes FollowSymLinks
    AllowOverride None
        Require all granted
</Directory>

the usb has the following permissions: (sample)
drwxrwxrwx 6 root root 16384 Sep 1 14:00
I have tried changing this to u= (me) g=www-data, but the same results are obtained.
Ideally, once this working, I'd like to change the whole USB media drive, or at least the www folder on it, to umask=004 or perhaps even 007.
I can edit the www folder from my Windows Notepad++ But Apache will not allow me to use it as a LAMP webserver.
Any ideas on where my 403 forbidden problem is?

aqk
  • 179
  • 1
  • 9

1 Answers1

1

The Apache webserver used to have almost all its parameters in the parent file: /etc/apache2/apache2.conf
Now it's a case of modifying its includes.
In this case, specifically the /etc/apache2/sites-available/000-default-conf file, which now contains the <VirtualHost *:80>
The last time I used this (six months ago!), it was in its parent apache2.conf

Its DocumentRoot parameter must be changed from the /var/www/html/ to the FAT32 USB media file as set up in the fstab.
E.G. DocumentRoot /media/USBdrive32/www

All is OK now. Apache2 can access the www folder, AND I can edit it with either Windows-10 or Linux.

aqk
  • 179
  • 1
  • 9