Software

231 posts in Software

nginx configs

· linux, software, www

Been slacking a bit lately, but here they are:

  • /etc/nginx/nginx.conf // general nginx config
  • /etc/nginx/sites-available/blog // my current (as of posting this) rproxy settings for this blog
  • /etc/nginx/conf.d/proxy.conf // reverse proxy related config

nginx cache in tmpfs

· linux, software, www

Probably won’t change a lot to my performance, but I’ve mounted the nginx reverse proxy cache in a tmpfs mount.

none on /var/cache/nginx/blog type tmpfs (rw,size=512m)
none  512M   47M  466M   4% /var/cache/nginx/blog

Let’s see what performance boosts this will give. :P

Mac OS X + SSD tweaks

· apple, hardware, software

Came across a pretty cool howto to tweak your SSD on a Mac. Only thing I noticed is setting the hibernate mode to 0 made my mac randomly wake up a few seconds after it went to sleep (and happened most often when closing the lid, less often when clicking the sleep button; randomly closing apps seemed to sometimes fix this problem; usually closing Skype and VLC solved this…) Set it the hibernate mode 7 now (which was the default I think)

nginx reverse proxy with caching

· linux, networking, software, www

Playing around and searching the web I enabled some decent caching now.

Here are some stats: image+html and php. Note that the php on apache (recompiled each request, about 1.5-2sec between every request) versus the cached output has a huge difference. Difference between images and static text files aren’t that huge. Also note that nginx has gzip enabled. The downside is that nginx caches all pages (HTTP code 200) for one hour and isn’t notified when pages are modified (yet).

nginx reverse proxy IP

· linux, networking, software, www

The issue with the wrong IP address being shown when using nginx as reverse proxy can easily be solved with mod_rpaf.

cache.blog.tuinslak.org 85.234.196.237 - - [22/May/2010:16:33:46 +0200] "GET /2010/05/nginx-reverse-proxy/ HTTP/1.0" 200 6184 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.53 Safari/533.4" 1766 6503

vs

cache.blog.tuinslak.org 85.12.6.171 - - [22/May/2010:16:27:40 +0200] “GET /2010/05/nginx-reverse-proxy/ HTTP/1.0” 200 22639 “-” “Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.53 Safari/533.4” 1771 23031

nginx reverse proxy

· linux, networking, software, www

I’ve been playing around a bit with nginx and its reverse proxy module. The “real” website is accessible here, whereas the cached version is here.

I’m deliberately making a difference between cache.* and live.* as blog.tuinslak.* might move to the cached version lateron.

The question, is it useful to reverse proxy this blog? No, probably not. But meh… It’s fun. :)

IP differences between both versions: live vs cache°. I’m guessing as most of the stats (Google Analytics and WP Stats) are JavaScript based, all stats should still be correctly generated. Only the Apache logs show the nginx proxy IP address. Which is normal, I guess.

nginx + fastcgi PHP

· errors, linux, software, www

I recently migrated vm1 to nginx instead of lighttpd. Just for the sake of playing and testing around.

As there’s a PHP page as well, I had to set up fastcgi with PHP. I mainly followed this tutorial to try to get PHP working.

However, every PHP page I visited returned following error:

No input file specified.

As I was fairly sure it was path (or variable) related, I played around with:

OpenVPN packet drops

· errors, linux, networking, software

I recently started to notice following error messages on my openVPN server.

ovpn-server[6306]: vpn.rootspirit.com/85.234.x.y:62068 MULTI: packet dropped due to output saturation (multi_process_incoming_tun)
This basically means that the TUN or TAP interface is making more packets than the real (TCP) interface can handle.

As I need to run OpenVPN using the TCP protocol (instead of the faster UDP protocol; as UDP is often blocked in networks I use my VPN in) I experimented by increasing the tcp-queue-limit. The default is 64, and I’ve set it to 256. So far, everything still seems to be working fine (but more packets will be queued before being dropped by OpenVPN, requiring less retransmissions).

OpenVPN & Windows 7

· errors, networking, software, windows

There’s a great GUI out for OpenVPN & Windows, located here.

However, this GUI includes an old OpenVPN, that is no longer compatible with Windows 7 and Windows Vista.

The TUN/TAP driver will be blocked due to compatibility issues, and when trying to connect to a VPN, you’ll get an error along the lines of:

All TAP-Win32 adapters on this system are currently in use

The simplest fix, is to install the GUI package (including the old OpenVPN binaries), and reinstall OpenVPN afterwards.