Forums

Apache to NGINX (25 posts)

  1. WPtesting
    Member
    Posted 4 months ago #

    I'm planing to migrate from Apache to NGINX.
    Q1> How to migrate a WP Multisite from Apache to NGINX?

    Reasons: Faster, Lighter
    Drawbacks: No CGI, Subversion, WebDAV, .htaccess support
    #The CGI problem can be fixed by FastCGI
    #Subversion is not that important
    #WebDAV is kinda important but we can live without it.

    Q2> BUT what about .htaccess???

    Q3> What kinda problems i can face?

  2. en3r0
    Member
    Posted 4 months ago #

    There are quite a few guides out there that will give you the configs you need for nginx, so you will not longer use .htaccess.

    I am currently going through this process myself and having a hard time with the configs even though there are tutorials.

  3. Pothi Kalimuthu
    Member
    Posted 4 months ago #

    The lead dev, Nacin, has already written a lengthy reply for a similar question about a week back.

    For your #Q2: htaccess files can be handled by try_files directive or rewrite directive. There is no automatic way to create these (like .htaccess file).

    For your #Q3: I have not got any issue when setting up the test environment of WP Multisite. I have no production server experience, yet! That's why I linked Nacin's reply.

    Update: For #Q1: You may follow the instructions found in http://wiki.nginx.org/WordPress. Again, I'm speaking only from my test environment knowledge. Thanks.

  4. WPtesting
    Member
    Posted 4 months ago #

    Is there any way to test it locally? I mean is there any stack like WAMP?

  5. Pothi Kalimuthu
    Member
    Posted 4 months ago #

    I had success installing Nginx in Linux locally. Not sure, if there is any stack that support Nginx in Windows.

  6. WPtesting
    Member
    Posted 4 months ago #

    Missing "Ipstenu" and her experience in this area :( But we have some experienced users like "Pothi Kalimuthu" :)

    I'm looking for a Windows solution.
    Interestingly .htaccess can be used in Engine-X if we configure it as a front-end proxy to Apache.
    Anyone is using it along with Apache?

      Thanks
  7. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 4 months ago #

    I'm using Apache and know sod all about nginx, which is why I had nothing to say. (When I don't reply, it's because (1) I don't know or (2) I can't be nice ;) )

  8. WPtesting
    Member
    Posted 4 months ago #

    I know both of these, that you are using Apache and having a quiet little experience with engine-x at this time. What I meant was, I'm missing your guidance in this topic as you are not not that familiar with it. And ya I know your rules btw :)

  9. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 4 months ago #

    Don't do Windows either :)

    To be somewhat topical, when you asked 'What issues will I face' the biggest is support.

    By far, most of us use apache on linux for WordPress, and even more use it for Multisite. Totally made up numbers (gut feelings here): 70% of WP users use Linux, and 90% of Mutlisite users use linux.

    I do know, personally, 2 people who use nginx, one of them being wpmuguru.

  10. WPtesting
    Member
    Posted 4 months ago #

    It seems another misinterpretation :)
    I'm using Debian on my server. When i said "I'm looking for a Windows solution.", I was talking about My "Local System" to test NGINX on Windows . :)
    Obviously I'm a member of LAMP family, but want to join LEMP now :P

    And ya I agree, support is the biggest issue!
    That's why I'm looking for a proxy solution, like configuring it as a front-end proxy to Apache. So that unsupported requests will be handled by Apache thus we can use .htaccess and minimize all those migration issues.
    Would it be a good idea?

  11. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 4 months ago #

    Double I don't do windows then :) I do use a Windows PC when I must, but my localhost is all MAMP.

    I'm gonna ask what Nacin would (he's on vacation).

    Why do you think you need nginx?

  12. WPtesting
    Member
    Posted 4 months ago #

    From my understanding,
    NGINX is more beneficial under requests based heavy load instead of process based load. OR simply, it's beneficial for those who are running high-traffic(having/expecting) websites on VPS.

    Because Apache is heavier, slower and it consumes more CPU usage.
    Where NGINX:
    # improves "First Byte Time".
    # "Scalability" as it's asynchronous (event-based) server.
    # Engine-X helps to save resources (RAM, CPU) and improves overall performance.

    It seems Nginx can handle much more traffic as compared to Apache on same H/W configuration. :)

  13. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 4 months ago #

    Yeah, but ... are you having that load where you need it?

    I haven't pegged out apache yet, and I can take 40k hits in n hour without a glitch. On a VPS.

  14. WPtesting
    Member
    Posted 4 months ago #

    I'm using 512mb RAM & my VPS restarts at least 1 to 2 times a day due to heavy load. I optimized my site in order to reduce the processing based load AMSP.

    Ya, a little more memory could have fixed this problem easily, But I'm expecting more high traffic in near future.

    And last reason, but not the least, my nickname describes myself :)

  15. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 4 months ago #

    Okay. What server side caching do you have?

    I have an 800mb RAM box, though it's on a cloud/burst setup right now, so it's usage is weird. When I was on traditional VPS, though, I had 512mb and never used more than 60% on a big day. THAT SAID.

    httpd.conf is generally NOT optomized for WordPress. Your min and max servers, plus child settings, often need to be heavily tweaked. On top of that, I found that installing some sort of caching for PHP was critical. I use APC (it's built into PHP) and it took my average load from 75% memory to 40%. Also I turned off Clam and ClamAV (which have never actually helped me), as well as things like Entropy chat and other Cpanel/WHM features that cause bloat.

  16. Andrea_r
    team pirate
    Posted 4 months ago #

    You can also use nginx as a front end caching proxy server to apache. Now THAT is fun. :)

  17. WPtesting
    Member
    Posted 4 months ago #

    I'm using APC too :)
    What about Varnish? you have any idea?

    @Andrea
    That's what I've mentioned on my 3rd comment.

    Which one is better ?
    Varnish + Apache or NGINX + Apache or NGINX + PHP-FPM + APC ?

    What is the basic difference between these two "Using NGINX as a front end proxy to Apache" & "100% NGINX"?
    I understand that configuring it as a front-end proxy to Apache so that unsupported requests will be handled by Apache thus we can use mod_rewrite/.htaccess and minimize all those migration issues..
    But other than that? Is there any kinda advantage of using 100% NGINX?

  18. Pothi Kalimuthu
    Member
    Posted 4 months ago #

    Some food for thought.

    The latest video from WordPress.tv is a nice one. Here TJ Stein talks about Varnish + Nginx + PHP-FPM + APC.

    TJ Stein – Developing Fast & Scalable Severs for WordPress

    The slides are not visible in the video. So, here is the link to the slides.

  19. WPtesting
    Member
    Posted 4 months ago #

    @Pothi Kalimuthu
    Truly Awesome :)

  20. Andrea_r
    team pirate
    Posted 4 months ago #

    Is there any kinda advantage of using 100% NGINX?

    Do you only have one server? Use Nginx.

  21. WPtesting
    Member
    Posted 4 months ago #

    Do you only have one server? Use Nginx.

    Can you please elaborate? I'm not getting your point/logic.

  22. Andrea_r
    team pirate
    Posted 4 months ago #

    If you only have one server for your site and not multiple servers, you are better off using just Nginx instead of Apache+all the other options.

    You asked above:

    Which one is better ?
    Varnish + Apache or NGINX + Apache or NGINX + PHP-FPM + APC ?

    What is the basic difference between these two "Using NGINX as a front end proxy to Apache" & "100% NGINX"?

    How many servers you have is the difference.

  23. WPtesting
    Member
    Posted 4 months ago #

    And If I have multiple servers? I mean I'm planing for A Multi Servers Architecture. What would you suggest then?

    #Is there any good reference for WP-NGINX Configuration?

  24. Andrea_r
    team pirate
    Posted 4 months ago #

    And that's where we reach the extent of my server knowledge. :D

    At this time, there's no real decent WP-nginx resource. just some blog posts here & there, and mostly for one box.

    Anything bigger than that is vague, or basically a "here's how we did it" guideline.

    Good stuff here tho:
    http://wordpress.tv/2011/08/20/mark-jaquith-scaling-servers-and-deploys-oh-my/

  25. WPtesting
    Member
    Posted 4 months ago #

    Thanks :)

Reply

You must log in to post.

About this Topic

Tags