Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Can nginx be used in place of Apache?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Can nginx be used in place of Apache?

I asked this because i wanna know all apps that are running on apache can be run by xginx?

Comments

  • what applicatipns? php will run for example, but not mod_php

  • neroux said: what applicatipns? php will run for example, but not mod_php

    Apps like wordpress, vanilla forums, esoftscript, and other CMSs.

  • BradBrad Member

    @TheKiller said:

    Apps like wordpress, vanilla forums, esoftscript, and other CMSs.

    Most of those are PHP, so yes.

  • @TheKiller said:

    Apps like wordpress, vanilla forums, esoftscript, and other CMSs.

    yes, although they may be a need for tweaking or you won't be able to use the pretty url as nginx doesn't support .htaccess files

  • Just in case you want to convert rules from .htaccess to nginx rules, can use the tool at http://www.anilcetin.com/ to reduce learning curve :-)

  • I would actually recommend running nginx over Apache when it comes to small VPS. I got WordPress instance set up on 512 MB instance and it's humming along nicely even under a considerable load.

    I have actually switched to lighttpd, but that's another story. nginx is better when it comes to memory management, so you should be fine with it.

    The only thing thing that was already noted by @nhocconan you will need to figure out .htaccess replacement rules and all rewrite rules (think WordPress) will have to be adjusted to run on nginx.

  • The only thing you have to consider before switching is if you need any of the Apache extensions that may not exist for nginx, but for that you will have to analyze requirements for all your software packages.

  • My answer is use with caution. Technically all popular web apps written in PHP work well with nginx.

    I would carefully analyse all requirements and the current setup of production environment and see if nginx can fulfil those requirements.

    One feature people will miss the most is the "per-folder configuration" .htaccess. This is particularly useful in shared-host environment but not available in nginx for a good reason: performance.

    Test, double test (event more test if you are not 101% confident) your nginx configuration before rolling to production.

  • Good point dude, I heard many good things about nginx, but it never work out for me.

  • khavkhav Member

    I use Nginx for my site and it work very well.Low memory footprint , i can handle thousands of visitors daily on a very lowend box (256mb ram) and CPU load is very very low( < 0.3 @ all times).Btw i have access only to 1 core btw
    Apache cannot beat Nginx period

    I will suggest running Nginx+PHP+MySQL+Chive setup for your application.Chive is an alternative of phpMyadmin.If you install phpmyadmin it will install apache dependencies that why i ditch it

  • What?
    I can max out 1gb/s connection on 5$ vps with wordpress and nginx
    ( 1 core, 512 ram )
    While only 50-60% cpu will be used
    You should considering nginx for everything.

  • MunMun Member

    Nginx is a best at serving static files, but in reality, Apache is faster in heavy PHP environments.

    If you are having issues with your CMS I suggest add caching such as quickcache for Wordpress.

    Mun

  • Yeah nginx and apache are the same yet different. they both hanlde web requests. So they look a like nginx is really just a proxy and can serve static files. you use php-fpm and other fcgi,cgi, or http servers behind nginx. But apache has the magic of being all of the web servers and types all at once built into it.

  • WoopWoop Member

    If your script has problems running on nginx, just run nginx as a proxy to Apache, should help reduce CPU/Mem usage. Or just use Varnish which is just as easy to setup.

  • tchentchen Member

    Varnish and 'easy to setup' together... heh :P It's a PITA to get it not to do a hit_pass with all the cookies and crap flying around in a more loaded wp site. Still worth it though.

    Thanked by 1ironhide
  • I can only imagine one thing: webdav, the webdav support in nginx is pretty primitive even with the webdav plugin enabled, quite a few commands are not supported.

  • There r webdev servers for java. Php python ruby and so on

  • khavkhav Member
    edited March 2014

    @tchen said:
    Varnish and 'easy to setup' together... heh :P It's a PITA to get it not to do a hit_pass with all the cookies and crap flying around in a more loaded wp site. Still worth it though.

    Very true.....Varnish is a real PITA
    That's why i ditch apache all together and switch to Nginx+PHP-FPM. Frankly its no regrets and Nginx configuration is so much simpler.Only .htaccess to Nginx configuration can be quite challenging but http://www.anilcetin.com/ does a good job

  • aoleeaolee Member

    like khav i also ditch apache, Nginx+PHP-FPM is the way to go. though will be a bit difficult to get used to converting .htaccess rewrite in the beginning. don't worry lots of documentation out there.

  • wychwych Member

    Sometimes, nginx is great at static content although sometimes for heavy php its easy to place it as a cache setup than the main webserver.

  • Serving purely static content? thttpd FTW!

  • tchen said: Varnish and 'easy to setup' together... heh :P It's a PITA

    khav said: Very true.....Varnish is a real PITA

    Varnish is in fact a PITA. :)

Sign In or Register to comment.