Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic

Nginx alone v. Nginx/Apache
Nginx alone  59%  [ 10 ]
Nginx/Apache  41%  [ 7 ]
Total votes : 17
Author Message
PostPosted: Thu Oct 29, 2009 12:27 pm 
Offline
Junior Member
User avatar

Joined: Wed Jan 16, 2008 1:23 pm
Posts: 30
ICQ: 640975757
Website: http://cybrcaf.net
Location: half-way between my ears
Do you think it's really advisable to use Nginx as a reverse proxy to serve static files and have Apache handle all of the dynamic content?

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.


Last edited by kjb on Thu Oct 29, 2009 6:26 pm, edited 2 times in total.

Top
   
 Post subject:
PostPosted: Thu Oct 29, 2009 12:52 pm 
Offline
Junior Member
User avatar

Joined: Sun Oct 02, 2005 11:54 am
Posts: 43
Website: http://www.garyscott.net
Location: Goleta, CA
No, just use Apache. These are just tweakers suggesting the use of another webserver.


Top
   
 Post subject:
PostPosted: Thu Oct 29, 2009 1:06 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
I use Lighttpd, you insensitive clod.

Although, Lighttpd alone, so if I used nginx, it'd be nginx alone.


Top
   
 Post subject:
PostPosted: Thu Oct 29, 2009 2:16 pm 
Offline

Joined: Thu Oct 29, 2009 2:11 pm
Posts: 1
ICQ: 829664
Location: Russia
im using nginx alone with php as fastcgi
so I have MySQL+nginx+PHP with wordpress+phpbb running
and I have only ~40mb of memory used with 320mb free on my linode360


Top
   
 Post subject:
PostPosted: Fri Oct 30, 2009 12:50 am 
Offline
Newbie

Joined: Thu Oct 29, 2009 4:47 pm
Posts: 4
I'm setting up a new server, and I'm very tempted to use nginx alone, but I just can't find all the documentation I need to set up all the pieces: php, https, virtual hosts. That's not mentioning the rewrite rules that packages assume will be translated by Apache.

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.


Top
   
 Post subject:
PostPosted: Fri Oct 30, 2009 2:47 am 
Offline
Senior Member

Joined: Mon Apr 27, 2009 7:36 pm
Posts: 59
Website: http://www.xenscale.com
Location: Boise, ID
try this for your nginx config.

http://gist.github.com/222562

apache should be on port 8080 substitute in your hostname and file path.


Last edited by H3LR4ZR on Fri Oct 30, 2009 1:36 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Fri Oct 30, 2009 3:48 am 
Offline
Newbie

Joined: Thu Oct 29, 2009 4:47 pm
Posts: 4
H3LR4ZR wrote:
try this for your nginx config.


Thanks for the leg up! I'll give it a try.


Top
   
 Post subject:
PostPosted: Fri Oct 30, 2009 7:58 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Don't go to the hassle of running two http daemons side by side, if you can avoid it. One more daemon is one more point of failure, and one more security/maintenance headache.

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.


Top
   
 Post subject: all grown up ?
PostPosted: Fri Oct 30, 2009 1:17 pm 
Offline
Junior Member
User avatar

Joined: Wed Jan 16, 2008 1:23 pm
Posts: 30
ICQ: 640975757
Website: http://cybrcaf.net
Location: half-way between my ears
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.
Maybe Nginix is all grown up, but we just don't know it ???

rbiffl wrote:
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.


Top
   
 Post subject:
PostPosted: Fri Oct 30, 2009 1:32 pm 
Offline
Senior Member

Joined: Mon Apr 27, 2009 7:36 pm
Posts: 59
Website: http://www.xenscale.com
Location: Boise, ID
while I agree with you that running two http daemons adds more 'moving parts' and thus more points of failure, it works out to be a good solution when users expect to work on apache and won't/can't learn syntax for a new server.


Top
   
PostPosted: Fri Oct 30, 2009 2:40 pm 
Offline
Junior Member
User avatar

Joined: Wed Jan 16, 2008 1:23 pm
Posts: 30
ICQ: 640975757
Website: http://cybrcaf.net
Location: half-way between my ears
good point H3LR4ZR. so maybe we have two scenarios - 1.) a solution built for users with their various needs and abilities - and 2.) a system built for itself, with in-house admin, etc,... ???
me, i'm just concerned with the later.


Top
   
 Post subject: Re: all grown up ?
PostPosted: Fri Oct 30, 2009 4:39 pm 
Offline
Senior Newbie

Joined: Sat Apr 18, 2009 6:21 pm
Posts: 8
Location: Europe
kjb wrote:
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. :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group