Question

How to run multiple website on same Droplet that already host an active website?

Posted July 16, 2021 72 views
NginxPHPPythonPHP FrameworksDjangoJavaInitial Server SetupUbuntu 18.04Laravel

I’m quite new to backend and servers configurations.

I have a Django website already running using Nginx and Gunicorn and is successfully deployed to my Droplet.

I’m deciding to host multiple websites including test apps of different sorts i.e PHP, Wordpress, Laravel, Java supported backends, on the current droplet. But I don’t know exactly how to do it. I have some rough knowledge of Nginx Blocks. However I cannot dare to experiment with it because I’m afraid if something goes wrong my current running website would go down.

I don’t know how to do it? Will it affect my current website? How can I separate my current active website form all other process running in my Droplet?

Any help will be appreciated and also I would love to refer me to some tutorials and references so I can achieve what I want.

Note: I’m running Ubuntu 18.04 on my Droplet.

Thanks

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.

×
Submit an Answer
1 answer

Hello,

As you already have Nginx installed, what you could do is to use separate Nginx Server Blocks for each of your websites.

You can follow the steps here on how to do that:

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

For PHP you could follow the steps here on how to install it on your server, you can skip the Nginx installation step as you already have this installed:

https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04

Hope that this helps.
Regards,
Bobby

by Justin Ellingwood
When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu 16.04 server.