Category: "LAMP"

Passing Structured Data from Perl to PHP

After writing many lines of Perl to decode data returned from database queries which must then be passed back to PHP, I found JSON conversion routines which are much faster and more reliable. In addition, unlike my awkward Perl, they work! :::::::::… more »

bash Version Control Check-In

To make it easier to copy code from a development server to a version control server, check the file, then check it in, I created a bash script. This script is also supported with ssh keys so the password does not need to be entered with each copy re… more »

Apache IE8 HTML entities filter

One of the pages in a web application displays text log file output in popup browser windows. If that output includes this statement: <?xml version="1.0" encoding="utf-8"?> IE8 will try to parse the content as XML, and it will show an err… more »

Some Apache RewriteRules for Improved Security

A set of Apache RewriteRules, including curl commands to test them. Always test the rules, using a browser if possible, and curl. The curl output has been edited to make it easier to read. Remember to write the rules carefully so you don't deny acc… more »

Denying access based on HTTP referer

To deny access to a site based on the referer URL, you can use Apache rewrite rules. In the sample below, any referral that ends with .ru, .ua, or .tv will be rejected and redirected to the forbidden page (a 403). CodeRewriteCond %{HTTP_REFERER} !^$Re… more »