Using Curl and Ajax to Proxy Flash

Most of the time Htaccess and Apache can handle proxies like this much easier, but just in case you need to do this, here is the code for a PHP proxy from http://developer.yahoo.com/javascript/samples/proxy/php_proxy_simple.txt

<?php
// PHP Proxy example for Yahoo! Web services.
// Responds to both HTTP GET and POST requests
//
// Author: Jason Levitt
// December 7th, 2005
//
Read More Using Curl and Ajax to Proxy Flash

Control Apache CPU, Memory, and Processes with httpd.conf

The following Apache HTTPD directives are for controlling processes launched by Apache children. Raising the maximum resource limit requires that the server is running as root, or in the initial startup phase. They apply to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec… Read More Control Apache CPU, Memory, and Processes with httpd.conf

PHP Caching and Acceleration with XCache

Up until today, I was still using eAccelerator on all of my servers. However, a post on the vBulletin.com forums prompted me to give XCache, the new PHP accelerator from the maker of lighttpd, a try. I’ve got to say, while I’ve only been using it for about 6 hours at this point, it blows eAccelerator out of the water, especially once you enable multiple caches (which benefits SMP systems).… Read More PHP Caching and Acceleration with XCache

Allowing or Blocking based on Country with .htaccess

Examples
Redirection with mod_geoip and mod_rewrite
Below are examples of how to perform redirection based on country with mod_geoip and mod_rewrite. This configuration should be added to your Apache httpd.conf or .htaccess file.

GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

# Redirect one country
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.canada.com$1 [L]

# Redirect multiple countries to a single page
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CA|US|MX)$
RewriteRule ^(.*)$ http://www.northamerica.com$1 [L]

Read More Allowing or Blocking based on Country with .htaccess