mod_compress: Lighttpd Gzip Compression To Improve Download and Browsing Speed

Posted on in Categories Apache, High performance computing, Howto, lighttpd, Linux, News, php, UNIX last updated April 26, 2008

Gzip compression reduces response times by reducing the size of the HTTP response. This document describes gzipping http traffic which can reduces the response size by about 70%. Approximately 90% of today’s Internet traffic travels through browsers that claim to support compression.

PHP Programming Tutorial: Merge and Filter RSS / Atom Feed With XQuery

Posted on in Categories Howto, Linux, php, Security, UNIX last updated February 7, 2008

I’ve already written about merging two feeds using MagpieRSS and FeedCreator php classes. However, I wasn’t aware of XQuery query language that is designed to query collections of XML data. It seems similar to SQL. You can use XQuery to speed your merging and filtering of RSS / atom information (feed) easily. In this tutorial:

You will learn the basics of XQuery processing of RSS and Atom feeds to turn a single feed into an HTML document. Then you produced a more complete solution for outputting the information in a format that suits your needs, including sorting, merging multiple feeds and even handling different feed and source information types. XQuery makes it much easier to merge and filter information from XML documents when you embed the filtering instructions right into the document that you use to generate the output format. You can use that functionality to aggregate information from RSS and Atom feeds into the format you need. In this article, look at the structure of the RSS and Atom formats and how XQuery can simplify the display of that information.

=> Aggregate RSS and Atom information using XQuery

Coverity Scan: Security Holes Found in Open Source Projects

Posted on in Categories Links, News, Open source coding, php, programming, Security last updated January 9, 2008
Coverity Logo

Coverity is a company that creates tools for software development. Its premiere product is Prevent, a static-analysis code inspection tool. Coverity offers the results of Prevent’s analysis for free to open source developers.

From the project home page:

In collaboration with Stanford University, Coverity is establishing a new baseline for software quality and security in open source. Under a contract with the Department of Homeland Security, we apply the latest innovations in automated defect detection to uncover some of the most critical types of bugs found in software.

So the most notable use of Prevent is under a U.S. Department of Homeland Security contract, in which it is used to examine over 150 open source applications for bugs. Popular open source projects, such as Samba, the PHP, Perl, and Tcl dynamic languages used to bind together elements of Web sites, and Amanda, the popular open source backup and recovery software running on half a million servers, were all found to have dozens or hundreds of security exposures and quality defects.

For example, over 75% of the defects Scan identified in Samba were fixed within two reviews of the Scan analysis.
Over 75% of the defects Scan identified in Samba were fixed within two reviews of the Scan analysis.
(Fig. 01: Samba Project Code Scan Result)

=> More information about project and bugs (including charts) available at offical web site.

A total of 7,826 open source project defects have been fixed through the Homeland Security review, or one every two hours since it was launched in 2006, according to David Maxwell, open source strategist for Coverity, maker of the source code checking system, the Prevent Software Quality System, that’s being used in the review.

This project is really helping out to improve overall open source software quality.

Lighttpd / Apache : Run Xcache in Chrooted Jail

Posted on in Categories CentOS, Debian Linux, Gentoo Linux, Howto, lighttpd, Linux, php, RedHat/Fedora Linux last updated November 26, 2007

Recently I wrote about installing and running Xcache under Red hat enterprise Linux and CentOS Linux. By default Xcache use /dev/zero for caching. All you have to do is create /dev/zero in chrooted jail. Type the following command (assuming that your jail is located at /lighttpd.jail directory):
# mkdir -p /lighttpd.jail/dev
# mknod -m 666 /lighttpd.jail/dev/zero c 1 5

Just restart your web server and xcache should work under chrooted lighttpd web server.

Install PHP Pear Mail / SMTP package on CentOS / Red Hat Enterprise Linux

Posted on in Categories CentOS, Howto, Linux, php, RedHat/Fedora Linux, Sys admin, Troubleshooting last updated October 20, 2007

Recently I’ve noticed that Redhat removed support for following php pear packages:

a) NET/SMTP : An implementation of the SMTP protocol

b) Mail : Class that provides multiple interfaces for sending emails

c) Net/Socke : Network Socket Interface

The simplest solution is downloading and installs these files from php pear repo.

Step # 1: Download files

Use wget command to download all files:
# cd /tmp
# wget http://download.pear.php.net/package/Mail-1.1.14.tgz
# wget http://download.pear.php.net/package/Net_SMTP-1.2.10.tgz
# http://download.pear.php.net/package/Net_Socket-1.0.8.tgz

Untar all files:
# tar -zxvf Mail-1.1.14.tgz
# tar -zxvf Net_SMTP-1.2.10.tgz
# tar -zxvf Net_Socket-1.0.8.tgz

Step # 2: Install files

Simply copy file to your webroot such as /www/usr/share/pear or standard location such as /usr/share/pear:
# cd /usr/share/pear
# mkdir Net
# cd Net
# cp /tmp/Net_SMTP-1.2.10/SMTP.php .
# cp /tmp/Net_Socket-1.0.8/Socket.php .
# cd ..
# cp -avr /tmp/Mail-1.1.14/Mail/ .
# cp -avr /tmp/Mail-1.1.14/Mail.php .

Step # 3: Test SMTP email

Now you have required files, all you have to do is send email using authenticated smtp server.

How to: Run and install PHP FastCGI on Microsoft IIS Server

Posted on in Categories php, Windows, Windows server last updated October 10, 2007

FastCGI is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. I’m very big fan of FastCGI. Almost all my Apache / Lighttpd servers are powered by php FastCGI.

Today Microsoft announced the official release of their FastCGI extension for IIS server version 5.1 and 6.0. New FastCGI module should improves the performance and reliability of PHP on Windows operating system.

Since early 2006, Microsoft and Zend have been working together on a technical collaboration with the PHP community to significantly enhance the reliability and performance of PHP on Windows Server 2003 and Windows Server 2008. As part of this collaboration, the IIS product group has been working on a new component for IIS6 and IIS7 called FastCGI Extension which will enable IIS to much more effectively host PHP applications.

=> Using FastCGI to Host PHP Applications on IIS 6.0 and IIS 5.1