Apache and Nginx

On my server, on which I offer web hosting for some of my customers, runs an Apache 2. I remember when I switched from Apache 1 to Apache 2 (back in 2006?), seemed like a hugh for humanity to me. So much more modular, and easier to configure.

Now a little more than two years ago I finally made the transition from the classic PHP-module to php fastcgi, which brought a lot of stability and solved many permission problems on my multi-site environment.

BUT: apache seems to be very resource hungry, especially when using PHP as fastcgi. So I was thinking about switching over to something like nginx or lighttpd, which have a different structure, and they’re just not httpd grandpas. Young and fresh they seem.

Over the last weeks, I had nginx running as a reverse proxy for IPv6 requests, since my customer panel froxlor, is not yet supporting having an IPv4 and IPv6 line for each vhost. And that worked like a charm. I loved the setup, nice and clean, and I was thinking about making a switch, when I found out, that nginx cannot spawn php-cgi threads. On a single-site server, that is perfectly fine, but in a multihost environment, where every user’s scripts execute as their owner, quite impossible. It would mean running a php-cgi thread for every single customer all of the time (even if they don’t have a single php file in their host). Okay byebye Nginx. I will keep you for the time being, until I have native multistack IPv4/IPv6 support in my control panel, but then I will probably give lighttpd another try.

Lighttpd is supposed to offer all of the above and be less memory hungry than the indian. But we’ll see about that. Good night now.

Last update for today: Actually looking at the stats, my servers RAM is usually more than 50% free. Maybe I should not worry about the web server for another year or two.

HTML5 Mobile Device Applications

On a party I was yesterday, a friend told me they have this project where they would develop an application for iOS and Android, but have no one to do it for them, and they have asked around and were told this would cost them about 35’000€. Well, I know their product, which I cannot tell you, but I instinctly said that this was way to high.

So today I did a little bit of research on mobile app development, and heres what I found out (merely some notes for myself, but maybe someone else can take advantage of them):

  • You can develop super native-looking applications with access to the device native features (like geolocation and whatsoever) using HTML5 (well I knew before, but now I know for sure).
  • There are lots of frameworks, but since I’m a heavy jQuery user, I looked into jQuery Mobile, which sounds very promising (not only Android and iOS compatible, but merely any Phone, even my old Nokia 6300i is supposed to be supported somewhat!!), and I also looked at Sencha Touch 2, which is based upon the famous ExtJS Framework, which I have not used myself, but seems to be very professional and easy to learn too!
  • There is a nice in-browser emulator called Ripple Emulator for Chrome, that serves as a development “phone”, where you could test your HTML5 apps, without needing a phone itself (I don’t even have a smartphone!), and you will not need to power up the very sluggish Android SDK or boot into Mac OS X for Xcode. nice.
  • There actually is a way to put your website with an icon on the homescreen on iOS like on Android (starting with version 1.5 I believe), but thats not really the user experience we want our customers to have. While digging around in Maximiliano Firtman’s book on jQuery Mobile, I found PhoneGap:Build, a service which wraps HTML5 apps into packages, for iOS, Android, RIM, bada, … that can be easily installed and even be subitted to the corresponding AppStores. It is not a free service, but it saves a lot of money, so I wouldn’t bother using it.
  • I also stumbled over iScroll, which is supposed to bring a more native-like scrolling behavior to HTML5 apps, but I am unsure, if this is really neccessary with an up-to-date framework.
  • UPDATE (2013-01-15): Apache Cordova, the open-source PhoneGap offspring might also be worth looking at.

Let’s see if I ever get the chance to try some of these tools. After reading all of this stuff, I would suggest development for my friends app would be way cheaper, maybe something like 5’000€ (including backend), whilst the 35’000€ mentioned above were calculated for just the (native) app itself.

I need to stop now, since I actually need to put some time into my current project instead of just getting excited about something that I’ll (sadly) maybe never use.

Happy Hacking!