NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Apache + Lighttpd

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-06-2007, 09:18 AM THREAD STARTER               #1 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics

Apache + Lighttpd


I'm using Apache as the "main" server - PHP / SQL / etc etc. However, I want to set up lighttpd to serve the 'static' files (image / css / js files). Anyone happen to have any ideas?

EDIT:

Running Apache 2.2.6 w/PHP 5.2.5RC2 on CentOS 4.4
Last edited by SecondVersion; 11-06-2007 at 09:21 AM.
Eric is offline  
Old 11-06-2007, 09:51 AM   #2 (permalink)
NamePros Regular
Join Date: Mar 2006
Location: United Kingdom
Posts: 413
lee101 is a jewel in the roughlee101 is a jewel in the roughlee101 is a jewel in the rough
 




I'm assuming you're wanting to setup a lighttpd server on a different physical server, so you'd probably just want something reallly simple (no cpanel or anything) and then just install lighttpd & an ftp server yourself, that way there would be minimal load on the server. Also specs probably wouldn't need to be very high, since there wouldn't need to be much processing going on.

Or if you were wanting to set it up on the same physical server it'd have to run on a different port, say 8080, and could be installed side by side with apache, just a little more configuration needed. Although with that solution you probably wouldn't see that much of a performance advantage, and some filtering services may block servers running on ports other than 80 (I know my school used to, college does).
__________________
Linux Screenshots
lee101 is offline  
Old 11-06-2007, 10:22 AM   #3 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Out of interest why do you want to do this? You could set up lighttpd to listen on a different port and use for example www2.domain.com/location/of/image/image.gif as the address but you would have the overhead of running 2 webservers.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 11-06-2007, 10:30 AM THREAD STARTER               #4 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Originally Posted by peter@flexiwebhost
Out of interest why do you want to do this? You could set up lighttpd to listen on a different port and use for example www2.domain.com/location/of/image/image.gif as the address but you would have the overhead of running 2 webservers.
Most of my server's load is from static files. I've already got a few things in place to help reduce it, but I've heard lighttpd can work wonders. (and as far as overhead, from what I could understand, lighttpd virtually has none)
Eric is offline  
Old 11-06-2007, 05:08 PM   #5 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
It will have an overhead even if very little. Running 2 webservers from the same system is not necessarily the best solution. I personally would concentrate on lowering the load mySQL (including restructuring your tables if needed) and apache (such as the number of connections allowed etc) have first and then decide if more action is needed.
????: NamePros.com http://www.namepros.com/programming/392806-apache-lighttpd.html

You should also profile your applications to see what (if any) are causing bottle necks. You can use something like Zend Platform that can break down your application to each function call and tell you how much each is taking. You used to be able to get a free developer license, I assume this is still the case.

Also consider using something like Zend optimizer. This does not only work for files encoded using Zend Guard, it also speeds up normal code.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 11-07-2007, 06:12 AM   #6 (permalink)
NamePros Regular
Join Date: Mar 2006
Location: United Kingdom
Posts: 413
lee101 is a jewel in the roughlee101 is a jewel in the roughlee101 is a jewel in the rough
 




Have you considered hosting your static files on another account, such as a shared web host? That way your server only does the dynamic stuff, and all static files are offloaded elsewhere.
__________________
Linux Screenshots
lee101 is offline  
Old 11-07-2007, 06:42 AM   #7 (permalink)
NamePros Expert
Join Date: Oct 2004
Location: South Carolina
Posts: 5,050
SimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond reputeSimpleMan has a reputation beyond repute
 


Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
I'd have to say you're not going to garner much additional speed out of this type of configuration. The solution to your question would be to run them on different ports and pass the connections over to the Lighttpd server, but for what you're saying above, there's not really going to be a difference in performance.
SimpleMan is offline  
Old 11-07-2007, 02:52 PM   #8 (permalink)
NamePros Regular
 
-PS-'s Avatar
Join Date: Jun 2006
Location: Sydney
Posts: 251
-PS- will become famous soon enough-PS- will become famous soon enough
 



ok i have done this a few times,
you can use what ever httpd server you wish (i generaly use apache cause i use it else where), the best way to do it i have found, is to setup your httpd with only the require modules to run (ie no perl, php etc etc, just basicly the ability to send files), having stuff like php enabled does slow down even if it's not used.
????: NamePros.com http://www.namepros.com/showthread.php?t=392806

second you'll make to make sure that keep alive is turned on.

ok, for your application, i would suggest you add in something like define('STATIC_URL',http://static.domain.com);
and link anything that is static like <img src=\"".STATIC_URL."\/images/image01.gif">

that way you'll be able to change it on the fly, and it means you can do a gradual change over time to all your files.
-PS- is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 01:27 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger