存档

‘Web服务器’ 分类的存档

[Original]设置默认虚拟主机,防止非法域名绑定

2010年8月12日 1 条评论

有些站点,经常因为被别人绑定了未备案的域名,遭电信关闭IP。该规则,也经常被竞争对手恶意利用。因此,对Web Serve设置默认虚拟主机,来屏蔽非法域名很重要。


  • Nginx的做法

添加以下server zone

server {
listen 80 default;
return 500;
}

或者是将非法域名的访问重定向

阅读全文…

分类: Web服务器 标签: ,

[Collection]Rewrite Rules for WordPress Mu

2010年8月3日 没有评论

1. WordPress Mu后台开启永久链接功能

后台-设置-永久链接-自定义结构-/blog/archives/%post_id%

2. 修改Nginx.conf,加入rewrite rules

location / {

       index index.html index.htm index.php;

       root /data0/data_www/hangyan.com/wp;

#on server block

##necessary if using a multi-site plugin

server_name_in_redirect off;

##necessary if running Nginx behind a reverse-proxy

port_in_redirect off;

rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;

if (!-e $request_filename) {

  rewrite ^.+?(/wp-.*) $1 last;

  rewrite ^.+?(/.*\.php)$ $1 last;

  rewrite ^ /index.php last;

}

}

分类: Web服务器 标签:

[Original]有进程僵死,长期驻留在后台,杀不了

2010年6月10日 没有评论

故障现象

某Web服务器,突然出现以下问题,php-cgi僵死在进程里,无法重启

www 9463 0.0 0.3 41996 13612 ? D Apr19 1:22 /usr/local/php/bin/php-cgi –fpm
www 20858 0.0 0.3 40408 12932 ? D May05 1:55 /usr/local/php/bin/php-cgi –fpm
www 20866 0.0 0.3 40688 13296 ? D May05 1:53 /usr/local/php/bin/php-cgi –fpm
www 20878 0.0 0.3 40932 13604 ? D May05 1:51 /usr/local/php/bin/php-cgi –fpm
www 24288 0.0 0.3 40436 12880 ? D Apr15 2:36 /usr/local/php/bin/php-cgi –fpm
www 26881 0.0 0.3 41596 13712 ? D Apr16 6:11 /usr/local/php/bin/php-cgi –fpm
www 26921 0.0 0.3 43224 15848 ? D Apr16 5:57 /usr/local/php/bin/php-cgi –fpm
www 26983 0.0 0.3 42736 14524 ? D Apr16 6:01 /usr/local/php/bin/php-cgi –fpm
www 27007 0.0 0.3 42608 14248 ? D Apr16 6:01 /usr/local/php/bin/php-cgi –fpm
www 27023 0.0 0.3 42464 15172 ? D Apr16 5:57 /usr/local/php/bin/php-cgi –fpm

处理过程

阅读全文…

分类: Web服务器, 系统架构 标签:

[Original]主WEB服务器web service中断以及自动启动项不会up的问题

2010年5月6日 没有评论

# 查看默认的运行级别,Debian系默认运行级别为2,Redhat系默认运行级别为3

[11:34:29.9] root@webserver:/usr/local/webserver/nginx# runlevel

[11:34:31.8] N 2webserverwebserver

阅读全文…

[Original]不能利用php的mail函数发送邮件的解决

2010年4月29日 没有评论

程序员反映在sun.xmnn.cn(192.168.96.55)不能利用PHP的mail()函数发送邮件。已解决。

设置步骤如下,

阅读全文…

分类: Web服务器 标签: , ,

[Original]sqweb2的502.bad.gateway处理

2010年4月15日 没有评论

故障现象

访问页面出现(502)bad gateway,或者(403)Access Forbid错误.

部分错误日志

Apr 15 00:30:41 sqweb2 kernel: lockd: server 192.168.96.50 not responding, timed out

Apr 15 00:31:21 sqweb2 last message repeated 10 times

Apr 15 00:32:31 sqweb2 last message repeated 21 times

Apr 15 00:33:41 sqweb2 last message repeated 17 times

主交换 CPU在10%左右,MEM在20-30%之间波动

阅读全文…

[Collection]IIS 7.5应用Tips

2010年1月26日 没有评论

1.IIS7.5启用目录列表

常用于FTP站点,范例:http://ftp.99dev.net

Scenario:  Let’s say I want to enable directory browsing for a special directory on my site, how do I enable that?  It’s as easy as:

1) create (or edit) the web.config file in your site’s home directory

2) edit it as follows:

阅读全文…

分类: Web服务器 标签:

[Original]PHP服务器时间校对

2009年12月14日 没有评论

一些LAMP论坛,经常遇到这样的问题,页面显示时间和本地实际时间相差8小时或者更多

1.修改系统市区设置

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2.使用ntpdate同步服务器时间

ntpdate time.api.bz

阅读全文…