Posts

Showing posts from 2010

Affiliate module for Interspire Shopping Cart

Image
Hello, I have already implemented this module on two shops rather successfully. The concept is quite simple: websites that want to get rewarded through affiliation must link to your website using an identifier in the URL. If your website is http://website.com/, then your links must be of the form http://website.com/?ref=123 where 123 is the affiliate ID. when a visitor clicks the link, the affiliate ID will be placed in a cookie that will expire after 15 days (this can be configured) when the visitor purchases an item: if the affiliate ID cookie is still enabled, the affiliate will be credited of a certain amount, it can be a share of the sale or a fixed amount. affiliate accounts are simple customer accounts, there is no modification to make regarding accounts. When a sale is made, they receive store credit. They can either spend the store credit to purchase items on the store, or they can manually request for a withdrawal (managing withdrawals is up to you). I will detail the i...

Nginx rewrite rules for Interspire Shopping Cart

It's been a while since I made my last post on this blog, but that's because I've been busy with work! Anyway, today I've chosen to publish a simple finding that I've come up with myself (not that it was any difficult anyway). It could be useful for people who want to run a web shop, particularly the excellent Interspire Shopping Cart . It comes with a set of rewrite rules for Apache to enable search-engine friendly URLs, but nothing for Nginx unfortunately. Here is the Apache .htaccess file provided with Interspire Shopping Cart. I'm only pasting the section that we are interested in, in other words the Rewrite Module section:     RewriteEngine On     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . index.php     In order to achieve the same results in Nginx, you simply need to enable this location block:         location / { ...

"Nginx HTTP Server" book published

Nginx HTTP Server was published and is now available for purchase on various locations. It will begin to appear in store in the coming weeks. You can already purchase the eBook from the publisher's website at the link below: https://www.packtpub.com/nginx-http-server-for-web-applications/book The eBook can be purchased for 23.79€ whereas the book is 31.49€. There is also a preview chapter available on the website for anyone to read! Please feel free to leave your comments, feedback and questions if you have read the book.

Nginx HTTP Server: the book

Image
Hello, I am glad to to announce the first Nginx book on the market: Nginx HTTP Server , written by... me . :-) NGINX HTTP SERVER "Adopt Nginx for your web applications to make the most of your infrastructure and server pages faster than ever." Focused on the primary aspect of Nginx (HTTP serving), the book covers the following topics: Get started with Nginx to serve websites faster and safer Learn to configure your servers and virtual hosts efficiently Set up Nginx to work with PHP and other applications via FastCGI Explore possible interactions between Nginx and Apache to get the best of both worlds A step-by-step guide to switching from Apache to Nginx Complete configuration directive and module reference There are 8 chapters and 3 appendices, listed here: 1. Preparing your work environment: getting ready to work under a command-line environment, with a reminder on the basic tools and commands. 2. Downloading and installing Nginx : downloading the source, th...

Visual Studio 2010 web development bible

Image
Julien Dollon, whose blog is available here , recently finished writing his book about web development under Visual Studio 2010. Knowing the professionalism and the talent of Julien, this book should turn out to be an excellent read for all of us web developers interested in the .NET platform. The book is already available for pre-orders on Amazon . Congratulations Julien!

Nginx & PHP via FastCGI important security issue

A critical security issue has recently been pointed out on servers that run Nginx and PHP via FastCGI. The issue allows anyone to execute their own PHP code on the system, I don't think I have to remind you of the consequences this could have. I will attempt to provide a simple explanation of the issue and more importantly how to fix it. What is the issue? I would like to begin by discussing the nature of the problem: it is not caused by Nginx itself - it is not a bug or a security breach in itself. Actually, it is the way that people usually configure Nginx FastCGI options to work with PHP, and how PHP reacts to that configuration. Pretty much everyone adopts the same configuration without being aware of the issue. The issue itself can be understood simply, then I will explain why PHP behaves that way. Most dynamic websites allow for a reason or another uploading of files. Say, I'm running a forum-based community, users can upload images to use as personal photo or ava...

Dealing with Nginx 400 Bad Request HTTP errors

Today I'll write about something I experienced personally, on my websites. Some visitors reported that they were getting a "400 Bad Request" Nginx error randomly when visiting pages. And when they start getting that error, they can't access the site anymore: it'll output the same error no matter the page, until you "clear your cache and cookies". The error is easily understandable and is likely to be caused by... too much cookie data. Every time a visitor loads *any* page/content/file of your website, it sends the cookie data to the server. Cookie data is sent under the form of 1 header line starting with "Cookie: ". Basically, Nginx by default is configured to accept header lines of a maximum size of 4 kilobytes. When a line in the headers exceeds 4 kilobytes, Nginx returns the '400 Bad Request' error. Cookie data sometimes gets big, so it causes the error. It particularly happens on forums like vBulletin, Invision and others...

Downloading MMS streams in Linux (CentOS, Ubuntu, Debian, Fedora...) with mmsclient

Hello! So I was looking into solutions for saving a MMS stream on my server. My connection at home isn't fast enough so I cant watch most of the streams, I'd rather have those downloaded by my dedicated server and then I download the file off my server. I first looked into mimms : http://savannah.nongnu.org/download/mimms/ Unfortunately it was written in Python and I was missing Python 2.5. After struggling with my system I couldn't get it to work (missing dependencies one after the other). So I kept looking and I found mmsclient . The official website: http://ole.tange.dk/projekter/kontroversielt/www.geocities.com/majormms/ (actually a copy of the site, which was hosted on Geocities previously). Scroll down to the bottom of the page where it says "mmsclient". You will find a link to download it. I've mirrored the link here just in case: http://gbatemp.net/up/mms_client-0.0.3.tar.gz To install mmsclient, follow these simple steps: 1) Download the ...