By yWalker
i want to host first 2 domain in single droplet like domain1.com => /var/www/html/ and domain2.com=>/var/www/html/admin/
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!
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.
This is very easy using apache virtual hosts
Follow these instructions to achieve what you want
sudo cp /etc/apache2/siates-available/000-default.conf /etc/apache2/sites-available/domain1.com.confServerName domain1.comErrorLog ${APACHE_LOG_DIR}/domain1.com_error.logDocumentRoot /var/www/html/CustomLog ${APACHE_LOG_DIR}/domain1.com_access.log combineddomain2.com.confdomain1.com with domain2.com also do not forget to change DocumentRoot to /var/www/html/adminsudo a2ensite domain1.com.conf, domain2.com.conf.sudo service apache2 restartNow you can use domain1.com to access the site at /var/www/html and domain2.com to access the site at /var/www/html/admin
Hope this helps, revert back here for any further questions.
What is your webserver of choice.
I personally use NGINX.
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.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
