Note on Virtualmin installs and WordPress

I cannot say that my Virtualmin install was perfect anymore, I’ve had to manually install a missing feature.

I noticed when I was working in WordPress on the theme that WordPress was having issues with uploading images for me to use.  Obviously, that is a permissions error, I must have done something odd when uploading the files during install.  So I do a chmod on the directory.  It’s still not working.  Maybe the default permissions are not working on the Ubuntu install, let’s try something a bit more lenient.  It’s still not working.  Maybe it’s a cached files issue, clear the cache.  Still not working.  So it’s off to Google for the correct answer.

Google says that maybe it’s the image, it needs to be in RGB mode and not too big, so I trim it down some.  I could have just edited it down to the correct size and FTP’d the file to the server, but that is not the point, I want my user-friendly feature that I can use once a year to rotate the banner.  It still doesn’t work.  Back to Google, maybe it’s the file name.  Rename the file to image.jpg, it can’t be more simple than that.  And still no-go.  That about wraps up the simple Google support at this point, now I am down to digging through forum threads.  Finally I come across a post that does not recommend another image or just using FTP, it recommends testing that you have php5-gd installed.

apt-get install php5-gd

Wait for it to load… It works.  Another perfect example of make sure you’ve installed the feature you are trying to use.

Now for a simple checklist for those having the same issue:

  1. Check your permissions, mine were 644 default.  Wordpress recommended trying 755 for the wp-content directory
  2. Check your cache (If you have one).  Clearing a cache can solve all sorts of interesting issues.
  3. Check the image.  The color mode should be sRGB and you should avoid the more interesting choices of filename.  Wordpress has this troubleshooting page available for more information.
  4. Check that you have installed php5-gd.  Without it, one cannot play with images.

Thanks to h3x.no for their solution.

From CentOS 5.5 to Ubuntu 12.04

Nothing is quiet as annoying as a misbehaving server.  Except loud children.  But this post doesn’t deal with loud children, it deals with my misbehaving web server and why I had to set-up this site twice.

The day of my first attempt at a setup was more than smooth.  I logged into my server to find it not serving web pages.  It was like that 16 year old who serves burgers at the local fast food store, much more interested in doing just enough not to get noticed by the boss and get told to get back to work (The DNS still pointed people to the mail servers at least).  I tracked the disagreeableness down to a Virtualmin update not working well on CentOS 5.5.  This was not at all the first issue I have had with CentOS.  When I first setup the server I had to track down a special repository for php5 support, bind took me over a week to configure to get DNS working and after 6 months I still never got a single email working.  But this most recent update killed the server.  It had slow speeds at best, internal server errors as a norm and just plain disappearing server syndrome (DSS should not be confused with CSS) at worst.  Considering that the server does host a few business’s worth of websites, that was just not an option.

I decided to re-install the server with a newer OS that had full support for Virtualmin.  Ubuntu 12.04 was the best fit.  Since I am using Ubuntu at work for PHP development I have a pretty good feel for the server stack so if something goes wrong I should be able to get it going again quickly.  I am still not sure I want Ubuntu as my main server’s OS though, but until it proves itself inept, it should work.

Linode is quick about rebuilds.  It takes over 5 minutes for the server to shutdown, but only 30 seconds for Linode to reconfigure and boot into a fresh Ubuntu install.  After the first boot-up, I spend about 10 minutes doing the basic configuration such as static IP, hostname, updates and the like.  Virtualmin has a shell script that should do the base install for me, so a quick download and the server is installing.  Off to play on the Wii for a few minutes, a watched install never finishes.

When I get back I find the server has finished and is ready to continue.  So this means I will need to configure all the packages it has installed right? No, it’s done that, they are all running and are waiting for me.  So, something in the default config will leave me wanting?  No, I can drop in the config files from the first install, click a few buttons and get right to restoring individual sites.

I can say I was not expecting it to be that easy.  All together it took about 20 minutes from shutdown of server to sites being served, and I would guess that if you excluded the time I spent not looking at the computer, it would be closer to 15, or maybe even 10 given a script to configure the server after first boot.