[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 11-06-2007, 08:18 AM   #1 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
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 08:21 AM.
Eric is offline  
Old 11-06-2007, 08:51 AM   #2 (permalink)
NamePros Regular
 
Join Date: Mar 2006
Location: United Kingdom
Posts: 344
482.75 NP$ (Donate)

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).
__________________
http://bypasstopsite.com - Submit your proxy!
http://biggertwitter.com - Make twitter a bit bigger!
Currently Developing - Linux Screenshots
lee101 is offline  
Old 11-06-2007, 09:22 AM   #3 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

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, 09:30 AM   #4 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
Quote:
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, 04:08 PM   #5 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

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.

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, 05:12 AM   #6 (permalink)
NamePros Regular
 
Join Date: Mar 2006
Location: United Kingdom
Posts: 344
482.75 NP$ (Donate)

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.
__________________
http://bypasstopsite.com - Submit your proxy!
http://biggertwitter.com - Make twitter a bit bigger!
Currently Developing - Linux Screenshots
lee101 is offline  
Old 11-07-2007, 05:42 AM   #7 (permalink)
The Swamp Fox

Forum Moderator

 
Join Date: Oct 2004
Location: Camden, SC
Posts: 4,923
843.60 NP$ (Donate)

CrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech 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.
__________________
Denver Hunter | Logically Connected to Idologic, Inc.
Reseller and Fully Managed Dedicated Hosting Since 2001
Visit the web's best Christian Forum for discussion.
CrazyTech is offline  
Old 11-07-2007, 01:52 PM   #8 (permalink)
NamePros Regular
 
-PS-'s Avatar
 
Join Date: Jun 2006
Location: Sydney
Posts: 251
5.95 NP$ (Donate)

-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.

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 05:16 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85