Warning: Undefined array key "cperpage" in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 255

Warning: Undefined variable $output in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 325

Warning: Undefined variable $fixed_tags in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 326

Warning: Undefined variable $isshowdots in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 327

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 330

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 333

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 336

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $more_text_link in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345
nginx – 理想社会

标签: nginx

  • nginx打开目录浏览功能

    打开nginx.conf文件,在location server 或 http段中加入
    autoindex on;
    另外两个参数最好也加上去:

    autoindex_exact_size off;
    默认为on,显示出文件的确切大小,单位是bytes。
    改为off后,显示出文件的大概大小,单位是kB或者MB或者GB

    autoindex_localtime on;
    默认为off,显示的文件时间为GMT时间。
    改为on后,显示的文件时间为文件的服务器时间

  • Netstat命令详解 如何关闭TIME_WAIT连接 如何查看nginx的访问流量

    做计算机管理员,我们都必要了解一下netstat这个命令,它是一个查看网络连接状态的工具,在windows下也默认有这个工具。
    Netstat命令详解 netstat命令怎样使用 如何关闭TIME_WAIT连接 如何统计web服务器的访问量 如果查看nginx的访问流量?

    下面我们来看看它主要的用法和详解!
    (netstat -na 命令),本文主要是说Linux下的netstat工具,然后详细说明一下各种网络连接状态。
    netstat -nat |awk ‘{print $6}’|sort|uniq -c|sort -nr
    1.netstat命令详解
    其实我常用的是 netstat -tnl | grep 443 (查看443端口是否被占用),如果有当前是root用户,我喜欢用netstat -pnl | grep 443 (还可显示出占用本机443端口的进程PID)。 (更多…)

  • nginx中status的解释

    nginx中有个status页面信息。以前一直没注意。今天‘狗狗’了一下。在此总结下心得。

    nginx 服务器status页面信息如下:

    Active connections: 220
    server accepts handled requests
    9975450 9975450 14928953
    Reading: 1 Writing: 1 Waiting: 208 (更多…)

  • LNAMP 1.0 alpha 一键安装包

    LNAMP 1.0 final changelog:

    1、将setupvm-without-pure- ftp.sh和setupvm-with-pure-ftp.sh两个文件合并为setup-vhost.sh一个文件,执行./setup- vhost.sh后将会有1. setup virtual host without using ftp service和2. setup virtual host with ftp service两个选项,从而根据需要创建自己的虚拟主机;

    2、将beta版中的suhosin extension改为了suhosin patch;

    3、将CentOS、Debian和Ubuntu下的安装文件集中压缩成一个包LNAMP_1.0_final.tar.gz

    4、规范书写了程序,增强了兼容性(尤其是增加了对burst.net vps的支持);

    5、更正了beta版中的几个bug;

    6、……。

    LNAMP一键安装包是什么?

    LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RadHat VPS(VDS)或独立主机安装LNAMP(Nginx、Apache、Mysql、PHP、Pure-ftp)生产环境的Shell程序。此Shell 程序以Nginx做服务器前端,Apache做服务器后端,各自充分发挥各自的长处。Nginx在处理静态内容上较Apache是几倍或几十倍的差异,因 而放在前面过滤静态内容是最为恰当的,同时Nginx也是一个负载均衡器,低资源消耗,高性能转发是它的特点。经过Nginx在前面的过滤,后端的 Apache需要处理的内容相对就比较少了,只需负责处理动态内容就可以了。在性能与稳定性的权衡下,使用Nginx+Apache搭配会让它们在各自擅 长的领域展现自身的价值。

    为什么不使用nginx+php(fastcgi)作为生产环境?

    1、   php(fastcgi)不够稳定,经常出现502错误,生成相对复杂的页面没有优势,反而会使php-cgi进程变为僵尸进程.

    2、   安全性,多用户多站点权限问题.php(fastcgi)在应对多用户多站点往往捉襟见肘,不易于实施.

    3、   整合其他开发语言,apache表现得游刃有余.资源利用恰到好处.

    4、   ……

    如何获取LNAMP?

    你可以从http://www.31sky.net/soft/LNAMP_1.0_final.tar.gz下载并使用它。

    安装了那些软件?

    Apache、Nginx、Mysql、Pure-ftp、Zend Optimizer、eAccelerator、Memcache……

    如何安装LNAMP?

    系统需求:

    1、  需要5G剩余硬盘空间。

    2、  256M以上内存。

    3、  需要以root身份运行。

    安装步骤:

    1、  下载LNAMP一键安装包 wget –c http://www.31sky.net/soft/LNAMP_1.0_final.tar.gz 。

    2、  解压tar zxvf  LNAMP_1.0_final.tar.gz,您将得到CentOS、Debian和Ubuntu这三个文件夹,根据服务器选择的系统切换到相应目录 下,目录中将有五个文件,main-install.sh是基本安装脚本;eaccelerator-install.sh(用于安装 eaccelerator)、ZendOptimizer-install.sh(用于安装Zend Optimizer)和pure-ftp-install.sh(用于安装pureftpd)是可选的安装脚本;setup-vhost.sh是用于创建 virtual host的脚本。

    3、  赋予main-install.sh、eaccelerator-install.sh、ZendOptimizer-install.sh、pure- ftp-install.sh和setup-vhost.sh这五个文件可执行权限,chmod +x *.sh。

    4、  执行脚本./main-install.sh和您选择的安装脚本,将会自动安装各种程序。

    image

    1、设置初始信息

    image

    2、开始下载源代码

    image

    3、开始编译安装

    image

    4、安装完成

    如何管理?

    1、  Nginx管理:/etc/init.d/nginx {start|restart|stop} (注:执行/etc/init.d/nginx时会对httpd起作用)

    2、  Apache管理:/etc/init.d/httpd {start|restart|stop}

    3、  启动pure-ftp:/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf –daemonize

    4、  创建virtual host:./setup-vhost.sh,将有两个选项1和2(1、不提供ftp服务2、提供ftp服务,请根据需要选择),输入域名、ip、FTP用户名等相关信息即可。

    5、PHP探针URL:http://{your ip address}/p.php

    6、phpMyAdmin URL:http://{your ip address}/phpmyadmin

    说明:

    1、本shell脚本全部采用源码编译安装,装完全部软件大概需要45分钟。

    2、本shell脚本在directspace.net 的openvz VPS上CentOS 5 32bit、Debian 5.0 x86 (Minimal)、Ubuntu 10.04 32bitburst.net 512M VPS上的CentOS-5-x86、debian-5.0-x86、ubuntu-10.04-x86成功安装。

    3、本shell脚本所需要的软件源码全部从官方下载或者sourceforge.net下载,您可以从http://www.31sky.net/soft/下载查看全部源代码。

    4、本shell如有BUG或者其他任何问题,请到http://www.31sky.net/lnamp留言或者直接发邮件到webmaster@31sky.net

  • nginx实现404状态返回200隐藏URL

    server
    {
    listen       80;
    server_name  aaa.bbb.com;
    charset gb2312;
    index index.php index.html;
    root   /data/www/wwwroot/aaa.bbb.com;
    error_page 404 =200 /.404.jpg;
    //注:上传一个404.jpg文件到aaa.bbb.com的根目录, 并改名为.404.jpg

  • Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器

    [文章作者:张宴 本文版本:v6.0 最后修改:2010.03.04 转载请注明原文链接:http://blog.s135.com/nginx_php_v6/]

    前言:本文是我撰写的关于搭建“Nginx + PHP(FastCGI)”Web服务器的第6篇文章。本系列文章作为国内最早详细介绍 Nginx + PHP 安装、配置、使用的资料之一,为推动 Nginx 在国内的发展产生了积极的作用。本文可能不断更新小版本,请记住原文链接“http://blog.s135.com/nginx_php_v6/”, 获取最新内容。第6篇文章主要介绍了Nginx 0.8.x新的平滑重启方式,将PHP升级到了5.2.13,修正了PEAR问题。另将MySQL 5.1.x升级到了5.5.x系列,配置文件变更较大。 (更多…)

  • linuxas5和as4下nginx+php+myql+zend等(转)

    编译安装软件包
    源码编译安装所需包(Source)
    升级OpenSSL及OpenSSH       tar xvf openssl-0.9.8h.tar.gz
    cd openssl-0.9.8h
    ./config –prefix=/usr/local/openssl
    make
    make test
    make install
    tar zxvf openssh-5.0p1.tar.gz
    cd openssh-5.0p1
    ./configure  
    –prefix=/usr
    –with-pam
    –with-zlib
    –sysconfdir=/etc/ssh
    –with-ssl-dir=/usr/local/openssl
    –with-md5-passwords (更多…)