[uwsgi]
# master
master = true
# maximum number of processes
processes = 10
# the socket (use the full path to be safe)
socket = /tmp/myshop3.sock
# with appropriate permissions - *may* be needed
chmod-socket = 666
# the base directory
chdir = /home/shop/myshop3
# Django's wsgi file
module = myshop3.wsgi
# the virtualenv
home = /home/shop/venv
# clear environment on exit
vacuum = true
# reload uwsgi
touch-reload = /home/shop/myshop3/myshop3/settings.py
touch-reload = /home/shop/myshop3/myshop3/urls.py
shop@blazer-pc:/home$ uwsgi --plugin python35 -s :0
open("./python35_plugin.so"): No such file or directory [core/utils.c line 3713]
!!! UNABLE to load uWSGI plugin: ./python35_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.17 (64bit) on [Wed Jul 4 10:28:42 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :43213 (port auto-assigned) fd 3
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x26664b0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72904 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 2545, cores: 1)
blazer@blazer-pc:~$ su shop
Пароль:
shop@blazer-pc:/home/blazer$ cd ..
shop@blazer-pc:/home$ uwsgi --ini /home/shop/myshop3/myshop3/myshop3.ini
[uWSGI] getting INI configuration from /home/shop/myshop3/myshop3/myshop3.ini
open("./python35_plugin.so"): No such file or directory [core/utils.c line 3713]
!!! UNABLE to load uWSGI plugin: ./python35_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.17 (64bit) on [Wed Jul 4 13:56:12 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/shop/myshop3
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/myshop3.sock fd 3
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
Set PythonHome to /home/shop/venv
ImportError: No module named site
VACUUM: unix socket /tmp/myshop3.sock removed.
shop@blazer-pc:/home$
shop@blazer-pc:/home$ uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data --master
*** Starting uWSGI 2.0.17 (64bit) on [Wed Jul 4 13:58:30 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
*** starting uWSGI Emperor ***
*** has_emperor mode detected (fd: 7) ***
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from myshop3.ini
open("./python35_plugin.so"): No such file or directory [core/utils.c line 3713]
!!! UNABLE to load uWSGI plugin: ./python35_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.17 (64bit) on [Wed Jul 4 13:58:30 2018] ***
[uWSGI] getting INI configuration from uwsgi.ini
*** Starting uWSGI 2.0.17 (64bit) on [Wed Jul 4 13:58:30 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /etc/uwsgi/vassals
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/shop/myshop3
your processes number limit is 15552
your memory page size is 4096 bytes
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /etc/uwsgi/vassals
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/django/pro/sharelink
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/myshop3.sock fd 3
thunder lock: disabled (you can enable it with --thunder-lock)
error removing unix socket, unlink(): Operation not permitted [core/socket.c line 198]
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
Set PythonHome to /home/shop/venv
ImportErrorbind(): Address already in use [core/socket.c line 230]
Wed Jul 4 13:58:30 2018 - [emperor] curse the uwsgi instance uwsgi.ini (pid: 2119)
: No module named site
VACUUM: unix socket /tmp/myshop3.sock removed.
Wed Jul 4 13:58:30 2018 - [emperor] curse the uwsgi instance myshop3.ini (pid: 2120)
Wed Jul 4 13:58:30 2018 - [emperor] removed uwsgi instance uwsgi.ini
shop@blazer-pc:~/myshop3/myshop3$ source ~/venv/bin/activate
(venv) shop@blazer-pc:~/myshop3/myshop3$ uwsgi --ini /home/shop/myshop3/myshop3/myshop3.ini
[uWSGI] getting INI configuration from /home/shop/myshop3/myshop3/myshop3.ini
*** Starting uWSGI 2.0.17 (64bit) on [Wed Jul 4 14:23:14 2018] ***
compiled with version: 5.4.0 20160609 on 03 July 2018 09:48:24
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/shop/myshop3/myshop3
detected binary path: /home/shop/venv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/shop/myshop3
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/myshop3.sock fd 3
Python version: 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]
Set PythonHome to /home/shop/venv
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1fd0f50
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 801944 bytes (783 KB) for 10 cores
*** Operational MODE: preforking ***
WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x1fd0f50 pid: 2773 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 2773)
spawned uWSGI worker 1 (pid: 2775, cores: 1)
spawned uWSGI worker 2 (pid: 2776, cores: 1)
spawned uWSGI worker 3 (pid: 2777, cores: 1)
spawned uWSGI worker 4 (pid: 2778, cores: 1)
spawned uWSGI worker 5 (pid: 2779, cores: 1)
spawned uWSGI worker 6 (pid: 2780, cores: 1)
spawned uWSGI worker 7 (pid: 2781, cores: 1)
spawned uWSGI worker 8 (pid: 2782, cores: 1)
spawned uWSGI worker 9 (pid: 2783, cores: 1)
spawned uWSGI worker 10 (pid: 2784, cores: 1)
[pid: 2777|app: 0|req: 1/1] 192.168.1.1 () {46 vars in 849 bytes} [Wed Jul 4 11:23:23 2018] GET / => generated 16348 bytes in 41 msecs (HTTP/1.1 200) 3 headers in 96 bytes (1 switches on core 0)
ImportError: No module named site
ImportErrorbind(): Address already in use [core/socket.c line 230]
сокет занят*** Starting uWSGI 2.0.17 (64bit) on [Sat Jul 7 13:17:53 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/shop/myshop3
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/myshop3.sock fd 3
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
Set PythonHome to /home/shop/venv
ImportError: No module named site
shop@blazer-pc:~/myshop3/myshop3$ uwsgi --ini myshop3.ini
[uWSGI] getting INI configuration from myshop3.ini
open("./python35_plugin.so"): No such file or directory [core/utils.c line 3713]
!!! UNABLE to load uWSGI plugin: ./python35_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.17 (64bit) on [Sat Jul 7 15:26:36 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/shop/myshop3/myshop3
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/shop/myshop3
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/myshop3.sock fd 3
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
Set PythonHome to /home/shop/venv
ImportError: No module named site
VACUUM: unix socket /tmp/myshop3.sock removed.
shop@blazer-pc:~/myshop3/myshop3$
[uwsgi]
plugin=python3
# master
master = true
# maximum number of processes
processes = 10
# the socket (use the full path to be safe)
socket = /tmp/myshop3.sock
# with appropriate permissions - *may* be needed
chmod-socket = 666
# the base directory
chdir = /home/shop/myshop3
# Django's wsgi file
module = myshop3.wsgi
# the virtualenv
home = /home/shop/venv
2018/07/07 15:47:37 [crit] 985#985: *12 connect() to unix:///tmp/myshop3.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.1, server: myshop3.sharelink.ru, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/myshop3.sock:", host: "myshop3.sharelink.ru:8080"
shop@blazer-pc:/home$ uwsgi --plugin python3 -s :0
open("./python3_plugin.so"): No such file or directory [core/utils.c line 3713]
!!! UNABLE to load uWSGI plugin: ./python3_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.17 (64bit) on [Sat Jul 7 15:58:52 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :36801 (port auto-assigned) fd 3
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x22ba4b0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72904 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 2444, cores: 1)
shop@blazer-pc:~/myshop3/myshop3$ uwsgi --plugins-dir /usr/lib/uwsgi/plugins/ --plugin python3 -s :0
open("./python3_plugin.so"): No such file or directory [core/utils.c line 3713]
!!! UNABLE to load uWSGI plugin: ./python3_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.17 (64bit) on [Sat Jul 7 16:32:00 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/shop/myshop3/myshop3
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :39515 (port auto-assigned) fd 3
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0xe57530
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72904 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 2732, cores: 1)
shop@blazer-pc:/usr/lib/uwsgi/plugins$ uwsgi --plugin python3 -s :0
!!! UNABLE to load uWSGI plugin: ./python3_plugin.so: undefined symbol: uwsgi_legion_scrolls !!!
*** Starting uWSGI 2.0.17 (64bit) on [Sat Jul 7 16:39:48 2018] ***
compiled with version: 5.4.0 20160609 on 21 June 2018 06:45:04
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /usr/lib/uwsgi/plugins
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :37175 (port auto-assigned) fd 3
Python version: 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0xdc3460
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72904 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 2859, cores: 1)
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:
..................
мейнтейнер накосячил при сборке пакета(venv) shop@blazer-pc:/home$ uwsgi --ini /home/shop/myshop3/myshop3/myshop3.ini
[uWSGI] getting INI configuration from /home/shop/myshop3/myshop3/myshop3.ini
*** Starting uWSGI 2.0.17 (64bit) on [Sat Jul 7 19:26:50 2018] ***
compiled with version: 5.4.0 20160609 on 03 July 2018 09:48:24
os: Linux-4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018
nodename: blazer-pc
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home
detected binary path: /home/shop/venv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/shop/myshop3
your processes number limit is 15552
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/myshop3.sock fd 3
Python version: 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]
Set PythonHome to /home/shop/venv
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1c76fe0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 801944 bytes (783 KB) for 10 cores
*** Operational MODE: preforking ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1c76fe0 pid: 2299 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 2299)
spawned uWSGI worker 1 (pid: 2301, cores: 1)
spawned uWSGI worker 2 (pid: 2302, cores: 1)
spawned uWSGI worker 3 (pid: 2303, cores: 1)
spawned uWSGI worker 4 (pid: 2304, cores: 1)
spawned uWSGI worker 5 (pid: 2305, cores: 1)
spawned uWSGI worker 6 (pid: 2306, cores: 1)
spawned uWSGI worker 7 (pid: 2307, cores: 1)
spawned uWSGI worker 8 (pid: 2308, cores: 1)
spawned uWSGI worker 9 (pid: 2309, cores: 1)
spawned uWSGI worker 10 (pid: 2310, cores: 1)
[pid: 2305|app: 0|req: 1/1] 192.168.1.1 () {46 vars in 926 bytes} [Sat Jul 7 16:26:57 2018] GET / => generated 16348 bytes in 11 msecs (HTTP/1.1 200) 3 headers in 96 bytes (1 switches on core 0)
не совсем я понял что вы посоветовали. Вот в ручном режиме при активированном виртуальном окружении я запускаю этой командой uwsgi --ini /home/shop/myshop3/myshop3/myshop3.ini и все работает.
Ставим из pip
Можно это как то автоматизировать, чтоб при перезагрузке машины сайт сам поднимался?==
делаем systemd таск
Нет возможности одновременно запустить на одной машине проекты под вторым и третьем питоне.