Moving Joomla, WordPress and other PHP/FastCGI apps to Nginx

Have you moved your site from Apache to Nginx and now your FastCGI (php-cgi/spawn-fcgi) processes die/hang/crash periodically and your users see “HTTP 502 Bad gateway” or “HTTP 504 Gateway timeout” instead of a website?

I have faced this problem and found a relatively simple and robust solution. Here’s how I did it on Ubuntu 9.10 (Karmic Koala) and 10.04 (Lucid Lynx) server edition.

Continue reading “Moving Joomla, WordPress and other PHP/FastCGI apps to Nginx”

Share

Informal notes from #frozenrails 2010

Thanks to organisers from Kisko Labs and the HHLinuxClub on Friday, May 7th, 2010 Finland got its first  Rails conference.

Conference has drawn very interesting speakers and  international crowd – from Finland (naturally), Sweden, Poland, Germany, Russia and other countries. I made a few notes from selected talks on the conference.

Chris Wanstrath / GitHub (@defunkt)

  • Slides: http://www.slideshare.net/err/inside-github
  • Linus Trovalds Google tech talk about git – where Linus tell you that you’re stpid if you’re not using git
  • rack-mobile-detect – is used by GitHub, super useful if you’re planning to create mobile optimized version
  • GitHub uses Unicorn as an application server – personally I’m not sure if that’s better than Apache + Passenger. Chris tells that Unicorn is cool, because does fair load balancing on Linux kernel level, also Rails are loaded only once – and then required number of processes are forked – and this is very fast, a lot faster than loading rails separately for each Mongrel. And when one of the processes dies – there’s no need to re-load Rails, but just fork another process.
  • GitHub users BERT to forward requests to one of their six servers – BERT to Erlang is the same as JSON to JavaScript
  • GitHub doesn’t use delayed_job anymore since they needed several queues with different priorities – so far they use resque, but are considering developing a real queue management system

Continue reading “Informal notes from #frozenrails 2010”

Share

Web hosting for internet startups

A lot of companies launching their own internet services have faced the same question – where to host. Over the course of the last few months I was asked for opinion on this matter several times. While I have no definitive answer, here are some recommendations.

Don’t start with maximum capacity, start small, and think about scalability – how fast you can do it, and how you will do it. Then map the plans to what your selected hosting provider offers. Avoid temptation to use your own hardware, unless you really have resources for administering and maintaining it and a real need to have physical access to the servers. Even companies using their own hardware use virtualization to run virtual machines on top of physical ones.

Two years ago, when we were just experimenting with ideas of the social training log, a shared hosting option on Dreamhost gave us the best prices/features/quality combination. When we launched first closed version of the service named Moozement at the time, we switched to Dreamhost VPS, which allowed enough flexibility and had reasonable pricing. For HeiaHeia (Moozement beta version) we’ve chosen Linode, as it offers Xen virtualization (as opposed to Dreamhost’s VServer), servers with up to 14400Mb of RAM, easy resizing, wide selection of Linux distributions, and several data centres to choose from, including one in London. As HeiaHeia grows, we are preparing for the next step, but for now Linode proved to be excellent choice.

If your company is based in EU, you also need to remember about EU Data Protection Directive – your servers need to be physically located in one of the European Union countries or in the US with a provider following Safe Harbor Principles.

If you have no clue about how much CPU/RAM/traffic your application will need – check reference cases – there are plenty on the internet. Here are just a couple of examples: social network Ravelry and Facebook app Friends for Sale.

Want second opinion? Check these:

  • Eivind Uggedal has a very thorough comparison of Slicehost, Linode, Prgmr, Rackspace and Amazon EC2 pricing and performance and arrives at a conclusion that Linode gives you best bang for the buck.

In case you decide to use Linode, use this referral link to give us some reward 🙂

If you’re planning to host a low traffic service, and don’t want to spend much time on system administration – Dreamhost is a great starting point. And as I already wrote earlier, Dreamhost provides excellent value for money. If you are looking for a good hosting – use IVANKUZNETSOV promocode and get a $50 discount when setting up an account on Dreamhost.

Share

Setting up Ruby, Rails, Git and Redmine on Dreamhost

Git, RedMine, Ruby, Rails on DreamhostThe task is to have:
– Redmine installation on redmine.mydomain.com
– Several Git repositories on git.mydomain.com with different access rights to each one

This proved to be a non-trivial task. There is a number of tutorials on the net, but none of them described the full solution. So after getting it all to work, I decided to share all the tips and tricks. Feel free to comment, if you will find problems with the following set of instructions.
Continue reading “Setting up Ruby, Rails, Git and Redmine on Dreamhost”

Share

Introducing Moozement

moozementLast year I got involved in the development of a new social network – Moozement. There are plenty of social networks out there, there are even white label social networks. So why create another one?

Jyri Engeström wrote some time ago about the case for object-centered sociality: “‘social networking’ makes little sense if we leave out the objects that mediate the ties between people”. I could not agree with him more. The glue of each community is something that unites them – common interest, social object. When you join new social network, you typically start by building your social graph – re-establishing links to the real people you know, checking if they have already registered, inviting those whom you would like to see in the new environment. But there must be something beyond the initial phase of building the social graph. And this is the problem that haunts giants like Facebook and MySpace. You cannot possibly have common interest with everyone, and you don’t want to share the same things with everyone.

Continue reading “Introducing Moozement”

Share

I have been hacked

