spandso Posted July 19, 2021 Posted July 19, 2021 Can you please let me know how to host multiple websites with domains on a VPS? I already have one website/domain on my Heliohost VPS. Thanks!
balloons Posted July 19, 2021 Posted July 19, 2021 The VPS is freely configurable and needs a little more detail. What is your VPS web server and control panel?
spandso Posted July 19, 2021 Author Posted July 19, 2021 I didn't install any control panel. I work on the VPS using an SSH terminal connection.
balloons Posted July 19, 2021 Posted July 19, 2021 I also asked your VPS web server. The configuration file is different depending on the web server. Is it Apache? nginx? I like Caddy. If you just received a VPS, it is not yet installed. You need to work from there first.
Krydos Posted July 19, 2021 Posted July 19, 2021 There are two basic steps to adding a new domain to a VPS Set the A record for the domain on your DNS provider to the ipv4 of your VPS. Add the domain to your Apache or Nginx configuration. For instance if you're using Apache on Ubuntu 20 you could create the file /etc/apache2/sites-available/newdomain.conf and then symlink a copy of that file to /etc/apache2/sites-enabled/ to enable it. Here is some instructions to do this https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-ubuntu-20-04/ If you're using Nginx instead of Apache it will be similar. 1
spandso Posted July 19, 2021 Author Posted July 19, 2021 13 minutes ago, Krydos said: There are two basic steps to adding a new domain to a VPS Set the A record for the domain on your DNS provider to the ipv4 of your VPS. Add the domain to your Apache or Nginx configuration. For instance if you're using Apache on Ubuntu 20 you could create the file /etc/apache2/sites-available/newdomain.conf and then symlink a copy of that file to /etc/apache2/sites-enabled/ to enable it. Here is some instructions to do this https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-ubuntu-20-04/ If you're using Nginx instead of Apache it will be similar. Thank you Krydos. That's all the info I needed!
spandso Posted July 19, 2021 Author Posted July 19, 2021 28 minutes ago, balloons said: I also asked your VPS web server. The configuration file is different depending on the web server. Is it Apache? nginx? I like Caddy. If you just received a VPS, it is not yet installed. You need to work from there first. It's Apache. Already installed and running. I already have a website set.
balloons Posted July 19, 2021 Posted July 19, 2021 You need to set up a Virtual Host for that.https://httpd.apache.org/docs/2.4/en/vhosts/ Perhaps this explanation alone will allow you to proceed to a solution.
spandso Posted July 19, 2021 Author Posted July 19, 2021 20 minutes ago, balloons said: You need to set up a Virtual Host for that.https://httpd.apache.org/docs/2.4/en/vhosts/ Perhaps this explanation alone will allow you to proceed to a solution. Thank you.
spandso Posted July 20, 2021 Author Posted July 20, 2021 22 hours ago, Krydos said: There are two basic steps to adding a new domain to a VPS Set the A record for the domain on your DNS provider to the ipv4 of your VPS. Add the domain to your Apache or Nginx configuration. For instance if you're using Apache on Ubuntu 20 you could create the file /etc/apache2/sites-available/newdomain.conf and then symlink a copy of that file to /etc/apache2/sites-enabled/ to enable it. Here is some instructions to do this https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-ubuntu-20-04/ If you're using Nginx instead of Apache it will be similar. Sorry @Krydos, one more question. Do I have to keep the nameservers as is (ns1.heliohost.org; ns2.heliohost.org)?
Krydos Posted July 20, 2021 Posted July 20, 2021 1 hour ago, spandso said: Do I have to keep the nameservers as is (ns1.heliohost.org; ns2.heliohost.org)? No, you don't. You can use any DNS service you want for your VPS. Actually right now I recommend using external DNS such as through Cloudflare or through your domain registrar. Both of our nameservers run cPanel too so they will need to be rebuilt which means we will have some downtime on our nameservers as well over the next couple weeks. 1
spandso Posted July 20, 2021 Author Posted July 20, 2021 16 minutes ago, Krydos said: No, you don't. You can use any DNS service you want for your VPS. Actually right now I recommend using external DNS such as through Cloudflare or through your domain registrar. Both of our nameservers run cPanel too so they will need to be rebuilt which means we will have some downtime on our nameservers as well over the next couple weeks. Do you mean I need to install a DNS on my VPS? Sorry, I'm confused. Right now I have set the nameservers at my domain registrant as ns1.heliohost.org and ns2.heliohost.org. I edited the A record to the IP of my VPS. What do I have to do next?
balloons Posted July 20, 2021 Posted July 20, 2021 28 minutes ago, spandso said: I have set the nameservers at my domain registrant as ns1.heliohost.org and ns2.heliohost.org. If this is set, it will continue to reference the shared server. You need to change this. Krydos recommends using an external service for this. This is because there are some issues when configuring with VPS. Related topics:
spandso Posted July 20, 2021 Author Posted July 20, 2021 3 hours ago, balloons said: If this is set, it will continue to reference the shared server. You need to change this. Krydos recommends using an external service for this. This is because there are some issues when configuring with VPS. Related topics: Thanks. I went to create a cloudflare account and changed the nameservers and A record there. Also changed the nameservers at my domain registrar to point to the cloudflare's nameservers. It should take some time to see the change, but I guess I figured it out. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now