配置DSPAM WebUI支持Nginx,修改了原文dspam虚拟主机小部分配置备注:本文以EMOS-1.5样本;
一、配置Nginx
序列号 | CPU | RAM | HDD | 带宽 | 售价(美元) | 免费试用 |
---|---|---|---|---|---|---|
香港服务器1 | E5-2620 | 32G | 1T HDD | 50M/无限流量 | $196.00 | 立即申请 |
香港服务器2 | E5-2650 | 32G | 1T HDD | 50M/无限流量 | $256.00 | 立即申请 |
香港服务器3 | E5-2680 | 32G | 1T HDD | 50M/无限流量 | $316.00 | 立即申请 |
香港服务器4 | E5-2690 | 32G | 1T HDD | 50M/无限流量 | $336.00 | 立即申请 |
香港服务器5 | E5-2697 | 32G | 1T HDD | 50M/无限流量 | $376.00 | 立即申请 |
香港服务器6 | E5-2620*2 | 32G | 1T HDD | 50M/无限流量 | $376.00 | 立即申请 |
香港服务器7 | E5-2650*2 | 32G | 1T HDD | 50M/无限流量 | $436.00 | 立即申请 |
香港服务器8 | E5-2680*2 | 32G | 1T HDD | 50M/无限流量 | $476.00 | 立即申请 |
香港服务器9 | E5-2690*2 | 32G | 1T HDD | 50M/无限流量 | $556.00 | 立即申请 |
香港服务器10 | E5-2697*2 | 32G | 1T HDD | 50M/无限流量 | $596.00 | 立即申请 |
香港服务器11 | E5-2680v4*2 | 32G | 1T HDD | 50M/无限流量 | $696.00 | 立即申请 |
香港服务器12 | E5-2698v4*2 | 32G | 1T HDD | 50M/无限流量 | $796.00 | 立即申请 |
nginx的安装这里就不在介绍。
1、配置DSPAM虚拟主机:
# vi /etc/nginx/conf.d/vhost_dspam.conf内容如下:server { listen 80; server_name dspam.extmail.org; access_log/var/log/dspam/access.log; error_log /var/log/dspam/error.log; root/usr/share/dspam/webui/cgi-bin; index dspam.cgi; location ~ .cgi$ { gzip off; fastcgi_pass 127.0.0.1:8899; fastcgi_index dspam.cgi; fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name; fastcgi_param REMOTE_USER $remote_user; auth_basic "DSPAM Restricted Site"; auth_basic_user_file/usr/share/dspam/webui/cgi-bin/.htpasswd; include /etc/nginx/fcgi.conf; }}2、编辑fcgi.conf文件# vi /etc/nginx/fcgi.conf内容如下:fastcgi_param GATEWAY_INTERFACE CGI/1.1;fastcgi_param SERVER_SOFTWARE nginx;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 $document_root$fastcgi_script_name;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 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;3、修改dspam_webui的配置文件# cp /usr/share/dspam/webui/htdocs/*/usr/share/dspam/webui/cgi-bin/# vi /usr/share/dspam/webui/cgi-bin/configure.pl修改内容如下:$CONFIG{'WEB_ROOT'} = "./";二、配置FCGI配置Nginx支持perl FCGIperl-cgi脚本参考nginx官方文档,网上也有很多这方面的脚本下载http://wiki.nginx.org/SimpleCGI1、安装perl FCGI# perl -MCPAN -e 'install FCGI::ProcManager'# wget http://blog.dspam.org.cn/mail/cgiwrap-fcgi.pl.tgz -P/usr/local/bin/# cd /usr/local/bin/# tar zxvf cgiwrap-fcgi.pl.tgz# chmod +x cgiwrap-fcgi.pl# ./cgiwrap-fcgi.pl > /dev/null 2>&1 vi /etc/rc.local添加以下内容:/usr/local/bin/cgiwrap-fcgi.pl > /dev/null 2>&1 &备注:如果非EMOS环境或没有安装perl-FCGI的,请用下面办法自行安装# perl -MCPAN -e 'install FCGI'2、启动Nginx服务# service httpd stop# service dspam-webd stop# chkconfig httpd off# chkconfig dspam-webd off# service nginx start# chkconfig nginx on三、备注:配置extmail虚拟主机1、配置extmail虚拟主机# vi /etc/nginx/conf.d/vhost_extmail.conf内容如下:server { listen 80; server_name mail.extmail.org; index index.html index.htm index.php index.cgi; root /var/www/extsuite/extmail/html; access_log /var/log/extmaillog.log; location /extmail/cgi { fastcgi_pass 127.0.0.1:8888; fastcgi_index index.cgi; include /etc/nginx/fcgi.conf; } location /extmail { alias /var/www/extsuite/extmail/html/; } location /extman/cgi { fastcgi_pass 127.0.0.1:8888; fastcgi_index index.cgi; include /etc/nginx/fcgi.conf; } location /extman { alias /var/www/extsuite/extman/html/; }}
2、启动服务# /usr/sbin/nginx -s reload# /var/www/extsuite/extmail/dispatch-init start# vi /etc/rc.local添加以下内容:/var/www/extsuite/extmail/dispatch-init start