Migrate from Apache2 to nginx?

Discussion in 'Hosting Discussions' started by ubuntumatthew, Jan 6, 2009.

  1. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
    I'm working within some strict hardware restraints on a specific project and need to minimize the amount of memory being used by my webserver. Right now I'm using Apache 2. I like it. I'm comfortable with it because I know it pretty well. However, after doing all the configuration I can it is right at the border of what I am comfortable with.

    I've been doing some reading about nginx and it sounds incredibly promising. I realize I'll have to do some behind-the-scenes configuration work to make the switch, and that seems tedious. I can do it, I'm just not quite sure I want to yet.

    So, finally, to the question...

    Has anyone here ever switched a site from Apache2 to nginx? Was it worth it to you? Why? Any gotchas I should watch out for if I decide to make the switch?

    EDIT: I should mention, this is on a server that I have root access to, so I am not constrained by a web hosting company's limits, just my knowledge, capabilities and finances. No physical upgrades are possible at this moment...a memory upgrade would solve the whole thing, but that's not in the cards right now. I'm looking for a software or configuration solution.
     
    1
  2. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
    Update: I decided to make the switch and I couldn't be happier. nginx is FAST!! It uses less memory, too. (And this is being said by someone who knows and likes Apache.)
     
  3. MPerryman

    MPerryman Enthusiast

    126
    33
    +4
    Feature-wise, how does it compare to Apache? And will I have to learn a whole new set of commands (I realize the answer is probably 'yes')? I only recently became familiar with mod_rewrite and basic httpd.conf configuration, let alone the other stuff, haha
     
  4. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
    If you do a lot of rewriting, it will either require a lot of reading and learning, or in some cases just can't be done.

    Otherwise, I have found it to be pretty easy to set up and run. The only thing is that the documentation isn't nearly as good or complete as with Apache, so you may end up doing some Google searching.

    On the positive side, it is a lot faster and able to handle far more consecutive requests with much, much less memory usage. I'm impressed!

    So far, the best info I have found is on these two sites:
    http://wiki.codemongers.com/Main
    http://articles.slicehost.com/sitemap
     
  5. Baldilocks

    Baldilocks Fanatic

    3,523
    380
    +29
    I went to LightSpeed from Apache. How does that compare to nginx?
     
  6. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
    In terms of performance, they are similar.

    The main difference, as far as I can tell, is the licensing. Lightspeed is free to use (in the standard version, with a fuller featured enterprise version available for payment), but uses a limited-use proprietary license, while nginx's full version is free in cost and also uses a free BSD style license.

    That might not matter for most people. It mattered to me. :)
     
  7. MPerryman

    MPerryman Enthusiast

    126
    33
    +4
    You open-source guys and your licensing :tiphat:

    Looks like I've got yet another piece of software to dl now.
     
  8. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
    lol :Pleased:
     
  9. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
  10. Baldilocks

    Baldilocks Fanatic

    3,523
    380
    +29
    Yeah. I am using lightspeed now instead of Apache (with URLJet). Server load times are MUCH improved.
     
  11. Mosss

    Mosss Enthusiast

    216
    0
    +0
    Well, I have been using simplehelix.com services for about 4 months and I should say that it has Litespeed server which is 5 times faster than Apache and Zeus. I have unmatched speed connection and really satisfied with it.
     
  12. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
    I have heard nothing but good about Lightspeed in use.
     
  13. peachy

    peachy Neophyte

    3
    1
    +0
    Hi guys, I'd recommend you check out Cherokee too. It's lightweight, very fast and stable. It's also pretty resilient and due to the way it self monitors the webserver process and fast-cgi server. An added bonus for those on Ubuntu server is that they maintain packages for Ubuntu that are always up to date (although not in the official repos).

    Downside it that you will have to spend some time on URL rewrites, not because it is broken or difficult just because it is different. I noticed mention of Apache migration scripts recently on the mail list too.
     
  14. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
  15. el canadiano

    el canadiano But I said ███████████

    855
    270
    +31
    Are you fully using NginX? I know of a person who actually uses a hybrid of NginX and Apache.
     
  16. ubuntumatthew

    ubuntumatthew Bubblehead Star Child

    210
    103
    +4
    Fully. Apache got turned off last week.
     
  17. ferodynamics

    ferodynamics Neophyte

    1
    1
    +0
    I'm using NginX here, mostly WordPress installs. I admit, not having ".htaccess" is a bit frightening at first. But once you're past that learning curve, it's smooth sailing. To serve a typical blog post takes Nginx less than one-hundredth of a second on my VPS.
     
  18. Supermighty

    Supermighty Adherent

    348
    130
    +28
    How easy was nginx to learn coming from apache2?

    How does it handle php or fastcgi?
     
  19. WebhostGIANT_Rob

    WebhostGIANT_Rob Adherent

    365
    0
    +0
    I think that is very important to do the following: test both and then decide. Of course if you have such opportunity to test.