Posts Tagged ‘Ubuntu’

Tutorial: Migrating from Apache to Lighttpd, Saving 200M of ram

Wednesday, May 19th, 2010

Ok, so, after just 2 hours of playing around with my server, I upgraded it from Ubuntu 8.04 to 10.04 (w00t for LTS) and migrated it away from apache to lighttpd. “Whats wrong with Apache?” I hear you ask. Well, my VPS is running on 512MB of ram, and with apache running, it was literally using over 256Mb of ram, and that caused the server to crash 3 times in the last 2 weeks. This, obviously, isn’t a good thing, so I decided to try lighttpd and it turns out that my server now has almost 240Mb of ram free. So, that is a saving of over 200Mb of ram. Fantastic.

“How can I move over to lighttpd?” I now hear you cry. Well, it was actually quite simple, and I plan to show you how I moved my WordPress install over to it.

**NOTE** This  was written for Ubuntu 10.04, but should work in any other version of ubuntu, and should work for most other distros if you just use your respective package manager, and different places where the files are saved possibly

  • Well, lets go, first of all, make sure you are totally up to date with all your packages (sudo apt-get update && sudo apt-get upgrade).
  • Install lighttpd

In Ubuntu this would be “sudo apt-get install lighttpd” – this will install lighttpd, created a default conf file and start lighttpd (however, if you currently have apache running, it will fail to start because apache is already binded to port 80).

  • Edit lighttpd.conf

In ubuntu, you can find this at “/etc/lighttpd/lighttpd.conf”. If you have apache running on port 80 just now then find the line “server.port = 80″ and change it to something else (such as 81). You can keep it like this until you have all your configuration working, and access it at http://www.domain.com:81 to see if it works.

You can edit the root for your website on the line ‘server.document-root        = “/var/www”‘ – just change this to wherever your website is saved.

  • Edit wordpress settings for permalinks

Lighttpd doesn’t work very well with wordpress’ permalinks because it goes for a 404 error. For this, you will have to do 2 things.

First, edit your 404.php file in your wordpress theme and add this to the top “< ?php header("HTTP/1.1 404 Not Found"); ?>“. This will make sure that proper 404 errors will still show up in search engines (which is kinda important).

Second, edit this line in your lighttpd.conf ‘#server.error-handler-404  = “/error-handler.php”‘ and turn that into ‘server.error-handler-404  = “/index.php”‘. If you have virtual hosts set up (and I’ll show you how to do that very soon) make sure you do that in the virtual host rather than the default one.

  • And that is it…

You now have a working wordpress install on lighttpd. If it all seems to work, change the port back to 80, stop apache, and restart lighttpd (sudo /etc/init.d/lighttpd restart). There are obviously many more things you can get to do, such as virtual hosts (which I’m literally just about to tell you about), but you still can have a working install, so enjoy.

  • Virtual hosts

This is one bit of lighttpd that I really love, it is so much easier than apache. Ok, so get to a nice empty bit of you lighttpd file, (make sure it is before the bit at the end of the file that says it must be at the end of the file. Things will break…) and copy this into it:

$HTTP["host"] =~ “(^|\.)domain\.co.uk” {
server.document-root = “/path/to/”
server.errorlog = “/var/log/lighttpd/domain/error.log”
accesslog.filename = “/var/log/lighttpd/domain/access.log”
server.error-handler-404 = “/index.php”
}

Make sure you replace “domain\.co.uk” with your domain (make sure you leave the slash there though) and replace “/path/to/” to wherever your files are. Then restart lighttpd, and you are all sorted. Nice and easy. If you are using an ip address, or a subdomain instead, you don’t need the whole bit before the domain, and you can just have “sub.domain.com” or “192.168.2.1″.

I hope this tutorial has helped anyone free up some RAM on their webserver. If you have any suggestions for this tutorial, or any questions about something that has gone wrong, then please leave a comment :-) I’ll include any corrections to my work (and credit you). Have fun with your lighttpd.

10 things I’d like in Ubuntu 10.10

Friday, May 14th, 2010

As many of you will know, Ubuntu 10.04 was released 2 months ago, and the Ubuntu Developer Summit is currently underway.

