- 浏览: 400165 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
wcjagta:
...
dedecms插件开发教程 -
xc2013:
看起来不错 先下载来试试
ECSHOP完全静态化解决方法 -
greemranqq:
你好,我在xp 上做实验,也是JS css带不过来,关于 ro ...
nginx资源定向 css js路径问题 -
hotsmile:
表结构给出来吧,测试的提示说要注册,
中国移动CMPP短信开发平台通讯包 2.8 -
mengdejun:
gang80306176 写道这个插件怎么用和安装普通插件一样 ...
phpcms2008 sp4单网页编辑器插件
nginx.conf
worker_processes 5;
error_log logs/error.log;
error_log logs/error.log info;
events {
use kqueue;
worker_connections 2048;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;
log_format main ‘$remote_addr – $remote_user [$time_local] $request ‘
‘”$status” $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;
access_log logs/access.log main;
sendfile on;
keepalive_timeout 65;
tcp_nopush on;
upstream proxy {
server 192.168.0.2:80 weight=2;
server 192.168.0.3:80;
}
server {
listen 80;
server_name my.example.com 192.168.0.1;
access_log logs/my.example.com.access.log main;
location /status {
stub_status on;
access_log off;
allow 192.168.0.1;
deny all;
}
location / {
root /usr/local/www/status;
index index.php;
allow 192.168.100.1;
deny all;
}
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-fastcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/status$fastcgi_script_name;
include fastcgi_params;
}
location /nagios {
root /usr/local/www;
allow 192.168.100.1;
deny all;
}
location ~ \.cgi$ {
root /usr/local/www/nagios/cgi-bin;
rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;
fastcgi_index index.cgi;
allow 192.168.100.1;
deny all;
fastcgi_pass unix:/tmp/perl_cgi-dispatch.sock;
fastcgi_param HTTP_ACCEPT_ENCODING gzip,deflate;
fastcgi_param SCRIPT_FILENAME /usr/local/www/nagios/cgi-bin$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name proxy.example.com;
access_log logs/proxy.example.com.access.log main;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://proxy;
}
}
}
nginx-rrd.conf
#####################################################
#
# dir where rrd databases are stored
RRD_DIR=”/var/spool/nginx-rrd”;
# dir where png images are presented
WWW_DIR=”/usr/local/www/status”;
# process nice level
NICE_LEVEL=”-19″;
# bin dir
BIN_DIR=”/usr/sbin”;
# servers to test
# server_utl;server_name
SERVERS_URL=”http://my.example.com/status;my.example.com http://192.168.0.2/status;2″
fastcgi-php (creates php fastcgi socket, executable init script for FreeBSD, can be ported easily to other systems)
. /etc/rc.subr
name=”fcgiphp”
rcvar=`set_rcvar`
load_rc_config $name
: ${fcgiphp_enable=”NO”}
: ${fcgiphp_bin_path=”/usr/local/bin/php-cgi”}
: ${fcgiphp_user=”www”}
: ${fcgiphp_group=”www”}
: ${fcgiphp_children=”10″}
: ${fcgiphp_port=”8002″}
: ${fcgiphp_socket=”/tmp/php-fastcgi.sock”}
: ${fcgiphp_env=”SHELL PATH USER”}
: ${fcgiphp_max_requests=”500″}
: ${fcgiphp_addr=”localhost”}
pidfile=/var/run/fastcgi/fcgiphp.pid
procname=”${fcgiphp_bin_path}”
command_args=”/usr/local/bin/spawn-fcgi -f ${fcgiphp_bin_path} -u ${fcgiphp_user} -g ${fcgiphp_group} -C ${fcgiphp_children} -P ${pidfile}”
start_precmd=start_precmd
stop_postcmd=stop_postcmd
start_precmd()
{
PHP_FCGI_MAX_REQUESTS=”${fcgiphp_max_requests}”
FCGI_WEB_SERVER_ADDRS=$fcgiphp_addr
export PHP_FCGI_MAX_REQUESTS
export FCGI_WEB_SERVER_ADDRS
allowed_env=”${fcgiphp_env} PHP_FCGI_MAX_REQUESTS FCGI_WEB_SERVER_ADDRS”
# copy the allowed environment variables
E=”"
for i in $allowed_env; do
eval “x=\$i”
E=”$E $i=$x”
done
command=”env – $E”
if [ -n "${fcgiphp_socket}" ]; then
command_args=”${command_args} -s ${fcgiphp_socket}”
elif [ -n "${fcgiphp_port}" ]; then
command_args=”${command_args} -p ${fcgiphp_port}”
else
echo “socket or port must be specified!”
exit
fi
}
stop_postcmd()
{
rm -f ${pidfile}
# eval “ipcs | awk ‘{ if (\$5 == \”${fcgiphp_user}\”) print \”ipcrm -s \”\$2}’ | /bin/sh”
}
run_rc_command “$1″
perl-fcgi.pl (creates perl socket) – you need the FCGI perl module for this
#!/usr/bin/perl
use FCGI;
#perl -MCPAN -e ‘install FCGI’
use Socket;
#this keeps the program alive or something after exec’ing perl scripts
END() { } BEGIN() { }
*CORE::GLOBAL::exit = sub { die “fakeexit\nrc=”.shift().”\n”; }; eval q{exit}; if ($@) { exit unless $@ =~ /^fakeexit/; } ;
&main;
sub main {
#$socket = FCGI::OpenSocket( “:3461″, 10 ); #use IP sockets
$socket = FCGI::OpenSocket( “/tmp/perl_cgi-dispatch.sock”, 10 ); #use UNIX sockets – user running this script must have w access to the ‘nginx’ folde
r!!
$request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%req_params, $socket );
if ($request) { request_loop()};
FCGI::CloseSocket( $socket );
}
sub request_loop {
while( $request->Accept() >= 0 ) {
#processing any STDIN input from WebServer (for CGI-POST actions)
$stdin_passthrough =”;
$req_len = 0 + $req_params{’CONTENT_LENGTH’};
if (($req_params{’REQUEST_METHOD’} eq ‘POST’) && ($req_len != 0) ){
while ($req_len) {
$stdin_passthrough .= getc(STDIN);
$req_len–;
}
}
#running the cgi app
if ( (-x $req_params{SCRIPT_FILENAME}) && #can I execute this?
(-s $req_params{SCRIPT_FILENAME}) && #Is this file empty?
(-r $req_params{SCRIPT_FILENAME}) #can I read this file?
){
foreach $key ( keys %req_params){
$ENV{$key} = $req_params{$key};
}
#http://perldoc.perl.org/perlipc.html#Safe-Pipe-Opens
open $cgi_app, ‘-|’, $req_params{SCRIPT_FILENAME}, $stdin_passthrough or print(”Content-type: text/plain\r\n\r\n”); print “Error: CGI app ret
urned no output – Executing $req_params{SCRIPT_FILENAME} failed !\n”;
if ($cgi_app) {print <$cgi_app>; close $cgi_app;}
}
else {
print(”Content-type: text/plain\r\n\r\n”);
print “Error: No such CGI app – $req_params{SCRIPT_FILENAME} may not exist or is not executable by this process.\n”;
}
}
}
发表评论
-
php异步操作类库
2011-06-05 16:01 1777httpclient for php 的选择常用方案有以 ... -
织梦HTTP IMAGE下载类
2011-06-05 14:57 1850<?php if(!defined('DEDEINC ... -
php汉字转拼音
2011-06-05 14:41 1569<?php /**************** ... -
PHP采集利器:Snoopy 试用心得
2011-06-05 14:34 14015Snoopy是一个php类,用 ... -
php异步调用 提高用户体验
2011-05-30 14:22 1288这是我的一个技术很好的朋友写的,要我发表在我的博客上可让php ... -
PHP 异步调用 后台调用 持续执行 断开连接/浏览器
2011-05-26 10:31 1676标题很怪,因为我也 ... -
php socket模拟POST GET请求 fsockopen版
2011-05-26 10:14 7338function httpRequestGET($url){ ... -
php socket GET POST提交方法(HttpClient) 框架
2011-05-25 18:29 5511<?php /* Version 0.9, 6th ... -
mantis
2011-05-25 09:50 1246mantis 缺陷管理平台Mantis,也做Mantis ... -
Curl参数一览
2011-05-06 17:30 1443* 目录 1. 介绍 ... -
PHPRPC
2011-04-24 11:01 1286PHPRPC 是一个轻型的、安全的、跨网际的、跨语言的、跨平台 ... -
PHP身份证验证程序
2011-04-24 10:56 1238<?php // 计算身份证校验码,根据国家标准GB 116 ... -
nginx 502 Bad Gateway 错误问题收集
2011-04-23 09:43 1722502是FastCGI出现问题,所以从FastCGI配置入手。 ... -
深入理解PHP内存管理之谁动了我的内存
2011-04-12 21:57 824首先让我们看一个问题: ... -
socket模拟post表单
2011-04-11 15:40 2767post的本质就是发送给目的程序一个标志为post的协议串如下 ... -
OAUTH协议
2011-04-09 09:59 1060OAUTH协议为用户资源的 ... -
nginx/windows: 让nginx以服务的方式运行
2011-04-09 09:33 1122在windows下安装了nginx, 郁闷是发现它没有以服 ... -
ThinkPHP处理海量数据分表机制详细代码
2011-04-07 18:27 7168应用ThinkPHP内置的分表算法处理百万级用户数据. ... -
php 分库分表hash算法
2011-04-07 18:16 1669//分库分表算法 function calc_hash_d ... -
Nginx location 指令的使用(中文翻译)
2011-04-06 20:31 1124location syntax: location [=|~ ...
相关推荐
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processes 1; #全局错误日志及PID文件 error_log /var/log/...
nginx负载均衡配置文件实例:基本配置说明文档和一个配置好的nginx.conf文件实例
报错内容:sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory 启动时如果报异常error while loading shared libraries: libpcre.so....
我们喜欢NGINX,因为: 内存使用率低高并发异步事件驱动架构负载均衡反向代理具有缓存的FastCGI支持(PHP) 快速处理静态文件带有SNI的TLS / SSL 许多功能具有相应的配置指令。 您可以立即深入研究也可以使用此工具...
nginx配置 nginx配置文件参考 nginx配置文件参考
Nginx配置文件原始版本,这是刚下来的Nginx服务器最原始的版本内容,下载覆盖即可。
Nginx配置文件 nginx.conf 详解doc文档
nginx.conf nginx-1.20.1.tar.gz 这是关于centos8的nginx 和nginx 的配置https文件
Nginx配置文件说明.一些配置文件中详细参数的说明,可以看看。
一个开源的Linux下运行的命令行工具,能将Apache的配置文件转换成相应的Nginx的配置文件。本工具能自动将Apache Web服务器的配置文件转化成Nginx的配置文件,减少WEB服务器迁移的工作量。 该工具从Apache Web服务器...
nginx配置文件修改保存,自动加载重启,并检查配置文件是否修改成功。 Windows下使用nginx,启动之后,再修改配置文件,无需命令重新加载,修改保存配置文件,实时更新nginx重启。
解析nginx配置文件,并将nginx配置文件格式化成对象,方便java程序管理nginx配置。解析配置文件并非使用正则匹配,而是使用语法分析树处理解决的。 标签:nginx
nginx配置文件中斜杠/的6种含义 nginx配置proxy_pass时,/的6种含义+没有/的含义 nginx配置proxy_pass时,斜杠的6种含义,不写斜杠/的含义
nginx -t命令的原始作用是用来验证nginx配置文件格式和配置是否存在异常,通过该命令会输出nginx的配置文件的路径和验证结果,在输出结果中就可以找到当前的nginx的加载的配置文件的地址,如下所示: nginx -t ...
一个完整的nginx配置文件范例参考(含负载均衡)。学习,支持开源,支持nginx
使得notepad++编辑nginx的配置文件(.conf)时,支持语法的高亮显示,非常方便
带有 Nginx 配置的 Python FastCGI 带有 Nginx 配置的 Python FastCGI 脚本。 该脚本基于 WSGI 规范(Web 服务器网关接口),用于连接 Web 服务器和 Python Web 框架/应用程序。 使用最智能的配置与 Nginx 进行负载...
Nginx 的一个突出特点是其灵活优秀的模块化架构,可以在不修改核心的前提下增加任意功能,自2004 年发布至今,已经拥有百余个官方及非官方的功能模块(如fastcgi、memcached、mysql 等),使得Nginx 成长为了一个...
nginx配置文件-安装客户端ip进行转发 具体可查看zip包中的nginx.conf及default.vhosts.conf
linux + apache(nginx) + mysql + php 配置 详解