gpt4 book ai didi

linux - 如何在 ispconfig 服务器中为 roundcube 设置 nginx?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:52:55 25 4
gpt4 key购买 nike

你好,我在学校项目上工作,我安装了配置 nginx 服务器的 ISPConfig,它工作正常,现在我想启用 roundcube webmail。我正在运行 ubuntu,所以我使用了 apt-get

apt-get install roundcube roundcube-plugins roundcube-plugins-extra

向导为 roundcube 配置了我的 MySQL 数据库并将 roundcube web 文件安装到/usr/share/roundcube,在/var/lib/roundcube 中我有指向/usr/share/roundcube 的链接。

现在我需要告诉 nginx 如果有人请求 URL myispconfig.tld/webmail 它打开 roundcube。但我不确定该怎么做,也许是一些别名或创建虚拟主机?我可以配置 apache,但我是 nginx 的新手。我阅读了 roundcube 文档,所以我认为我可以处理下一个配置。谢谢

编辑:我尝试添加到/etc/nginx/sites-available/ispconfig.vhost

location  /webmail/ {
alias /usr/share/roundcube/;
}

但在 nginx 重新加载后没有变化 :P

最佳答案

已解决:squirrelmail 的相同配置有效:-)

  location /roundcube {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/roundcube/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

fastcgi_param HTTPS $https;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
# To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) mu$
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
location ~* /.svn/ {
deny all;
}
location ~* /README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ {
deny all;
}

}

注意:Debian 用户应该更改“root/usr/share/;”使用“root/var/lib/;”整个配置文件(共有三个地方)。否则他们将收到 404 错误作为 whatermark。

关于linux - 如何在 ispconfig 服务器中为 roundcube 设置 nginx?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17466780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com