| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NPQ's PA, Slave, and On Call Coder Technical Services | 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. |
| |
| | #2 (permalink) |
| NamePros Regular | 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 |
| |
| | #3 (permalink) |
| Senior Member | 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 |
| |
| | #4 (permalink) | |
| NPQ's PA, Slave, and On Call Coder Technical Services | Quote:
__________________ | |
| |
| | #5 (permalink) |
| Senior Member | 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 |
| |
| | #6 (permalink) |
| NamePros Regular | 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 |
| |
| | #7 (permalink) |
| The Swamp Fox Forum Moderator | 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. |
| |
| | #8 (permalink) |
| NamePros Regular | 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.
__________________ Site Armory, tools for your website | Webmaster SEO Forums | PHP Tutorial and coding forums |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |