i would like to place my apache document root inside another partition of my ubuntu hard drive, but i keep getting forbidden
message, when i place to my home directory it woking find, how could that be? is the group or owner affected ? here mysite.conf and apache2.conf when i place my document root in my home folder (Working)
#site-available/mysite.conf
DocumentRoot /home/jono/www
#/etc/apache2/apache2.conf
<Directory /home/jono/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
bu when i change document root to another partition i keep getting forbidden
messasge
#site-available/mysite.conf
DocumentRoot /media/jono/website_data/www
#/etc/apache2/apache2.conf
<Directory /media/jono/website_data/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
is the owner/group access affected ? or there is another problem ?
As a quick workaround (safe and quick) you can make the mounting point of your external hard driver to the default root directory ( /var/www by default).
Assigning the mounting point to a per-existing directory is safe but the old content can't be reached unless you unmounted the driver.
To learn more how to create a mounting point refer to this. To know more about assigning the mounting point to a per-existing directory refer to this.
at last it's working, i have to grant all access to
www:data
for accesing whole directory thanks to you @mark-b, usingchown -R www-data:www-data
to whole directory isn't good idea but for local development is ok i guest