“无法打开主脚本:/usr/share/webapps/roundcubemail/webmail/index.php(没有这样的文件或目录)”

时间:2017-12-11 11:29:09

标签: php email nginx webmail roundcube

我已使用nginx根据this archlinux wiki配置了roundcubemail。

当我使用:https://mail.hackeac.com/webmail页面访问/webmail 时(在浏览器中)渲染:“未指定输入文件”,当我在{{ 1}}我看到了

/var/log/nginx/roundcubemail_error.log

Nginx配置:

2017/12/11 13:44:10 [error] 5827#5827: *1 "/usr/share/webapps/roundcubemailwebmail/index.html" is not found (2: No such file or directory), client: 169.255.184.153, server: mail.hackeac.com, request: "GET /webmail/ HTTP/2.0", host: "mail.hackeac.com"
2017/12/11 13:44:19 [error] 5827#5827: *1 "/usr/share/webapps/roundcubemailwebmail/index.html" is not found (2: No such file or directory), client: 169.255.184.153, server: mail.hackeac.com, request: "GET /webmail/ HTTP/2.0", host: "mail.hackeac.com"

或(更好的缩进)Here

请帮忙。

1 个答案:

答案 0 :(得分:2)

您使用fastcgi_param SCRIPT_FILENAME /usr/share/webapps/roundcubemail$fastcgi_script_name;来计算脚本文件的路径。使用$request_filename更简单,它使用rootalias指令计算正确的值。

例如:

location /webmail {
    alias /usr/share/webapps/roundcubemail;
    ...
    location ~ \.php$ {
        include fastcgi.conf;
        ...
        fastcgi_param SCRIPT_FILENAME $request_filename;
    }
}

有关详细信息,请参阅this document