B
B
blazer052018-07-03 13:49:59
Django
blazer05, 2018-07-03 13:49:59

How to host two websites on the same hosting?

Can you tell me how to run two python/django sites on the same machine? It costs Xubunty16 which already has python 2.7.9 and python 3.5.
I raised site1.ru under the second python and when the machine is rebooted, it starts automatically, everything is configured according to the instructions. Used Nginx + Uwsgi
Now I'm trying to raise site2.ru on the same machine but already under the third python, but I get an error like uwsgi is already running under the second python by default. I rolled uwsgi into the virtual environment of the site2.ru site, I run uwsgi manually - yes, it only works until it is running, if you restart the machine, the whole site does not start, but this is understandable.
How to make friends with one globally installed Uwsgi and several sites under different versions of python?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2018-07-07
@sim3x

apt-get install uwsgi uwsgi-plugin-python3
................
Setting up uwsgi (2.0.12-5ubuntu3.1) ...
Setting up uwsgi-plugin-python3 (2.0.12-5ubuntu3.1) ...
/var/lib/dpkg/info/uwsgi-plugin-python3.postinst: 61: [: Illegal number: 
..................
The maintainer screwed up when building the package
Fixed by manually rebuilding the package
Install from pip and do a systemd task
In the standard procedure for updating packages via apt-get, add the uwsgi update in all virtual environments!

B
blazer05, 2018-07-10
@blazer05

In general, I won this problem! Now I have two sites running on the same virtual machine, one under the second python and the other under the third python!
In general, this is the solution. In nano /etc/rc.local I changed the emperor startup line, it was /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data --master
became
/usr /bin/uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data --master
Next, in the script for launching the first site on the second python, I went under the created user django and added the path to the plugin of the second python plugin = python
Next, in the script for launching the second site on the third python, I went under the shop created by the user and added the path to the plugin of the third python plugins = python3
In a separate console window, I launched the emperor
/usr/bin/uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data --master
In /tmp/ the sockets of the two sites went up and the site started working. Then I rebooted the virtual machine 5 times, the sites were raised automatically!
sim3x thanks for the help!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question