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
Web – 理想社会

分类: Web

  • nginx打开目录浏览功能

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

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

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

  • Centos5.5下搭建Seedbox

    之前转过一篇关于利用vps来刷pt流量的帖子,里面繁琐的编译安装着实麻烦。很多鞋童看着都头大。
    今天无意间发现transmission更新到2.22。 令人兴奋的是竟然有了rpm安装包。下面我就说说如何安装transmission的rpm包吧。

    Built on CentOS 5.5 i386 (libevent 2.0.10 compiled with “make verify” disabled):
    如果你的系统是32位的,就下载以下5个文件。
    (更多…)

  • 已编译php的情况下,动态添加ftp扩展

    编译php时没有加载ftp扩展 ,有什么方法么
    已经在使用了
    现在已经在跑网站了
    编译php时没有加载ftp扩展 ,有什么方法么
    能不在重新编译的情况下解决么
    现在对方向要ftp 支持图片上传

    # cd /usr/local/src/php-5.2.13/ext/ftp 进入源码目录的相应扩展模块文件夹
    # /usr/local/php-5.2.13/bin/phpize 进入编译好的php相关目录,调用phpize程序生成编译配置文件 (更多…)

  • 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

  • lamp安全加固

    apache方面:
    1.修改banner
    编译源代码,修改默认的banner
    ServerTokens ProductOnly
    ServerSignature Off
    在apache的源码包中找到ap_release.h将
    #define AP_SERVER_BASEPRODUCT “Apache”
    修改为
    #define AP_SERVER_BASEPRODUCT “Microsoft-IIS/6.0”
    os/unix下的os.h文件
    #define PLATFORM “Unix”
    修改为
    #define PLATFORM “Win32“ (更多…)

  • 查看Apache并发请求数及其TCP连接状态

    [文章作者:张宴 本文版本:v1.1 最后修改:2007.07.27 转载请注明出处:http://blog.s135.com]

    这两天搭建了一组Apache服务器,每台服务器4G内存,采用的是prefork模式,一开始设置的连接数太少了,需要较长的时间去响应用户的请求,后来修改了一下Apache 2.0.59的配置文件httpd.conf:

    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves

    StartServers 10
    MinSpareServers 10
    MaxSpareServers 15
    ServerLimit 2000
    MaxClients 2000
    MaxRequestsPerChild 10000

    (更多…)

  • 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系列,配置文件变更较大。 (更多…)