1

I would like to change my apache root server ( /var/www >>> /media/mhsohag11/Local Disk/Sites ). For that directory path has been changed from /etc/apache2/apache2.conf

<Directory "/media/mhsohag11/Local Disk/Sites">
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

Edited also VirtualHost file located /etc/apache2/site-available/000-default.conf

Edited code below :

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        ServerName wp.local
        DocumentRoot "/media/mhsohag11/Local Disk/Sites/wp"
        ServerAlias www.wp.local

</VirtualHost>

After putting all changes , all services also restarted.

Then I hit http://localhost or http://wp.local and showing this forbidden message :

Forbidden You don't have permission to access / on this server. Apache/2.4.29 (Ubuntu) Server at localhost Port 80

1 Answers1

1

The user 'www-data' needs at least read permissions (and for wordpress, write permissions) for the /media/mhsohag11/Local Disk/Sites/ directory. Run the following at a command line:

chgrp -R www-data /media/mhsoha11/Local\ Disk/Sites

chmod -R 664 /media/mhsoha11/Local\ Disk/Sites

This changes the group to the web server and gives the web server read and write permissions recursively to all files and directories under /media/mhsoha11/Local\ Disk/Sites inclusive.