全新安装后的 Trac。 TracError:IOError:[Errno 13]权限被拒绝

发布于 2024-12-22 05:34:18 字数 842 浏览 5 评论 0原文

我有干净的 CentOS 6。我只是通过 yum install httpd mysql-server, python, mysql-python 进行安装。

第一步

$ trac-admin /home/tracprojects/main2 initenv

项目名称:主要
SQL 连接字符串:mysql://trac@localhost:3306/trac(基本存在,utf8,innoDB)

好的。

$ trac-admin /home/tracprojects/main2 部署 /var/www/html/

好的。


第二步

然后,我将 cgi-bin/trac.wsgi 移动到我的 /cgi-bin/ 服务器的别名文件夹。 (mod_wsgi 运行良好。不是作为守护进程。在 wsgi 脚本上进行了测试)。

然后,我向 Apache 用户授予了我之前创建的整个目录的权限。并从 apache 配置添加访问权限。 (命令-允许-拒绝)。

但是当我打开浏览器并转到 url 时,我收到此错误消息:

Internal Server Error
TracError: IOError: [Errno 13] Permission denied: '/home/tracprojects/main2/VERSION'

我做错了什么?

I have clean CentOS 6. I just install via yum install httpd mysql-server, python, mysql-python.

First Step

$ trac-admin /home/tracprojects/main2 initenv

Project name: Main
SQL Connect string: mysql://trac@localhost:3306/trac (base exists, utf8, innoDB)

OK.

$ trac-admin /home/tracprojects/main2 deploy /var/www/html/

OK.

Second Step

Then I move cgi-bin/trac.wsgi to my /cgi-bin/ server's alias folder. (mod_wsgi working well. NOT as a daemon. tested on wsgi scripts).

Then I've grant permissions to Apache user for whole directories I've create earlier. And add access from apache config. (order-allow-deny).

But when I open my browser and go to url, I've got this error message:

Internal Server Error
TracError: IOError: [Errno 13] Permission denied: '/home/tracprojects/main2/VERSION'

What I do wrong?

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

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

发布评论

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

评论(2

彼岸花似海 2024-12-29 05:34:18

你使用SElinux(默认启用)吗?使用默认的 SElinux 我相信 Apache 无法访问 /home。您可以通过暂时禁用 SElinux(“setenforce 0”作为 root)并重新启动 Apache 来检查这一点。另请检查 /var/log/audit.log。

Do you use SElinux (enabled by default)? With default SElinux I believe Apache can not access /home. You can check this by disabling SElinux temporarily ("setenforce 0" as root) and maybe restarting Apache. Also check /var/log/audit.log.

手长情犹 2024-12-29 05:34:18

检查“/home/tracprojects”等的权限。Apache 作为特殊用户运行,可能无法读取目录、读取文件,甚至写入文件。

您可能最好使用 mod_wsgi 守护程序模式并告诉 mod_wsgi 以可以访问该位置的其他用户身份运行该进程。即使这样做,WSGI脚本文件目录至少仍然需要对Apache用户可读。

Check permissions of '/home/tracprojects' etc. Apache runs as special user and simply may not be able to read into directories, read files, or even write files.

You may be better off using mod_wsgi daemon mode and telling mod_wsgi to run the process as a different user who can access that location. Even if do this, the WSGI script file directory still at least needs to be readable to Apache user.

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