setting document root in antoher partition on ubuntu

百般思念 提交于 2019-12-08 03:26:23

问题


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 ?


回答1:


at last it's working, i have to grant all access to www:data for accesing whole directory thanks to you @mark-b, using chown -R www-data:www-data to whole directory isn't good idea but for local development is ok i guest




回答2:


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.



来源:https://stackoverflow.com/questions/31596331/setting-document-root-in-antoher-partition-on-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!