Search code examples
linuxunixubuntuwebserverlighttpd

trying to have 3 domain names point to 3 seperate roots under 1 webserver


I have a webserver. I have really only ever needed N domainnames to point to that particular root, but now that i have started to expand, I wanted to sort of partition my webserver for different names. This is an example of what i want.

Domain Names:

alpha.com
bravo.com
charlie.com

Webserver:

/var/www/

Allocation:

alpha.com -> /var/www/

What i want all within the same server:

alpha.com -> /var/www/alpha/
bravo.com -> /var/www/bravo/
charlie.com -> /var/www/charlie/

then alpha/. would be the new root. That way the user will not see any fancy URL designs.

It will keep me with 1 server, but separate out the roots of the different components. I WAS just spinning up a new server over and over for different domain names, but i figured some things which are static could just all be lumped together since the sum processing power of them all is next to nothing.

I knew that if i go to namecheap/other and say:

alpha.com -> 127.0.0.1/alpha

it will then say something in the url similar to: alpha.com/alpha/ which i dont want.

Goal that i have been stumped over: making a,b,c looking like different servers while actually maintaining 1 server with different root nodes


Solution

  • The following explains how to use lighttpd to set up virtual hosting for your servers.

    http://www.cyberciti.biz/tips/howto-lighttpd-web-server-setting-up-virtual-hosting.html

    Following it, it is very straight forward and already have tested it out.