日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

uWSGI安装配置

發(fā)布時間:2023/12/10 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 uWSGI安装配置 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
uWSGI安裝配置
官方網(wǎng)站: http://uwsgi-docs.readthedocs.io

環(huán)境: CentOS 7.2 python-2.7.5

一.安裝 yum -y install gcc gcc-c++ python-devel curl -sSL?https://projects.unbit.it/downloads/uwsgi-2.0.14.tar.gz?|tar -xvf - --gzip cd uwsgi-2.0.14 make -j4

################# uWSGI configuration #################
pcre = True kernel = Linux malloc = libc execinfo = False ifaddrs = True ssl = True zlib = True locking = pthread_mutex plugin_dir = . timer = timerfd yaml = embedded json = False filemonitor = inotify routing = True debug = False ucontext = True capabilities = False xml = libxml2 event = epoll
############## end of uWSGI configuration ############# total build time: 0 seconds *** uWSGI is ready, launch it with ./uwsgi ***
編譯完會生成二進制文件uwsgi,將其copy到PATH路徑下即可,這里放到/usr/bin下

二.創(chuàng)建配置文件 http://uwsgi-docs.readthedocs.io/en/latest/Configuration.html 以ini格式為例 mkdir -p /etc/uwsgi/valsals cat >?/etc/uwsgi/emperor.ini<<EOF

[uwsgi]

emperor = /etc/uwsgi/vassals

ini= :app1


[app1]

socket = :9090

socket = /dev/shm/uwsgi.sock

processes = 10

?

master = true

EOF

三.配置systemd管控 http://uwsgi-docs.readthedocs.io/en/latest/Systemd.html http://uwsgi-docs.readthedocs.io/en/latest/Emperor.html

cat >/lib/systemd/system/emperor.uwsgi.service <<EOF

[Unit]

Description=uWSGI Emperor

After=syslog.target


[Service]

ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi/emperor.ini

# Requires systemd version 211 or newer

RuntimeDirectory=uwsgi

Restart=always

KillSignal=SIGQUIT

Type=notify

StandardError=syslog

NotifyAccess=all


[Install]

WantedBy=multi-user.target

EOF

四.啟動uwsgi

root@router:~#netstat -tunlp|grep :9090

tcp? ? ? ? 0? ? ? 0 0.0.0.0:9090? ? ? ? ? ? 0.0.0.0:* ? ? ? ? ? ? ? LISTEN? ? ? 31117/uwsgi? ? ? ? ?

root@router:~#ll /dev/shm/uwsgi.sock?

srwxr-xr-x. 1 root root 0 10月? 9 05:16 /dev/shm/uwsgi.sock=

轉(zhuǎn)載于:https://www.cnblogs.com/lixuebin/p/10814015.html

總結(jié)

以上是生活随笔為你收集整理的uWSGI安装配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。