XAMPP +虚拟主机 +群组共享文件夹

发布于 2024-10-09 12:08:22 字数 1440 浏览 4 评论 0原文

我有一个为所有用户安装的文件夹,这些用户位于“common”组中用于共享文件
/home/.common/ 通过 fstab 挂载到 /home/common

bindfs#/home/.common /home/common 保险丝组=common,perms=g=rwx

我也想共享站点文件夹。我将站点放在目录 /home/common/Sites/
并为这些目录创建虚拟主机。但我输入时出错。

http://mysite/

禁止访问!

您无权访问 请求的目录。有 要么没有索引文档,要么 目录是读保护的。

如果您认为这是服务器错误, 请联系站长。

错误 403

在 httpd.conf

# Virtual hosts
Include etc/extra/httpd-vhosts.conf

在 httpd-vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /home/common/Sites/mysite
    ServerName mysite
    ErrorLog /home/common/Sites/mysite/mysite.local-error_log
    CustomLog /home/common/Sites/mysite/mysite.local-access_log common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /home/common/Sites/mysecondsite
    ServerName mysecondsite
    ErrorLog /home/common/Sites/mysecondsite/mysecondsite.local-error_log
    CustomLog /home/common/Sites/mysecondsite/mysecondsite.local-access_log common
</VirtualHost>

在 .local-error_log

[error] [client 127.0.0.1] (13)Access denied: access to / denied

当我打开 vhosts - localhost 返回错误也。如果关闭 LH 效果很好。
如何制作这个结构?

I have folder which mount for all users which in group 'common' for sharing files
/home/.common/ mounted to /home/common by fstab

bindfs#/home/.common /home/common fuse group=common,perms=g=rwx

I want to share sites folders too. I put sites to dir /home/common/Sites/
and made virtual host to those directories. But i'm having error on enter.

on http://mysite/

Access forbidden!

You don't have permission to access
the requested directory. There is
either no index document or the
directory is read-protected.

If you think this is a server error,
please contact the webmaster.

Error 403

in httpd.conf

# Virtual hosts
Include etc/extra/httpd-vhosts.conf

in httpd-vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /home/common/Sites/mysite
    ServerName mysite
    ErrorLog /home/common/Sites/mysite/mysite.local-error_log
    CustomLog /home/common/Sites/mysite/mysite.local-access_log common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /home/common/Sites/mysecondsite
    ServerName mysecondsite
    ErrorLog /home/common/Sites/mysecondsite/mysecondsite.local-error_log
    CustomLog /home/common/Sites/mysecondsite/mysecondsite.local-access_log common
</VirtualHost>

in .local-error_log

[error] [client 127.0.0.1] (13)Access denied: access to / denied

When i turn on vhosts - localhost returns error too. If turn off LH works good.
How to make this structure?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无法回应 2024-10-16 12:08:22

问题出在权限上。我需要更改 opt/lampp/etc/httpd.conf 中的 apache 用户和组

The problen was in permissions. I was need to change apache user and group in opt/lampp/etc/httpd.conf

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文