Question

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

Posted June 22, 2014 4k 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?

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.

×
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 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.
Submit an Answer