By kcdcox
I’m attempting to host multiple applications (one node and one static–thus far) from my droplet. Therefore I would like to be able to have separate folders within my home directory (home/kev) for each–for example: home/kev/website1.com and home/kev/website2.com. However, my node.js app only works if the server files are directly in home/kev and if I put them within a subfolder of kev, I get 'Error: ENOENT: no such file or directory, stat ‘/home/kev/server/public/index.html’ I need to be able to direct DO to the correct folder, but I’m not even sure how it know’s to look within kev in the first place, so debugging has been fruitless. I would love any help with this, thanks in advance!
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!
Hello,
You would need to find out what web server you are using first. To do that, you could run this command:
sudo netstat -plant | grep 80
This would show you the service that is currently listening on port 80. I believe that it could be either Nginx or Apache.
If you are using Nginx, you could achieve what you are trying to do with Nginx server blocks. You can have a look at this article here on how to set that up:
If you are using Apache, then you could do the same with Apache Virtual Hosts. You can have a look at this article on how to set that up:
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.