Welcome! Log In Create A New Profile

Advanced

nginx vs apache

Posted by ryan14 
nginx vs apache
August 23, 2009 04:55AM
Hi, I am going to be running a server with a php/mysql social networking site that has ssl(https) for login only and also css and javascript. I am trying to decide whether to use nginx OR apache.

What are the pros and cons?

Does nginx serve dynamic content too or just static content?

Does nginx work with SSL(https)?

Does nginx support mod rewrite url WITHOUT .htaccess like www.url.com/name, instead of www.url.com/546456jk5jkh

Is nginx 100% compatible with cpanel so all cpanel's features will work? Does nginx have any documentation on how to integrate with cpanel?
Re: nginx vs apache
August 25, 2009 12:08AM
ryan14 Wrote:
-------------------------------------------------------
> Hi, I am going to be running a server with a
> php/mysql social networking site that has
> ssl(https) for login only and also css and
> javascript. I am trying to decide whether to use
> nginx OR apache.
>
> What are the pros and cons?

The big pro is low memory footprint and predictable response to load. Cons? Can't think of any. ;)

>
> Does nginx serve dynamic content too or just
> static content?

There is native support for fastcgi. Most people run php as a fastcgi process (with or without php-fpm) or proxy php requests to a stripped down Apache. The advantage there is that Apache feeds the response to nginx almost instantaneously and closes the connection, freeing the slot for another connection. Using Apache as web server and to serve php means Apache will keep that connection open as long as it takes to give the entire response to the client (plus a keep-alive period if you have that set). I believe that each Apache process handles one connection at a time whereas an nginx worker process can handle thousands. So your Apache process will free up quickly and release memory and you will need many fewer of them to handle the same number of requests per second.
>
> Does nginx work with SSL(https)?

Yes. It's very easy to configure. There are examples in the Wiki.

>
> Does nginx support mod rewrite url WITHOUT
> .htaccess like www.url.com/name, instead of
> www.url.com/546456jk5jkh

There is a rewrite module that is compiled by default. "Standard" Apache rewrites are usually fairly simple to convert.
>
> Is nginx 100% compatible with cpanel so all
> cpanel's features will work? Does nginx have any
> documentation on how to integrate with cpanel?

No. I don't know if anyone is using nginx with cPanel but cPanel is pretty much married to Apache. I wouldn't recommend trying it. I think that most users go without a control panel or with minimal use of something like Webmin for configuring BIND, FTP, and POP/IMAP/SMTP. If you only plan to run one site on the server then a control panel is really needless overhead. I use cPanel/WHM/WHMCS for my shared hosing business and wish there was a way...

--
Jim Ohlstein
Re: nginx vs apache
August 28, 2009 01:03AM
well if the litespeed web server(litespeedtech.com) is compatible with cpanel, plesk, ensim, direct admin, why can't nginx be compatible with cpanel?

You should make it compatible with cPanel so it over-rides/disables Apache, so nginx can be the main server with cPanel.
Re: nginx vs apache
August 28, 2009 01:50PM
I don't write the software so I can't "make it compatible with cPanel". However, it's not likely to ever happen since .htaccess support will never be a part of nginx. Perhaps you want to pay for Litespeed? The reason that Litespeed is made compatible with cPanel is because it is a closed source commercial product and they are looking to expand their market. We're talking about free open source software released on a BSD-like license. If you feel you need cPanel support you can *pay* someone to produce it. Unfortunately, in the process you'd probably be gutting all that is good about nginx.

Better yet, you might want to learn how to administer a server without a control panel. That's how most of us do it. No disrespect intended, but frankly if you are that dependent on a control panel then you probably are better off with Apache or with an Apache compatible product like Litespeed.

--
Jim Ohlstein
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready