I have an apache server on a linux ubuntu server. I would like to configure a lighttpd server to serve all the static content.

link|improve this question

78% accept rate
feedback

migrated from superuser.com Feb 22 '10 at 15:36

This question came from our site for computer enthusiasts and power users.

1 Answer

up vote 0 down vote accepted

This is a very common setup. You'll find many advanced guides through a google search.

But the brief answer to this is both coding related and server configuration related. You'll need to set up lightthd to serve up requests in a similar fashion as the apache server. Then you'll need to set your code to query your images/js/css from the lighttpd server rather than the apache server.

So the apache server responds to www.somesite.com and within the source of the webpage requests will go to css.somesite.com, js.somesite.com and images.somesite.com. Set up DNS to point those three subdomains to your lighttpd server.

Your DNS entries should do this (Use A records)

  • www.somesite.com -> apache server ip
  • css.somesite.com -> lighttpd server ip
  • js.somesite.com -> lighttpd server ip
  • images.somesite.com -> lighttpd ip server
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.