Question

Setting up multiple domains and subdomains on one droplet?

will add info via mobile

Subscribe
Share

This comment has been deleted

sorry, had to post as comment, this forum is very broken on a mobile device.

Wondering if anyone can point me in the right direction on this? I did a lot of searching last night on Google but couldn’t seem to find someone doing this same scenario. I’ve included a write up below of what I’m trying to do.

We have one droplet (which is like server instance with static IP) on digitalocean.com account and need to set it up so that we can have multiple subdomains that each point to different subdomain within /var/www

We will also add other domains to this same server, so it will have, for example:

somedomain.com --> /var/www/somedomain test1.somedomain.com --> /var/www/test1somedomain test2.somedomain.com --> /var/www/test2somedomain anotherdomain.com --> /var/www/anotherdomain test1.anotherdomain.com --> /var/www/test1anotherdomain


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, it isnt that hard to get something like this and easily to find on google. I think you searched on the wrong keywords ;) Just add the domains you would like to use to your digital ocean domain manager. To get this working you need to setup your nameservers correctly. Login to the domain manager of your registrar, edit the nameservers to the nameservers of DO and it should work after some time.

Once you got the domains in the DO domainmanager, you need to create A records for the subdomains etc. to your static IP. So people will get redirected to your server.

After this you are almost done. Now you got the domain working, redirected to your server , you got to let your server handle the domain/subdomain to the proper directory. This depends on the kind of webserver you are using. With apache you need to use a different kind of virtual host than when you are using nginx for example. Just search for apache ,or whatever webserver your using, virtual host.

Hope this helps you, if I missed something im sorry im on my ipad currently.

Thanks, I am using apache and was trying different configurations with the virtual host, I can search more on it though