Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Nov 17, 2010 6:11 pm 
Offline
Senior Newbie

Joined: Wed Nov 17, 2010 5:57 pm
Posts: 8
Hi All,

I'm new to VPS and have an issue. I'm trying to setup FastCGI to run PHP files for Apache2. I'm trying to setup a Joomla site and have no knowledge of nginx so I've stayed away from it. I can't see to find a tutorial on how to setup FastCGI.

I found a couple tutorials online but they seemed incomplete. Each time when I finished, I was getting 500 server errors for PHP files. I haven't been able to get PHP5 to work either.

I'm running Debian 5. Does anyone know of a tutorial that is good to setup FastCGI?


Top
   
PostPosted: Wed Nov 17, 2010 6:18 pm 
Offline
Junior Member
User avatar

Joined: Thu Apr 23, 2009 2:32 am
Posts: 41
Website: http://www.linode.com/
This guide may be helpful: http://library.linode.com/web-servers/n ... an-5-lenny


Top
   
 Post subject:
PostPosted: Wed Nov 17, 2010 6:20 pm 
Offline
Senior Newbie

Joined: Wed Nov 17, 2010 5:57 pm
Posts: 8
Thanks. I saw that but also saw it said Nginx. May I still use it as described for Apache?


Top
   
 Post subject: Arrggghhh.
PostPosted: Wed Nov 17, 2010 6:28 pm 
Offline
Junior Member
User avatar

Joined: Thu Apr 23, 2009 2:32 am
Posts: 41
Website: http://www.linode.com/
Sorry about that, I saw "nginx" in your post and my mind jumped to the nginx/PHP-FastCGI guides :). This guide is for running PHP apps as CGIs under Apache on Debian: http://library.linode.com/web-servers/a ... an-5-lenny

Is there a particular reason you're specifying FastCGI, or will your applications work under the commonly-used Apache/mod_php combination?


Top
   
 Post subject:
PostPosted: Wed Nov 17, 2010 6:33 pm 
Offline
Senior Newbie

Joined: Wed Nov 17, 2010 5:57 pm
Posts: 8
I'd just read that FastCGI is faster than CGI. If you disagree or think the difference is marginal then I'm all for doing what's easy.

The tutorials in the library are quite useful, by the way.


Top
   
 Post subject: FastCGI vs. CGI
PostPosted: Wed Nov 17, 2010 6:44 pm 
Offline
Junior Member
User avatar

Joined: Thu Apr 23, 2009 2:32 am
Posts: 41
Website: http://www.linode.com/
FastCGI (more information here: http://www.fastcgi.com/drupal/) is faster than plain "old fashioned" CGI because there's no need to spawn a new copy of the interpreter each time a script is run. However, to take advantage of this, applications need to be written as FastCGI apps (you can use wrappers to execute "plain" scripts under FastCGI as well).

It should be noted that mod_php, mod_perl, and other modules exist to solve the same problem of having to load an interpreter for each script request. In all likelihood, if you're running Apache, mod_php will serve your needs just fine. Our Debian LAMP guide covers setting up a web server in this fashion: http://library.linode.com/lamp-guides/debian-5-lenny/

Thanks for the compliments on the Library :).


Top
   
 Post subject: Re: FastCGI vs. CGI
PostPosted: Thu Nov 18, 2010 11:23 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
pparadis wrote:
It should be noted that mod_php, mod_perl, and other modules exist to solve the same problem of having to load an interpreter for each script request. In all likelihood, if you're running Apache, mod_php will serve your needs just fine. Our Debian LAMP guide covers setting up a web server in this fashion: http://library.linode.com/lamp-guides/debian-5-lenny/


At the expense of wasting memory, sure. mod_php will load PHP into every single Apache process even if they're serving up static content.


Top
   
 Post subject: Needs and options.
PostPosted: Thu Nov 18, 2010 11:33 am 
Offline
Junior Member
User avatar

Joined: Thu Apr 23, 2009 2:32 am
Posts: 41
Website: http://www.linode.com/
Quote:
At the expense of wasting memory, sure. mod_php will load PHP into every single Apache process even if they're serving up static content.

It's important to look at a site's actual requirements and understand the tuning options available in Apache before deciding to throw mod_php out over something like this. Many high traffic sites use it without any issues, and the actual traffic expected on a site should be taken into consideration, with load testing, before making such a call.

If optimizing the memory footprint and overall performance is critical, it's always possible to offload static content to something else, such as nginx or another web server daemon, without having to use it for everything. This has also been a common practice for high traffic sites.

Edit/addition:

For sites with very high traffic, it is often highly desirable that they be hosted on more than one web server for traffic management and redundancy purposes. One method of accomplishing this is discussed here: Build a Highly Available HTTP Load Balancer on Ubuntu 10.04 LTS (Lucid)


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


Who is online

Users browsing this forum: No registered users and 2 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