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

June 22, 2014 3.6k views
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?
1 Answer
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 (change to your actual domain) and place it /etc/apache2/sites-available/ or curl|bash (change 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 to your actual domain/sub-domain you want to add) curl 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/ in my script.
Have another answer? Share your knowledge.