• Installing PHP XCache in 11 Steps

    Posted on March 5th, 2009 admin No comments

    XCache is a a cache system for php scripts, it will increase a lot your php pages load speed. (Official Web Site)

    In this post i will not discuss about how it works and what it does, i just tell you guys how to install it in few steps.

    1º – download the last stable version http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
    2º – tar -xvf xcache-1.2.2.tar.gz
    3º – cd xcache-1.2.2
    4º – phpize
    5º – ./configure –enable-xcache
    6º – make
    7º – make install
    8º – cp xcache.ini /etc/php.d
    9º – vim /etc/php.d/xcache.ini
    10º – uncomment and set xcache.size = 64M
    11º – restart apache and its done!

    Obs.: Sometimes you will need to install php-devel packages if they are not currently installed on your system. (yum install php-devel)

  • Apache .htaccess – Subdomain redirect rules

    Posted on February 26th, 2009 admin No comments

    In the begin of my website i have had a lot of problems to find a good working .htaccess configuration file. I need some redirect rules from specific folders from a subdomain to redirect to specific folder in other subdomain, passing parameters.

    I need this type of redirect because my website is multilangue, so i dont want folders on portuguese associated with the english subdomain by example.

    This code was really hard to get working, but here it is for you guys, hope it be useful.

    — part of the .htacces file of gwebtools.com —

    <IfModule mod_rewrite.c>
    RewriteEngine On

    #redirect gwebtools.com to www.gwebtools.com
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www..*
    RewriteCond %{HTTP_HOST} !^$
    RewriteCond %{HTTP_HOST} ^([^.]*).(com|com/)
    RewriteRule ^.*$ http://www.%1.%2%{REQUEST_URI} [R=301,L]

    #if subdomain pt or whois and folder port-scanner redirect to pt.gwebtools.com/scanner-porta, with parameters
    RewriteCond %{HTTP_HOST} ^(pt|whois)\.gwebtools\.com
    RewriteRule ^port-scanner/* http://pt.gwebtools.com/scanner-porta$1 [R=301,L]


    The above code is running on this site www.gwebtools.com!