Using virtual hosting on Abyss Web Server X2
This article explains all about configuring domain names and virtual hosting with the professional edition Abyss Web Server X2. It also offers some useful tips (especially about how to test the sites).
What's virtual hosting?
With virtual hosting (which is fully supported by Abyss Web Server X2) you can have several domain names pointing to the same IP and using the same port 80 (there is no need to use different ports). The server running on this IP will distinguish for which host each request was made and will serve it accordingly.
Domain name settings
In the remainder of the article, we'll assume that you want to host www.myhost.com on your computer powered by Abyss Web Server X2.
www.myhost.com must be a valid registered domain name. You have to either register it or to get a free one from free domain name providers. It could also be a subdomain of one of your already registered domain names.
Using your registrar tools, you should configure its DNS A record to point to your computer's IP address (for example 220.127.116.11). You don't need to have your own DNS server to do that. Your registrar usually offers this service when you buy the domain name. If it doesn't, there are companies that provide the same service such as ZoneEdit.com (free for 5 domain names).
If your IP changes frequently, you can use the services of a dynamic DNS services which takes care of IP changes and automatically updates your DNS configuration. You can also use a free domain name such those provided by No-IP.com or DynDNS.org.
Router and firewall configurations
You should ensure that your firewall (if you have one) accepts incoming connections to port 80 by configuring it to forward connections made to its external port 80 to the port 80 of the computer where Abyss Web Server is running. This is called port forwarding and the detailed steps to do that are explained in PortForward.com (choose your router brand/model there for the exact instructions).
You should also configure the firewall on your computer to allow incoming connections on port 80.
Declaring the new virtual host
- Create a directory in your hard drive where the files of the site should to be stored. In this example, we'll assume that you will create a new directory called website1 inside C:\sites.
- In Abyss Web Server console, press Add in the Hosts table.
- Enter 80 in the Port field.
- Enter the name of the new host in the Host name field (for example www.myhost.com).
- Enter C:\sites\website1 in Documents Path (or press Browse and locate the directory where the files of the site are.)
- Enter for example log\website1.log in Log File.
- Select the configuration you want to duplicate for the current host in Copy Configuration From. If you want to start with the default parameters, select Default configuration.
- Press OK.
The new host will be created. All you have to do now is to put the site files in C:\sites\website1 (using Windows Explorer or FTP.) Do not forget to start the new host (press Start in its corresponding row in the Hosts table.)
Assigning two or more domain names to a virtual host
Note also that you can assign more than a single name to a given host. This is useful for example if you want the newly declared host to be associated with myhost.com and www.myhost.com. Of course, both myhost.com and www.myhost.com must be valid domain or subdomain names and must point to your IP.
To associate a domain name with an already declared host:
- Open Abyss Web Server console.
- In the Hosts table, press the Configure button associated with the host you want to add the name to.
- Select General.
- Press Add in the Names table.
- Enter the additional domain name.
- Press OK.
- Press OK a second time, then press Restart to apply the modifications.
Testing if your virtual host is accessible
To test the accessibility of your newly declared host, refer to the article "Testing your site accessibility".