Hello!
This is my first time setting up a website on my own static-IP server. I myself do not have much knowledge on networking, domains, subdomains, virtual hosts, DNS, etc. so before I attempt to configure anything I wish to get some instructions and help. I have searched these forums for any information and I did find some interesting things which unfortunately were not enough to answer my question. Anyway...
My goal is to set up a number of websites that can be accessed by subdomains ("http://website1.mydomain.com", "http://website2.mydomain.com" for example) on one linux computer with a static IP. I have my own Red Hat 9 linux PC that I use as a gateway, firewall and webserver (apache 2).
I have not yet registered a domain but suppose I register a domain like "www.mydomain.com" and set it to forward to my static IP, port 80. Now as I only have one static IP I would like to setup a number of websites on it and allow them to be accessed by subdomains. The question is how do I achieve that. I do prefer to have everything (including subdomains if possible) configured on my own server.
How do I configure my linux server to recognise when a user types a subdomain in his browser like "myfriend.mydomain.com" to access my PC and how to forward him to the appropriate website?
Having set up each website to be in its own folder, I had something like this in mind:
http://www.mydomain.com => /var/www/html/root
http://myname.mydomain.com => /var/www/html/myname
http://myfriend.mydomain.com => /var/www/html/myfriend
...
In the past I have read the Apache and virtual hosts configuration manual but I did not fully understand it.
I could use subfolders ("http://www.mydomain.com/myname" and "http://www.mydomain.com/myfriend") instead but I truly wish to use subdomains.
Any help, helpful links and/or info would be appreciated.