Jan 302013
 

When you run a webserver behind a reverse proxy or HTTP accelerator such as Varnish, the webserver access logs will display the IP of the proxy (generally 127.0.0.1) instead of the end user’s IP.
This is a problem when you have a software like webalizer, awstats or similar log file analysis program, because you lose one of the most important information: “Who is the requestor of a page ?”, also having all the access coming from the same IP (127.0.0.1) you lose information such as “what’s the browsing pattern of visitors ?” “Is someone trying to do something Nasty ?”

In this small how-to I’ll show how to put this information back on your Nginx log files in 2 different ways.

Continue reading »

flattr this!

May 162012
 

Varnish is a great tool that accelerates the performance of your site with a simple configuration and a low usage of resources, compared to the result you’ll get. Just because Varnish is designed and engineered to be fast by default it does not write any log to disk, outrageous you could think … to be honest the logs are available in a memory segment when this memory is filled, Varnish starts from the beginning and overwrites the oldest data in an infinite loop.

So in reality there are logs and they are available for some time, and this solution is much, much faster then logging to a file and it doesn’t require disk space, but how we can get them on file, possibly divided by virtual host as do Apache or Nginx ?
Continue reading »

flattr this!

Apr 302012
 

Varnish is an open source “web accelerator” which you can use to speed up your website.

It can cache certain static elements, such as images or javascript but you can also use it for other purposes such as Load balancing or some additional security, in general most of the people want to try it and test their website to see if it’s really so amazing (IMO yes, but test it yourself).

The traditional guides will tell you to move your webserver to another port, perhaps 81,8080 or just bind to localhost, configure Varnish to listen to port 80 and use the web server as backend, the server where Varnish will forward requests not found in his cache.

This is the “normal” configuration and it works fine, but sometimes you just want to make a quick Test or perhaps you are using a Control Panel, such as Cpanel, Kloxo or ISPConfig and in my experience change the standard listening ports of Apache is not a decision to be taken lightly with these tools.

So in a VPS (with Kloxo) I’ve used a different approach: iptables.
Continue reading »

flattr this!

Supercharge WordPress, Part 3

This is an article of mine, originally published on Wazi WordPress , the popular content management system (CMS), is easy to configure and use, and is well supported by its community of professional consultants. WordPress depends for its operation from a full stack that includes an operating system, database, web server and PHP. If you […]