Apache and Lighttp on one server

Namesniper

Verified User
Joined
Jan 5, 2007
Messages
103
Hi,

Has anyone run apache+lighttp or apache+any otehr web server on one the same server ?

Usualy its possible by using mod_proxy and forwarding particular types of files to apache to handle and others to other web server software but it may crash DA.
Any tried to run two web servers on the same server with DA installed ?
 
As long as you run them on different ports you shouldn't have any problems.

But if you run, for example, www.example.com, on a different server/port (for example, port 93), the URL would be:

http://www.example.com:93

and anyone just using

http://www.example.com

would get an error.

So you'd probably not want to run it for any pages users might want to type in directly.

Jeff
 
As long as you run them on different ports you shouldn't have any problems.

But if you run, for example, www.example.com, on a different server/port (for example, port 93), the URL would be:

http://www.example.com:93

and anyone just using

http://www.example.com

would get an error.

So you'd probably not want to run it for any pages users might want to type in directly.

Jeff

Jeff,

The idea is to put apache to handle .php files and lighttp to handle html/jpeg/gif files,that way each web server will handle what its known to handle the best and the server load will be optimal.

I guess i cant do that by using different ports so the address should always be www.domain.com/file without additional port info like www.domain.com:91/file

Is there a way to set it up sp particular files or directories get handled by apache and otehrs by other web servers ?
 
The idea is to put apache to handle .php files and lighttp to handle html/jpeg/gif files,that way each web server will handle what its known to handle the best and the server load will be optimal.
Then all php files would have to be something like this:
Code:
http://www.example.com/filename.php
and all html files (for example) would have to be something like this:
Code:
http://www.example.com:81/index.html
which would mean rewriting of every link in the system and no standard code would work.

Presumably you can have http work on (for example) port 81, and lighttp on port 80, in which case you could get away with:
Code:
http://www.example.com/index.html
and
Code:
http://www.example.com:81/filename.php
but that too would require changes to everyone's uploaded code.
I guess i cant do that by using different ports so the address should always be www.domain.com/file without additional port info like www.domain.com:91/file

Is there a way to set it up sp particular files or directories get handled by apache and otehrs by other web servers ?
Interesting question. You might want to search the web; I'd look for help specifically on the lighttpd forums as that's where people would most likely be looking for this kind of solution.

Jeff
 
I already did and couldnt find the answer,thats why i have posted here.
Thanks anyway.
 
It is possible. However you'd have to compile mod_proxy into Apache statically. It was one of the biggest problems I had when I tried to use Apache to proxy static requests to Lighttpd. Using apxs failed to work and had puzzled me for days until I tried the static.

The rest is simple, all you have to do is edit the vhosts files when your in the custom httpd configurations page in DA. All you have to do is enable it in the vhosts file and point your static directory to lighttpd instead.
 
Could you please post more detailed instructions ?

Also i am on FreeBSD,are you on Linux ?
 
Yes I'm on Linux. I've yet to use FreeBSD. From using Mac OSX's ssh and the system I assume there are some differences but it is not too much different that the follow of what I'm going to tell you is hard to convert into freebsd commands.

http://servers.linux.com/servers/06/01/27/1813223.shtml?tid=118

Here's an article which got me interested into doing what your trying to archive. The hardest part in this article was to get Apache's mod proxy working. Since I was on Apache 2.x I ran had to run ./configure --help and I figured out that I could compile mod_proxy into Apache statically and doing that worked. I can't remember the exact compiling flags as this was over a year ago when I tried.
 
I just thought of something. DA uses apache logs to determine domain web traffic. So does both AWStats and webalizer.

Do you have a way to get those stats from lightppd?

Jeff
 
Back
Top