There are loads of cool new features in development for 10.10 (Maverick Meerkat) and I thought I would put my 10 ideas that I’d like to happen in the next version. (And, unlike my blog’s name, that 10 is in base ten).

Note: to all those people who use kubuntu, or xubuntu etc…I am currently only talking about Ubuntu because that is what I use. (more…)

Rant: Gimp, F-spot, Mono and Ubuntu

Monday, November 23rd, 2009

Ok, now this issue has been running around the blogosphere for a while, so I’m going to post my thoughts on it. You may have seen my thoughts on other services, and they are part of what I’m thinking, but i didn’t express them very well, so please take this as my official stance on the issue.

Let me first get the facts right. If I don’t have this right, then please let me know. I believe that Ubuntu is dropping the GIMP because it is not needed, and they are keeping f-spot as it is a photo “editor” as well as manager. Ok…

This is how this blog post will be structured…

  1. F-spot is rubbish.
  2. Mono is huge
  3. Gimp is not necessarily needed, but we need a replacement
  4. Summary

F-spot is rubbish
Ok, who uses f-spot? Not me. Not my previously-linux-using girlfriend who is a photographer. Not any photographer I know. Not any linux-user that I know. This bit is not an anti-mono rant. I have nothing against mono, I use it myself. This is an f-spot rant.

F-spot is a chunky, horrible looking application, which promises lots of things and then doesn’t deliver a single thing. It messes with photos, where they are stored, their meta-data and in one case actually resized a whole bunch of my gfs photos, and deleted some. We had a backup for some, but not all, of the photos. Yes, I know, we should keep backups, but we didn’t for once, and ended up losing some.

I challenge 1 person to use f-spot for 2 weeks, and then come and tell me it is a good application. It isn’t. It is also not a photo-editor. I mean, seriously, what sort of photo editing would you do with f-spot? I wouldn’t…

Mono is huge

Name 1 application that uses mono in the default Ubuntu install. f-spot. Anymore? No. None. Banshee never ended up in the default install, did it? No. They took it out.

So, my point is…f-spot is a crap application, take it out, and then you have a huge amount of free space on the Ubuntu cd. Is that not the reason they want to take GIMP out? Space saving? Yeah…so get rid of mono.

Don’t get me wrong. I’m not saying mono is rubbish and we shouldn’t use it. I do use mono. Only for one application, but still. I can only think of 1 application that uses mono that is actually any good. Gnome-do. And seeing as Ubuntu won’t include that in the default install, we should get rid of it.

Some people say it can be used for porting apps to linux from .net. But it hasn’t. It would be a fantastic thing to do that, but it hasn’t been used for ANY app to port over yet. So why are we including such a huge thing in the default install?

Gimp is not necessarily needed, but we need a replacement

I’ll be honest with you, I uninstall GIMP as soon as I install Ubuntu. Because I don’t use it. I think it is a fantastic application, it is massively amazing and very important for the FLOSS community.

My question, however, is whether or not it should be in the default install of Ubuntu. I am of the opinion that it is very very complex and far too big and complex for the majority of computer users. Most people won’t really want a huge photo editor in their install, and if someone does, its really not hard to install it.

What I think we need is a replacement for GIMP in the default install, but make it really easy to install it. Well, we don’t need to make it really easy to install…it already it. “sudo apt-get install gimp” or go to the software centre, find gimp and click on install.

So the question is, what should we replace it with? Gthumb? Xpaint? I’ll be honest with you, i’ve never used them. I don’t do photos. If there is no replacement for gimp that is good, then don’t get rid of it. But we need a sort of “paint-style” app for ubuntu that will do simple stuff, like cropping, resizing, rotating, simple drawing (squares, circles) and then everyone is happy.

Conclusion

F-spot is crap. Get rid of it.

Now that f-spot is out, get rid of mono. Its a space hogger.

Get rid of gimp, and replace it with a “paint-style” app.

Review: Ubuntu Karmic Koala

Thursday, November 19th, 2009

Right. I’ve taken far far too long to post this, so here we go. I’m sitting down to write it and not getting up until I’m finished.

I have 3 computers that I use daily. My desktop, my netbook and my server (o, btw, I’ll be posting about my server sometime soon). And so, I decided to try and get all these running Karmic. Some experiences were great, some were not so.

(more…)

Do distros release too often?

Wednesday, October 7th, 2009

bigtuxWelcome to what I am going to call (in my sad head) blogging wednesday. Now, wednesday is the day when I get most time to study. Which means that I also have most time to take breaks. And in those breaks, I am going to be blogging. Because I don’t blog enough, and my “To-blog” list has been mounting up for a while. But anyways, on with the blog.

I was listening to an episode of TuxRadar (a podcast from the great guys at Linux Format magazine) the other week. And every week they have an “open ballot” where they put out to the people on their website, what they think on a particular topic. That particular episode had the ballot title “Do distros release too often?”

Obviously, this was in reference to distros such as Ubuntu and Fedora, who release every 6 months. And some of the thoughts were that 6 months isn’t long enough to make big changes. But then, some other thoughts were that longer releases then end up with older software.

Lets take Ubuntu and Oo.o for example. Oo.o 3.0 came out at the end of last year, I think. And the problem was that 8.10 had just been released with 2.4, or whatever the release was before that. And a distro is not going to make such a huge change to a distribution when they are releasing in another 6 months. So, this meant that people were either stuck without Oo.o 3.0, or they built it from source or installed about 30 .deb packages.

So, we have 2 sides – it is too long or it is not too long. Now, the problem we have is that businesses don’t want the newest software all the time. Some things are good, but its not necessary. However, you have people who are like me and are obsessed with getting the newest software asap. I mean, I use firefox 3.6 and thunderbird 3.0 on Ubuntu 9.10 for goodness sake.

So…as most of you will know, Ubuntu adopted what they call the “LTS” releases. These are releases that happen every 4 releases (give or take). And the difference between these and normal releases are the fact that they are built to be rock solid, they are supported for longer on both desktop and server. And this is great. It means businesses can update every 2 years, get the newest software, get a really stable system, and have it supported for a long time. What business wants to upgrade all their computers every 6 months? Not many.

However, I don’t think that Ubuntu put enough emphasis on LTS versions. I think most general people should use LTS releases, unless they really want the newest version of “x”. So, my question is this – “Should Ubuntu put emphasis on the LTS releases being the stable release, and everything else is for people with a reasonable understanding of computers?”

The other thing that was bounced around was rolling releases. The idea was that rolling releases could happen with Ubuntu, and then every 2 years, they take a snapshot, make sure there are no bugs, and then release it as an LTS. This would encourage people to use the LTS, but would also allow geeks to use the newest stuff all the time.

I don’t know what the answer is, but I wonder what people think? I do think that 6 months is not too short. At all.

Windows 7

Monday, June 29th, 2009

Ok, there have been a few interesting developments on Windows 7 since I last blogged about it.

For starters, the starter edition will no longer have the 3 app rule. For those who don’t know, the 3 app rule was that you could not run more than 3 apps at once (not including A/V software). Their reasons were that the netbooks couldn’t handle it, and that most people won’t use more than 3 apps. So, it is interesting that they have stopped this, as they seemed to be taking more and more control over netbooks as time went on.

I wonder what made them change their mind. Was it the bad press? Was it the hundreds of people being unhappy bout it? I guess we will never know…

Second of all, windows 7 seems to be running at a base install (no AV software) at about 400mb on a 32-bit computer. That is interesting. It seems to be a lot better than Vista, but still quite heavy. 400 as apposed to about 150 for a base ubuntu install running compiz. But ach well, it is a step in the right direction.

Third, it seems Windows 7 will only be released as a full install in Europe. They will have an upgrade option, but it will just be the full install disk. I wonder what the point is…? But also, it will be much more expensive than in America. Up to double depending on the actual version that you choose.

So, good and bad things going for Microsoft and Windows 7 just now. I would like to point out that the RC seems to run slower than the beta.

A few predictions from earlier in the year

Wednesday, June 24th, 2009

Ok, some of you may remember I put down my 10 predictions for the coming year. Well, a few of them have come true. Lets see…