Ivan Kuznetsov - blog hackedYes, for the second time in my life. First time it was still in my university years. In those times if you had internet access at home, you were priveleged. Companies were paying quite a lot of money to get a slow 28K dial-up connection, and internet providers were charging per minute, not by gigabyte. I set up access to the university internet connection via modem in our lab – I was running FIDO net node on the same machine. One guy (I later on found him) noticed that there’s a PPP connection attempt before FIDO mail software kicks in and successfully brute forced the password. I should admit that I didn’t bother that much when I was setting the password – it was not the default one, but pretty close. It was quite easy to spot the attack – phone line was busy all the time. What the attacker didn’t know is that the modem I used was a sophisticated US Robotics Sportster model with CallerID detection, so it was rather easy to trace the attacker.

But that was more than 10 years ago. Now I noticed that something is wrong when I started recieving a lot of comment spam from this blog. Captcha plugin was doing an excellent job before, so I decided to check what’s going on. Somehow all plugins were disabled. Re-enabling them solved the problem with comment spam, but then Goolge started generating weird excerpts for ivankuznetsov.com search results. That’s when I started digging deeper and discovered that a hidden div with advertisments was inserted into WordPress PHP scripts.

Dreamhost support was kind enough to point me to the description of the attack that was used to break my blog. This particular problem, as well as some other security issues have been fixed in the latest Word Press release – 2.5.1. Lesson learned – update software on time and make backups.

If you are using WordPress older than 2.5.1 I would recommend you to upgrade ASAP.

Share

Radiant CMS

Radiant CMSEaster weekend didn’t start well – I decided to upgrade Joomla on one of my sites to version 1.5.1 from 1.0 and upgrade just totally ruined the entire site – content was lost, template wasn’t compatible with version 1.5.1. At first I thought that the reason is Dreamhost‘s automatic one-click upgrade that I used, but even after manual reinstall Joomla kept giving weird “Fatal error: Call to a member function name() on a non-object in helper.php on line 219” error in Control Panel, and legacy mode for old template didn’t work.

(To be fare I should say that Dreamhost provides excellent value for money. If you are looking for a good hosting – use IVANKUZNETSOV promocode and get a $50 discount when setting up an account on Dreamhost)

A thought of reinstalling all modules and reconfiguring Joomla from scratch was simply too depressive, so I decided to try another CMS. As a Ruby on Rails convert and a strong believer in open-source ideology I decided to go for Radiant – open-source CMS written in RoR. It is still in beta (latest release is 0.6.4), but it is surprisingly stable and powerful. Take a look at the footer of www.ruby-lang.org – official Ruby programming language web site – it is powered by Radiant 🙂

Installation of Radiant was rather easy – thanks to this guide and my prior experience with RoR applications deployment on Dreamhost. It took me a couple of hours to figure out how to actually create sites with Radiant – there are not that many tutorials available yet, so it is pretty much  “make by example”. Split into pages, snippets and layouts makes a lot of sense onse you get your head around it.

From my experience Joomla is an overkill for most of the small sites, and despite being WYSIWYG, it still requires a professional or at least a tech savvy to configure it. After Radiant is set up and configured it is no more difficult to add content there than to edit a wiki page because of its Textile support. But it is so much simpler and easier to use than Joomla.

I managed to restore the ruined site in a day’s time – fetched most of the lost content from Google cache, converted Joomla template into Radiant’s layouts and recreated the pages (well, it was a small site after all). First time I dealt with Joomla – I spent several days trying to figure out where are the settings that I actually need in the endless menus.

Radiant is clearly following “less is better” principle. If you want to try Radiant – there’s a live demo where you can do whatever you want with the content.

Share

Google Android vs. Nokia Series 60 – what would it take to build a better mobile phone?

Android The long awaited Google phone turned out to be just an OS. What does it mean for us, mobile software developers?

Personally, I think this is great news. An open mobile platform is something that was long due to stir up the world of RIM-Windows-Symbian.

Android managed to get many things right from the very beginning, things that took several years for S60. While S60 initially took Microsoft-style approach to development community – with multi-level support, exclusive club membership with access to the source code, signing and licensing, Android is quite open and democratic.

When Google announced Android SDK – my first thoughts were – it’s a smart move to release SDK before devices are available. Google’s name alone would be enough to attract developers and hackers to this new platform, so they can create a developer community by the time devices are shipping. Then Google announced developer challenge with $10mln in awards.

Continue reading “Google Android vs. Nokia Series 60 – what would it take to build a better mobile phone?”

Share

At last – Mozilla based browser for N800

Mozilla MaemoJust a couple of days ago I was wondering when Nokia Internet Tablets will get an open source browser. So I was really happy to read today that a Mozilla based browser engine that shares the key components and extension interfaces with Firefox is available as a development version.

UMPC has a brief review of the browsing experiences with Mozilla on N800 (via ThoughtFix).

internetTablet blog reports that the new browser is:

  • Built on top of the latest version of Gecko engine
  • Has full ajax support (supports Google maps – street view and Google docs)
  • Supports rss feed preview.
  • Supports Firefox and Mozilla add-ons
  • Allows to view SSL certificate details
Share

Safari, Safari and Opera on 3 mobile devices

Jonathan Green in his video post
Browser Comparison: iPhone vs. Nokia N95 and N800 compared performance of Nokia S60 web browser, N800 Opera browser and iPhone Safari browser.

Jonathan’s conclusion “my preference is for how Safari handles things over Opera” resonates with my own thoughts in “Opera Mobile vs. Nokia S60 browser – new browser war?“.

I’m wondering when Nokia will introduce open source browser in its internet tablets as well.

It was also really nice to see that one of the sites used in the browser comparison was Jaiku. Popularity of this application is growing by the hour.

Share