php部分编译的方式安装扩展模块

[~ /]#cd /pkg/ext/mysqli
[~ mysqli]#/prefix/php/bin/phpize
[~ mysqli]#./configure -–prefix=/usr/local/mysqli -–with-php-config=/usr/local/php/bin/php-config -–with-mysqli=/usr/local/mysql/bin/mysql_config
[~ mysqli]#make
[~ mysqli]#make install[......]

Read more

nginx里rewrite的用法简单说明

ReWrite 语法
last – 基本上都用这个Flag。
break – 中止Rewirte,不在继续匹配
redirect – 返回临时重定向的HTTP状态302
permanent – 返回永久重定向的HTTP状态301
可以用来判断的表达式:
-f和!-f用来判断是否存在文件
-d和!-d用来判断是否存在目录
-e和!-e用来判断是否存在文件或目录
-x和!-x用来判断文件是否可执行[......]

Read more

nginx里location的用法简单说明

语法解释:
= 开头表示精确匹配
/和^~ 开头表示常规字符串
~ 开头表示区分大小写的正则匹配
~* 开头表示不区分大小写的正则匹配
!~ 和 !~* 分别为区分大小写不匹配及不区分大小写不匹配 的正则[......]

Read more

nginx配置文件中可用的全局变量中文说明

$arg_PARAMETER #这个变量包含GET请求中,如果有变量PARAMETER时的值。
$args #这个变量等于请求行中(GET请求)的参数,例如foo=123&bar=blahblah;
$binary_remote_addr #二进制的客户地址。
$body_bytes_sent #响应时送出的body字节数数量。即使连接中断,这个数据也是精确的。
$content_length #请求头中的Content-length字段。
$content_type #请求头中的Content-Type字段。[......]

Read more

nginx配置文件中文详细介绍

#指定错误日志级别
#error_log logs/error.log notice;
#error_log logs/error.log info;
#error_log logs/error.log debug;
#工作模式及连接数上限
events {
#提高linux的io操作选项,Linux系统推荐采用epoll模型,FreeBSD系统推荐采用kequeue,linux下建议开启
use epoll;
#允许最大连接数
worker_connections 51200;
}[......]

Read more

nginx编译安装的中文参数说明

–prefix= – Nginx安装路径。如果没有指定,默认为 /usr/local/nginx。
–sbin-path=
– Nginx可执行文件安装路径。只能安装时指定,如果没有指定,默认为 /sbin/nginx。
–conf-path= – 在没有给定-c选项下默认的nginx.conf的路径。如果没有指定,默认为 /conf/nginx.conf。
–pid-path= – 在nginx.conf中没有指定pid指令的情况下,默认的nginx.pid的路径。如果没有指定,默认为 /logs/nginx.pid。
–lock-path= – nginx.lock文件的路径。
–error-log-path=
– 在nginx.conf中没有指定error_log指令的情况下,默认的错误日志的路径。如果没有指定,默认为 /logs/error.log。
–http-log-path= – 在nginx.conf中没有指定access_log指令的情况下,默认的访问日志的路径。如果没有指定,默认为 /logs/access.log。[......]

Read more

HTTP_REFERER有效和无效的情况

1、以iframe 形式调用地址
2、以window.open调用,打开新页面
3、使用window.location.replace在Firefox 和Chrome下可以获取HTTP_REFERER
4、使用window.location.href在Firefox 和Chrome下可以获取HTTP_REFERER
5、使用A标签跳转可以获取HTTP_REFERER(推荐用js实现click事件)[......]

Read more

nginx用作负载均衡的编译安装及配置过程

http {
upstream myproject {
server 127.0.0.1:8000 weight=3;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
}

server {
listen 80;
server_name www.libaqiang.com;
location / {
proxy_pass http://myproject;
}
}[......]

Read more

编译安装php的参数说明

./configure –enable-fastcgi –enable-fpm –with-mcrypt –with-zlib –enable-mbstring –disable-pdo –with-pgsql –with-curl –disable-debug –enable-pic –disable-rpath –enable-inline-optimization –with-bz2 –with-xml –enable-sockets –enable-sysvsem –enable-sysvshm –enable-pcntl –enable-mbregex –with-mhash –enable-xslt –enable-memcache –enable-zip –with-pcre-regex[......]

Read more

nginx+php-fpm+apc+mysql编译安装

预装包
$apt-get install make bison flex gcc patch autoconf subversion locate
$apt-get install libpcre3-dev libssl-dev libmhash-dev libmhash2 libpq-dev libpq5 libsyck0-dev
$apt-get install libtidy-dev curl libcurl4-openssl-dev libcurl3 \
libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 \
libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 \
libjpeg62-dev libpng12-0 libpng12-dev zlib1g zlib1g-dev libfreetype6 \
libfreetype6-dev libbz2-dev libxpm-dev libmcrypt-dev libmcrypt4 \
sqlite3 bzip2 build-essential libreadline5-dev libedit-dev autoconf[......]

Read more