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