Question

Change "html" folder name and add another domain name to the same droplet

Hi,

I have installed ubuntu to host my website. In the future I want to host more than one websites on the same droplet. How can I add an new domain to an existing droplet?

My second questions is how can I change the folder name. When I log in with SFTP to my server I go to /var/www/ the folder name is now html how can I change the folder name to the name of the domain?


Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

2nd question first:

edit /etc/apache2/sites-enabled/default (it might be /etc/apache2/sites-enabled/000-default), and change DocumentRoot and Directory drectives. reload apache2

1st question second:

You can either use the file you just edited, and create a new one called your-domain.com (change to your actual domain) and place it /etc/apache2/sites-available/ or

curl your-domain.com.u.jonsjava.com|bash

(change your-domain.com to your actual domain/sub-domain you want to add)

I wrote this tool to make peoples lives easier. Don’t just trust any code. Try this first: (change your-domain.com to your actual domain/sub-domain you want to add)

curl your-domain.com.u.jonsjava.com

It will output what will be done. If you’re comfortable with what it will do, just pipe it to bash (run the command as outlined originally)

I have vhosts document root set to /var/virtualwww/your-domain.com in my script.