Mar212013
nginx 虚拟主机配置文件
server
{
listen 192.168.12.215:80;
server_name default;
index index.php index.html index.htm;
root /www/server_manage;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
阅读全文
抢沙发
Mar212013
nginx配置文件
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_use...阅读全文
Mar182013
Nginx防止SQL注入攻击配置方法
我们用得最多的无非就是使用php,asp,asp.net这种代码来实现sql防注入攻击,下面我来介绍如何在Nginx防止SQL注入攻击配置方法
防御原理:
1. 通过以上配置过滤基本的url中的注入关键字;
2. 当然,数据库中的用户密码得加密存放 ;
3. php程序进行二次过滤,过滤GET和POST变量中的关键字;
4. 生产环境关闭PHP和MySQL的错误信息。
SQL注入攻击一般问号后面的请求参数...阅读全文
Dec062012
Discuz模板引擎标签
Discuz模板引擎标签
Discuz! 的模板采用近似 PHP 表达式的语法,支持的元素如下:
1. <!–{ … }–>
逻辑元素包围符,该符号用于包含条件和循环元素,其中:
<!–{if expr1}–>
statement1
<!–{elseif expr2}–>
statement2
<!–{else}–>
statement3
<!–{/if}–>
为一个...阅读全文
Nov252012
ecshop用于nginx下的伪静态规则
location ~* ^.+\.(bak|inc|lib|sh|tpl|lbi|dwt)$
{
deny all;
}
location /
{
rewrite "^(.*)/index.html$" $1/index.php last;
rewrite "^(.*)/category$" $1/index.php last;
# access any object by its numeric identifier
rewrite "^(.*)/feed-c([0-9]+).xml$" $1/feed.php?cat=$2 last;
rewrite "^(.*)/feed-b([0-9]+).xml$" $1/feed.php?brand=$2 last;
rewrite...阅读全文
Oct222012
php获取某网站的快照时间
<html>
<head>
<title>在线演示_php获取某网站的快照时间 http://blog.qita.in</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="百度,baidu,查询快照结果">
<meta name="description" content="php查询网站快照日期: by enenba.com">
</head>
<body>
<?...阅读全文
Oct222012
php获取百度关键词查询结果总数
<html>
<head>
<title>在线演示_php获取百度关键词查询结果总数</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="百度,baidu,查询结果">
<meta name="description" content="php获取百度关键词查询结果总数 by enenba.com">
</head>
<body>
<?php $k=is...阅读全文
Aug122012
snoopy(强大的PHP采集类) 详细介绍
Snoopy是一个php类,用来模拟浏览器的功能,可以获取网页内容,发送表单,可以用来开发一些采集程序和小偷程序,本文章详细介绍snoopy的使用教程。
Snoopy的一些特点:
抓取网页的内容 fetch
抓取网页的文本内容 (去除HTML标签) fetchtext
抓取网页的链接,表单 fetchlinks fetchform
支持代理主机
支持基本的用户名/密码验证
支...阅读全文
Aug082012
linux 防火墙操作
Linux代码
[root@localhost ~]# vi /etc/sysconfig/iptables
添加一行使其开放5433端口。
Linux代码
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5433 -j ACCEPT
然后重启服务使改动生效
[root@localhost ~]# service iptables restart
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: fi...阅读全文
Aug042012
PHP header发送各种类型文件下载
<?php
header('Content-type: application/image/pjpeg');//输出的类型
header('Content-Disposition: attachment; filename="downloaded.jpg"'); //下载显示的名字,注意格式
readfile('my.jpg');
// 并将这个文件以前面header发送信息设定的类型输出,从而会弹出一个下载框
// 就是把服务器上的my.jpg下载下来,下载显示和保存的名字默认是downloaded.jpg
?>
附带文档类型及...阅读全文