在ubuntu的另一个分区中设置文档根目录 [英] setting document root in antoher partition on ubuntu

查看:127
本文介绍了在ubuntu的另一个分区中设置文档根目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的apache文档根目录放置在我的ubuntu硬盘驱动器的另一个分区中,但是我一直收到forbidden消息,当我将其放置到主目录中时,它会开始查找,那怎么可能呢?小组或所有者受到影响吗?当我将文档根目录放在主文件夹中(正在工作)时,这里为mysite.conf和apache2.conf

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,当我将文档根目录更改为另一个分区时,我不断收到forbidden messasge

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 ?

推荐答案

最后,它正常工作了,我必须授予对www:data的所有访问权限,以便访问整个目录,这要归功于@ mark-b,并使用chown -R www-data:www-data目录不是一个好主意,但是我可以做本地开发

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

这篇关于在ubuntu的另一个分区中设置文档根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