Question

Can or should I install multiple sites on one droplet?

  • Posted July 31, 2014

Hi,

I was wondering could a single droplet support multiple sites? What is the best practice here?

  • If so how can I setup the dns?
  • Should I be looking at Nginx over apache?
  • I have no Nginx experience but the idea is to use my droplets as a testing ground to ultimately deploy Laravel sites.

Thanks,

Subscribe
Share

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

I was wondering could a single droplet support multiple sites?

Definitely! You can host as many sites as you want on a single droplet.

If so how can I setup the dns?

Simply point all of your domains/subdomains to your droplet’s IP address. Your webserver will take care of the rest.

Should I be looking at Nginx over apache?

It doesn’t matter – you can use whichever you prefer :)

I have no Nginx experience but the idea is to use my droplets as a testing ground to ultimately deploy Laravel sites.

See How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS. You’ll need to create a VirtualHost for each separate Laravel app you want to deploy.

Then, upload your Laravel app to /var/www/domain.com/public_html, and update DocumentRoot in your VirtualHost config to point to /var/www/domain.com/public_html/public.

Finally, you’ll need to allow Laravel to write to /var/www/domain.com/public_html/storage. You can do that by executing the folllowing commands:

sudo chgrp -R www-data /var/www/domain.com/public_html/storage
sudo chmod -R g+w www-data /var/www/domain.com/public_html/storage

Repeat that for every Laravel app you want to host.