【发布时间】:2021-04-29 19:54:12
【问题描述】:
对于其他阅读本文的人;似乎问题是由权限引起的,而 suexec 是问题的一部分。禁用 suexec 后,一切都好起来了(受我以后可能会发现的后续问题的影响)。
我在(比如说)dir1 中有两个文件,在 /cgi-bin/dashboard-login/ 中,它们使用 CGI::Session 来管理会话。
两个文件都像这样设置一个新会话:
my $session = new CGI::Session(undef, $cgi, {Directory=>"$sessions_dir_location"}) or die CGI::Session->errstr;
这意味着第二个文件实际上正在打开由 file1 创建的会话。到目前为止一切顺利。
文件 3 位于相同的子域中,但位于不同的目录 (/cgi-bin/dashboard/) 中。它还运行该会话字符串,但我收到以下错误:
Software error:
new(): failed: load(): couldn't retrieve data: retrieve(): couldn't open '/var/www/vhosts/example.com/sessions_storage/cgisess_fc6c62eee135f6cd418defef4516a59c': Permission denied at index line 38.
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.
在 Filezilla 中,我看到最新会话文件的文件权限设置为“dfr (0640)”,但前一个具有权限“adfr (0640)”,该 adfr 文件可以在 filezilla 中打开并且没有当我运行我的脚本时没有任何问题。现在会话文件被创建为“dfr (0640)”。有没有办法设置服务器(或 CGI::Session),以应用“adfr (0640) 权限?
根据您的经验,这可能是问题的原因吗?
【问题讨论】:
-
能否提供更多关于各种目录和文件的权限信息:
ls -l /var/www/vhosts/example.com/sessions_storage、ls -l /cgi-bin/dashboard-login和ls -l /cgi-bin/dashboard的输出是什么 -
很高兴你让它工作。不要将解决方案编辑到您的问题中,请编写您自己的答案并接受它。谢谢! :)