View RSS Feed

บล็อกโพสต์ล่าสุด

  1. nginx + php-fpm + debian squeeze tutorial - the fastest way to host php!

    โดย เมื่อ 06-16-2011 เวลา 16:43:09
    Here is a quick howto for setting up nginx and php-fpm on a Debian 6 VPS. We will be using the dotdeb repository for this so a big thanks goes to the dotdeb guys for building such reliable Debian packages.

    This has been tested on a Debian 6 OpenVZ minimal template:
    First add the dotdeb repo to your sources.list file:
    Code:
    nano /etc/apt/sources.list
    add this to the bottom of the file:
    Code:
    deb http://packages.dotdeb.org stable all
    Next, add the GnuPG key to your distribution:
    Code:
    wget http://www.dotdeb.org/dotdeb.gpg
    cat dotdeb.gpg | sudo apt-key add -
    rm dotdeb.gpg
    Update APT:
    Code:
    apt-get update
    Install php and php-fpm plus some common addons:
    Code:
    apt-get install php5 php5-fpm php-pear php5-common php5-mcrypt php5-mysql php5-cli php5-gd
    Install nginx:
    Code:
    apt-get install nginx
    Tweak the php-fpm configuration:
    Code:
    nano
    ...
    ป้ายกำกับ: debian, Nginx, php-fpm เพิ่ม / แก้ไข ป้ายกำกับ
    หัวข้อ
    How To , Linux , Software
  2. เพิ่มความแรงให้ Server Debian Directadmin ด้วย Nginx

    โดย เมื่อ 03-01-2011 เวลา 23:43:38
    ขั้นตอนการทำให้ Directadim ของเราทำตามแนวคิดที่ว่ามานี้

    ก่อนอื่นเรามาเพิ่มประสิทธิภาพของ Apache กับ PHP ด้วย Fcgi กันก่อน ไปที่ blog คุณ Icez ตาม link นี้ http://www.icez.net/...gid-php-fastcgi (หากไม่ใช้ fcgi ก็ไม่ต้องติดตั้งก็ได้ครับ)

    เอาหละถ้าใครทำเสร็จแล้วเราก็มาต่อกันเลย (อันนี้ผมทำใน Debian นะครับพอดีผมไม่ได้เล่น centos ใครใช้ centos วิธีการคงไม่ต่างกันมาก)

    ก่อนอื่นสั่งติดตั้ง NGINX ก่อนด้วย
    Code:
    aptitude install nginx
    centos ใช้
    Code:
    yum install nginx
    จากนั้นแก้ไขไฟล์ config
    nano /etc/nginx/nginx.conf

    user apache apache;
    worker_processes 4;
    worker_rlimit_nofile 150000;

    error_log /var/log/nginx/error_log;

    pid /var/run/nginx/nginx.pid;

    events {
    worker_connections 25000;
    }
    ...
    หัวข้อ
    How To , Linux , Software
  3. MRTG monitoring script for nginx

    โดย เมื่อ 08-14-2010 เวลา 14:33:55
    สร้างไฟล์ /root/bin/mrtg-nginx.pl ข้อมูลตามนี้
    โค้ด PHP:
    #!/usr/bin/perl
    # $Revision: 2 $
    # $Date: 2008-09-12 15:11:40 +0300 (Fri, 12 Sep 2008) $
     
    my %opt = (
    # http link to nginx stub_status, be sure turn on stub_status in nginx conf
        
    nginx_status   => 'http://localhost:80/status',
    # path for program what may dump web page, normaly lynx -dump
    #    lynx            => 'lynx -dump',
        
    lynx            => 'wget -q -Y off -O -',
    );
     
    $opt{var} = $ARGV[0] if $ARGV[0];
    $opt{nginx_status} = $ARGV[1] if $ARGV[1] and $ARGV[1]=~/^http:\/\/\w+/;
    $opt{var} ||= '';
     
    my $do = `$opt{lynx} $opt{nginx_status}`;
     
    if (
    $opt{var} eq 'req') {
        
    $do=~/^Active connections:\s*(\d+)\s*$/ms or warn "Error! Can't find data!\nIN :\n$do";
        
    $opt{d2} = $opt{d1} = $1;
    }
    elsif ($opt{var} eq 'con') {
        
    $do=~/^\s*(\d+)\s+(\d+)\s+(\d+)\s*$/ms or warn "Error! Can't find data!\nIN 
    ...
    ป้ายกำกับ: moniter, mrtg, Nginx เพิ่ม / แก้ไข ป้ายกำกับ
    หัวข้อ
    How To , Linux , Windows
  4. Nginx, MySQL, and PHP5 on an Ubuntu & Debian server

    โดย เมื่อ 02-03-2010 เวลา 17:09:54
    After using Lighttpd for a couple of months, I wasn’t really happy with it, so I have decided to move from Lighttpd to Nginx, which is another open-source lightweight web server. In this tutorial, I am going to go over setting up Nginx, MySQL, and PHP5 on an Ubuntu server.
    1. Install Nginx

    Code:
    aptitude install nginx
    For some reason Nginx does not start automatically when it is installed, so we need to start Nginx.
    Code:
    /etc/init.d/nginx start
    Now we want to make sure that Nginx installed properly. Open your web browser and point it to your servers IP address. If all is working fine you should see a page that says “Welcome to nginx!”


    2. Install MySQL

    Code:
    aptitude install mysql-server mysql-client
    3. Install PHP5

    Code:
    aptitude install php5-cgi php5-mysql php5-curl php5-gd  php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache  php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp  php5-sqlite php5-tidy
    ...
    ป้ายกำกับ: and PHP5, mysql, Nginx, on an Ubuntu & Debian server เพิ่ม / แก้ไข ป้ายกำกับ
    หัวข้อ
    How To , Linux

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90