您好,我在学校项目工作,我安装了ispconfig,它配置nginx服务器和它的工作,现在我想启用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。
但我不知道怎么做,也许是化名或创建vhost?我可以配置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。