Do I really need to use Nginx as reverse proxy to Apache ???
I've experimented with using stand-alone Nginx - although not extensively - and everything seemed to go swimmingly. Not having tried the reverse proxy method I really can't compare. I'm thinking perhaps the many post I've encountered suggesting this proxy setup may be outdated.
11 Replies
Although, Lighttpd alone, so if I used nginx, it'd be nginx alone.
so I have MySQL+nginx+PHP with wordpress+phpbb running
and I have only ~40mb of memory used with 320mb free on my linode360
There are some hackish how-tos out there, but it's hard to take nginx seriously as a standalone server when the recommended method for installing php support requires installing lighttpd. The other favorite method involves recompiling php. Sorry, nginx, come back when you've grown up.
One important criterion for me is to be able to keep my system patched with my Linux distribution's package manager. While nginx has a lot of mindshare among vps experimenters, the distro packagers haven't yet made nginx easy to patch or configure.
I'd still like to use nginx as a reverse proxy for static files, passing only php requests to Apache. I haven't found a simple recipe even for that, though. The nginx fans don't seem to want to share any requests with Apache, but would rather let nginx handle php by itself. So I'm taking the path of least resistance and sticking with Apache alone. If traffic warrants, I'll put on my hip boots and try again to set nginx up as a reverse proxy.
When my distro's package manager knows how to set up phpmyadmin using nginx as the webserver, and keep the whole thing updated, then I may be ready to dump Apache.
apache should be on port 8080 substitute in your hostname and file path.
@H3LR4ZR:
try this for your nginx config.
Thanks for the leg up! I'll give it a try.
Nginx is perfectly capable of running a good website on its own, as long as you can get the rewrite rules to work (much easier than lighttpd IMO) and you don't need Apache-specific techniques (the most common problem being .htaccess configuration directives scattered throughout the document tree). You can use PHP5 FastCGI on its own (you don't need to install lighttpd), or you can take advantage of spawn-fcgi, which has recently been separated from lighttpd. Just download it from its home page && make && make install. But AFAIK Ubuntu 9.10 lets you install spawn-fcgi on its own without having to pull in the entire lighttpd webserver.
On the other hand, Apache is also a very capable server, and it works very well even in a VPS provided that you tell it to make efficient use of RAM. The worker MPM is even better, but it's a bit of a hassle to set up correctly. If you need Apache-specific functionalities and you're not exactly experiencing a shortage of system resources, you don't need to board the nginx/lighttpd/whatever bandwagon.
Maybe Nginix is all grown up, but we just don't know it ???
@rbiffl:
There are some hackish how-tos out there, but it's hard to take nginx seriously as a standalone server when the recommended method for installing php support requires installing lighttpd. The other favorite method involves recompiling php. Sorry, nginx, come back when you've grown up.
me, i'm just concerned with the later.
@kjb:
I'm thinking those out-of-date how-tos are the problem,… because a few months ago I tried installing with the nWeb Script - Easy installer script for Debian / Ubuntu (Installs nginx, with PHP and MySQL) found at
http://thehook.eu/tools/nweb/ and everything seemed to work fine-n-dandy -- and if I remember correctly, with fastcgi ready to rock. phpmyadmin slid right in and worked just fine, too.
This script looks interesting and I'd never heard of it before, so thanks for the pointer.