2. Apple won’t wait till Christmas to release their new Iphone, which is what they said they will do. – Turns out I was right with this one. They have released the iPhone 3Gs already, halfway through the year
5. I will get my computer working again. – This one did happen, but I didn’t update you with it. I got my money back for my old motherboard, and bought a new one.
6.Google will release 2 more versions of their G range of phones, taking as long to release the source code as they did with the first version. – Turns out this one is right as well, with the release today of the HTC Hero
7. Canonical will make an increasingly stupid name for version 9.10 of Ubuntu. Kranky Kangaroo or something. – This one happened as well. As we all know, it is called Karmic Koala
10. Thunderbird 3.0 might get released…that would be nice…taking long enough. – This one might happen soon, as we currently have the Beta 2 of Thunderbird, and mozilla don’t do many betas (ha…)

So, looks like a very successful year for me so far in predictions. More to come people…

Songbird 1.2 – The Review

Friday, June 19th, 2009

Managed to get this up earlier than I expected, as I realised that you don’t need to build it from source from the songbird website, I just needed to download it and run it.

So, to the new features:

  • Equaliser:Songbird

    The equaliser is quite interesting. It works reasonably well. It has sliders for 10 frequencies, and is quite nice. It isn’t the best equaliser I have ever said, it lacks a few features that are planned (either by the songbird team, or by addons), such as presets and the ability to remember equaliser settings for each song. That is something that would be immense, and I would really love.

  • Automatically managed folders:

    Well, now this is quite a cool, interesting feature now. It is quite useful. I’m sure most of you would know what it would do, but you can turn on what it calls “Managed Mode” on. This will allow you to choose the folder for your music, the folder heirarchy, and the file name, and when you change anything in the metadata, it will change them for you. Really useful I think. It works as well.

  • 2-way sync with iTunes:

    Very useful feature, not for me, but for a lot of people who love Songbird, but also love the iTunes music store. Does exactly what it says on the tin…syncs with iTunes both ways. Means you can buy music in the iTunes music store, and it will sync with songbird. Create playlists in songbird, and they will sync with itunes, and you can then sync them to your iPhone or iPod touch (which currently aren’t supported in songbird). I don’t know how to do this feature, and I don’t have iTunes so I can’t try it and tell you if it works, but it seems really cool.

    This could also be used in conjunction with dropbox (or similar) to sync itunes on a mac, with linux or windows on another computer, or to sync several OS on 1 computer. It has huge potential.

  • Last.fm:

    I don’t get what is new with this. My Songbird 1.1.1 has last.fm on it, but maybe that is just an addon. I don’t know, it might be that it was an addon, and is now part of the core. But still, it allows you to do everything with last.fm that you can on the website, and also allows you to scrobble.

  • Performance enhancements:

    Not as many of these as there have been in previous releases, but lets try

    • Faster searching. Definitely obvious. Searching is almost straight away in my library (its only about 1000 items just now though, not sure what it will be like with really large ones.
    • Less CPU intensive. It seems to be less CPU intensive, but this isn’t an exact science :P
    • Multiple files. Supposodly deleting and selecting multiple files is faster. I can vouch for the selecting, but I don’t see why I would ever need to delete lots of files at once, so I don’t feel like trying that, I’ll take their word for it.
    • Fewer crashes. Obviously I can’t test this one until having it running for a while.

Future things:
They have quite a few interesting ideas for the next few releases. The august one will have device firmware update, MSC device support, playback of AIFF MS-ADPCM, WMA 1 & 2 and AAC LC, editing metadata of ASF and M4A files, improvements to metadata editor and transcoding.

Other things they need to get done before it can surpass the likes of Amarok and Banshee, are podcasting support (it really doesn’t work just now) and cd ripping, which will be included in the October release.

To be honest, I love this release, it has a few cool features, and we are getting closer to a fantastic media player. It really needs to get into the repos for Ubuntu, in my opinion, and I’ve outlined what it needs to add in above there.

This release has gone from ~79M to ~90M of RAM with 20 addons and playing music. This is not bad, but we need to make sure it doesn’t keep going up, but this is the only bad thing I can find about this release apart from features that don’t exist yet. I love Songbird, and I really want it to be a fantastic and popular Media Player

p.s It seems I was beaten by Alan Lord to put a review out on Songbird, ach well.

Ubuntu 9.10 Alpha 2

Wednesday, June 17th, 2009

I have decided that I am going to go through the whole of Karmic Koala’s development, and will write bugs, and document my problems etc with it.

So, I just upgraded from Alpha 1 (in which nothing was different really…just a debian sync) to Alpha 2.

What happened now? My audio setup has been mucked up. Woop! I had a great pulseaudio setup with pavucontrol, and everything was working fine. Now…its gone back to only 1 output working. Which is kind of annoying. Will try and fix it and see if I can.

I have also notices that firefox 3.5 is in the repo now (although it is called firefox-3.1, even though the version number is 3.5b4).

Gnome 2.27.1 is the version now, but I can’t see anything different with it, and also the kernel has been updated to 2.6.30-5.6.

Apart from these things, I can’t notice anything else really new, but it is only the second alpha, so there should be lots more to come.

***EDIT***

Turns out the problem lies with firefox. I can have more than 1 app using my sound card. Unless one of them is Firefox. If firefox uses my sound card, nothing else can. And if something else is using my sound card, firefox can’t. But, everything else seems fine. Odd.

Dropbox, UbuntuOne? No? Ok…how bout Spideroak?

Monday, May 18th, 2009

Let me say before any of this – this is not an UbuntuOne rant, like everyone else seems to be doing over at Ubuntu Planet. It just so happened that I just found out about this today.

I have used dropbox for a while – I use it to share things between my Desktop and my uni laptop, and also as a sort of document backup thing. Now, this is all very well and good, but what if dropbox dies? (I know, very unlikely thing, but ya never know, you can never be too careful). Well…Canonical just released UbuntuOne. A cool new dropbox-esk thing.

There are a few problems with UbuntuOne. First of all…it currently runs only on Ubuntu. It can be packaged for, say, fedora or opensuse or something, but as far as I can see, noone has done that yet. Also, it doesn’t run on Windows or Mac, and although I don’t like them as operating systems, we still need to agree that they do actually exist, and we need to create apps for them. They are not my choice of OS, but isn’t diversity everything that Linux stands for? The choice? So we need something that will run on more than just Linux.

Second of all…and I know…this sounds like a pathetic thing to say, but the back-end is not opensource. Now, yes, one might say “Neither is Dropbox”, but dropbox don’t say they stand for freedom and opensource. Canonical have said that it would be easy to create a server very similar to UbuntuOne, because it is based on, I think they said iFolder, am not sure though.

In this case, why the heck is it closed? What is the point in closing it, if it is easy to put the exact same thing together? I do use some proprietry things (dropbox, nvidia drivers) but I object to a company saying “We do opensource” and having something closed. This is, IMHO, pathetic.

So, I’m not happy with UbuntuOne, so what will I use as my dropbox’s “backup”? Well, Paul Mellors posted about SpiderOak, a new dropbox-esk filesharing backup thingy.

So, I tried it out, and I’m very happy. I much prefer it to dropbox, in fact. First of all, you have none of this dropbox folder nonesence. That drives me insane. I don’t want to link everything to my backups, thats stupid. I want them to backup where they are, and SpiderOak does this. Which is brilliant.

SpiderOak, like dropbox, comes with a free 2GB (which is all I need for my documents and pictures just now) and has a paid 100GB service (and 200GB, 300GB etc etc) for $10 per 100GB that you want. As mentioned, this works out at under £7 per 100GB of space that you want. Not bad, one has to say. Better than dropbox anyway.

SpiderOak allows you to add as many computers as you want to your account (Windows, Mac, Linux) and just syncs whatever folders you want on all your computers, and puts them wherever you want. I think you can also choose NOT to sync specific folders with specific computers, but will have to test this out (Ooooo…I can feel a sequel post coming on).

Finally…it is not opensource, but they are going to opensource it soon, which is good. So…for everyone who wants a (soon to be opensource) alternative for Dropbox, but isn’t running Ubuntu (or doesnt want the limitations of UbuntuOne), but doesn’t have the money to spend on their own server, I would recommend this highly.