FastCGI (mod_fcgid), Apache2.2, PHP5, APC, XCACHE in WindowsXP

Sesuai dengan request Pak Steven Haryanto di artikel ini, saya akan memposting isi dari httpd.conf apache saya. Untuk modul FastCGI nya, saya memakai mod_fcgid, secara mod_fastcgi yang asli tidak berjalan dengan semestinya di Windows. Proses instalasinya tinggal kopi paste doang dari dokumentasi mod_fcgid, karena emang PHP versi windows udah di compile dengan FastCGI modul enabled.

Instalasi FastCGI

  1. Download mod_fcgid.so versi windows yang precompiled dari ApacheLounge
  2. Kopi file mod_fcgid.so ke direktori modules, secara apache saya keinstall di C:\\Apache2, maka saya kopikan ke direktori C:\\Apache2\modules
  3. Saya edit httpd.conf sesuai dengan dokumentasi
    LoadModule fcgid_module modules/mod_fcgid.so
    DefaultInitEnv PHPRC "C:/php5/"
    DefaultInitEnv PATH "C:/php5;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
    DefaultInitEnv SystemRoot "C:/Windows"
    DefaultInitEnv SystemDrive "C:"
    DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
    DefaultInitEnv TMP "C:/WINDOWS/TEMP"
    DefaultInitEnv windir "C:/WINDOWS"
    
    <Directory "C:/Apache2/htdocs">
        Options +ExecCGI
        AddHandler fcgid-script .php
        FCGIWrapper "C:/php5/php-cgi.exe" .php
    </Directory>
    
  4. Restart apache
  5. Note:
    Baris FCGIWrapper "C:/php5/php-cgi.exe" .php disesuaikan dengan path ke php-cgi.exe

    Instalasi APC

    1. Silahkan download package PECL binaries for windows, extract dan kopi file php_apc.dll ke extension_dir anda. Punya saya di C:/php5/ext
    2. Edit php.ini, ini saya kopi paste dari hasil search di google tentang konfigurasi APC, saya belum mencoba2 untuk optimasi, direct kupipes:
      extension=php_apc.dll
      apc.enabled = 1
      apc.shm_segments = 1
      apc.shm_size = 64
      apc.max_file_size = 10M
      apc.stat=1
      
    3. Restart apache untuk merasakan bedanya

    Instalasi XCACHE

    1. Download binary xcache, Ekstrak
    2. Kopikan file php_xcache.dll ke extension_dir anda, punya saya di C:/php5/ext
    3. Edit php.ini, saya langsung kupipes dari file xcache.ini dari hasil ekstrakan tadi. Isinya
      [xcache-common]
      zend_extension_ts = C:/php5/ext/php_xcache.dll
      
      [xcache.admin]
      xcache.admin.auth = On
      xcache.admin.user = "ferdhie"
      xcache.admin.pass = "9baa7d76b70f95dba6dd71f853d21177"
      
      [xcache]
      xcache.shm_scheme = "mmap"
      xcache.size = 64M
      xcache.count = 1
      xcache.slots = 8K
      xcache.ttl = 3600
      xcache.gc_interval = 1440
      
      ; same as aboves but for variable cache
      xcache.var_size = 0M
      xcache.var_count = 1
      xcache.var_slots = 8K
      xcache.var_ttl = 0
      xcache.var_maxttl = 0
      xcache.var_gc_interval = 300
      xcache.test = Off
      xcache.readonly_protection = Off
      xcache.mmap_path = "/dev/zero"
      xcache.coredump_directory = ""
      xcache.cacher = On
      xcache.stat   = On
      xcache.optimizer = Off
      
      [xcache.coverager]
      xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
      xcache.coverager = Off
      xcache.coveragedump_directory = ""
      
    4. Restart apache anda

    Sekian, untuk instalasi di Linux/UNIX system, saya yakin lebih mudah, karena proses configure dan compilenya lebih gampang. Apalagi FreeBSD, but thats another story

5 komentar

  1. Aryo Sanjaya bilang:

    No Mudeng

    *tuing-tuing*

    December 7th, 2007 at 23:58
  2. Steven Haryanto bilang:

    thanks… nanti saya akan coba utk yg linux-nya. sampe saat ini server2x saya masih pada mod_fastcgi semua sih, tapi utk switch-nya gampang kok.

    December 8th, 2007 at 07:20
  3. ferdhie bilang:

    @steven
    jadi pengen hosting di masterweb nih…

    December 8th, 2007 at 18:29
  4. Aryo Sanjaya bilang:

    wah, om steven blogwalking menghasilkan pelanggan, hihihi.

    December 11th, 2007 at 12:35
  5. Jhon bilang:

    thanks, btw, kalo buat php4 bisa ndak ya dijalanin sebagai fastcgi di windows ??

    February 22nd, 2008 at 10:58

Tinggalkan Komentar





*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word