【发布时间】:2018-11-27 22:36:07
【问题描述】:
我有 LAMP 服务器
服务器版本:Apache/2.4.29 (Ubuntu)
PHP:PHP 7.2.5-0ubuntu0.18.04.1
我需要授予 php SQLITE3 访问 www/html 文件夹外的 db 的权限。 现在我的文件系统看起来是这样的。
/root
./database
user.db
/var
./www
./html
index.html
reg.php
user.db 必须位于 /root/database 中,因此仅将其放入 var/www/html 对我来说不是解决方案。
所以我需要为 Apache 或 php 授予对该文件夹的访问权限。 我在这里找到了一些信息https://httpd.apache.org/docs/2.4/urlmapping.html,但不知道它是如何工作的以及我需要把它放在哪里?
【问题讨论】:
-
我将创建一个从
/root/database/到您的var/www/html目录的符号链接。 -
@fyroc 我符号链接了,但什么也没发生。然而,它看起来是渐进的方式。当我在浏览器中输入 example.com/db/helloworld.html 时,它会识别,这个 URL 存在,但是用 403 HTTP 代码回答
Forbidden You don't have permission to access /db/helloworld.html on this server. Apache/2.4.29 (Ubuntu) Server at examle.com Port 80我如何才能授予对它的访问权限?