For the domains that I used in this guide, assuming that my VPS IP address is 220.127.116.11, I could add the following lines to the bottom of my hosts file:
By default, Apache comes with a default virtual host file called â000-default.confâ. It is good practice to create a new .conf file within /etc/httpd/conf.d if you are adding multiple websites to be hosted from the same web server, as this keeps the configuration clean and is easier to manage. If you need to access this long term, consider purchasing a domain name for each site you need and setting it up to point to your VPS server. In addition, we have also enabled port 80, but it is also possible to enable port 443. To do this, run the following command. Once virtual host configuration has been put in place and Apache reloaded, the relevant DNS records will need to be created so that the domains will resolve to the web server. If you haven’t already done so, you can get Apache installed on your server through apt-get: After these steps are complete, we can get started. In this example we can modify the /etc/hosts file and add the following entry.