Discussion:
Hosting many sites with 1 account
(too old to reply)
b***@hotmail.com
2016-05-15 18:27:52 UTC
Permalink
OK, so my webhosting company told me that I can host many sites with one webhosting account - preumably I have to make different directories for each, and upload each site within each one - I was just wondering, how does this work? I mean, Apache has to know that, eg. www.site1.com is in /home/me/site1/ - how is it told that, and which part of the HTTP protocol is involved, exactly?

Thanks.
Barry Margolin
2016-05-15 22:08:27 UTC
Permalink
Post by b***@hotmail.com
OK, so my webhosting company told me that I can host many sites with one
webhosting account - preumably I have to make different directories for each,
and upload each site within each one - I was just wondering, how does this
work? I mean, Apache has to know that, eg. www.site1.com is in
/home/me/site1/ - how is it told that, and which part of the HTTP protocol is
involved, exactly?
Thanks.
Apache is told in the httpd.conf file, using VirtualHost directives that
give the rules for each site name.

In the HTTP protocol the client sends a "Host:" header that says which
site name it's requesting. So if you go to the URL
http://www.example.com/path/to/file the client connects to the server
and sends

GET /path/to/file HTTP/1.1
Host: www.example.com
--
Barry Margolin
Arlington, MA
Continue reading on narkive:
Loading...