nginx启动了,uwsgi也启动了,确访问不了。不知道为什么

来源:16-2 nginx + uwsgi 实现多进程访问

丛从绿草

2021-05-20

以下是nginx日志:
(python_mall) [root@VM-8-15-centos python-ordering-small-program]# journalctl -xe
May 20 11:56:29 VM-8-15-centos systemd[1]: Failed to parse PID from file /run/nginx.pid: Invalid argument
May 20 11:56:29 VM-8-15-centos sudo[31406]: pam_unix(sudo:session): session closed for user root
May 20 11:56:29 VM-8-15-centos systemd[1]: Started The nginx HTTP and reverse proxy server.
– Subject: Unit nginx.service has finished start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has finished starting up.

– The start-up result is done.
May 20 11:56:29 VM-8-15-centos polkitd[557]: Unregistered Authentication Agent for unix-process:31407:18135857 (system bus name :1.7615, object path /org/freedesktop/PolicyKit1/Authenticati
May 20 11:56:30 VM-8-15-centos sshd[31397]: Invalid user wangyan from 159.89.112.44 port 55974
May 20 11:56:30 VM-8-15-centos sshd[31397]: input_userauth_request: invalid user wangyan [preauth]
May 20 11:56:30 VM-8-15-centos sshd[31397]: pam_unix(sshd:auth): check pass; user unknown
May 20 11:56:30 VM-8-15-centos sshd[31397]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=159.89.112.44
May 20 11:56:32 VM-8-15-centos sshd[31397]: Failed password for invalid user wangyan from 159.89.112.44 port 55974 ssh2
May 20 11:56:32 VM-8-15-centos sshd[31397]: Received disconnect from 159.89.112.44 port 55974:11: Bye Bye [preauth]
May 20 11:56:32 VM-8-15-centos sshd[31397]: Disconnected from 159.89.112.44 port 55974 [preauth]
May 20 11:56:32 VM-8-15-centos sshd[31444]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=103.218.243.159 user=root
May 20 11:56:32 VM-8-15-centos sshd[31444]: pam_succeed_if(sshd:auth): requirement “uid >= 1000” not met by user "root"
May 20 11:56:34 VM-8-15-centos sshd[31444]: Failed password for root from 103.218.243.159 port 39830 ssh2
May 20 11:56:34 VM-8-15-centos sshd[31444]: Received disconnect from 103.218.243.159 port 39830:11: Bye Bye [preauth]
May 20 11:56:34 VM-8-15-centos sshd[31444]: Disconnected from 103.218.243.159 port 39830 [preauth]
May 20 11:57:01 VM-8-15-centos systemd[1]: Started Session 3782 of user root.
– Subject: Unit session-3782.scope has finished start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit session-3782.scope has finished starting up.

– The start-up result is done.
May 20 11:57:01 VM-8-15-centos CROND[31529]: (root) CMD (flock -xn /tmp/stargate.lock -c ‘/usr/local/qcloud/stargate/admin/start.sh > /dev/null 2>&1 &’)
May 20 11:57:26 VM-8-15-centos sshd[31622]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=181.48.60.50 user=root
May 20 11:57:26 VM-8-15-centos sshd[31622]: pam_succeed_if(sshd:auth): requirement “uid >= 1000” not met by user "root"
May 20 11:57:27 VM-8-15-centos sshd[31624]: Invalid user wuc from 200.44.50.155 port 52590
May 20 11:57:27 VM-8-15-centos sshd[31624]: input_userauth_request: invalid user wuc [preauth]
May 20 11:57:27 VM-8-15-centos sshd[31624]: pam_unix(sshd:auth): check pass; user unknown
May 20 11:57:27 VM-8-15-centos sshd[31624]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=200.44.50.155
May 20 11:57:28 VM-8-15-centos sshd[31622]: Failed password for root from 181.48.60.50 port 51210 ssh2
May 20 11:57:29 VM-8-15-centos sshd[31622]: Received disconnect from 181.48.60.50 port 51210:11: Bye Bye [preauth]
May 20 11:57:29 VM-8-15-centos sshd[31622]: Disconnected from 181.48.60.50 port 51210 [preauth]
May 20 11:57:29 VM-8-15-centos sshd[31624]: Failed password for invalid user wuc from 200.44.50.155 port 52590 ssh2
May 20 11:57:29 VM-8-15-centos sshd[31624]: Received disconnect from 200.44.50.155 port 52590:11: Bye Bye [preauth]
May 20 11:57:29 VM-8-15-centos sshd[31624]: Disconnected from 200.44.50.155 port 52590 [preauth]
May 20 11:58:01 VM-8-15-centos systemd[1]: Started Session 3783 of user root.
– Subject: Unit session-3783.scope has finished start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit session-3783.scope has finished starting up.

– The start-up result is done.
May 20 11:58:01 VM-8-15-centos CROND[31722]: (root) CMD (flock -xn /tmp/stargate.lock -c ‘/usr/local/qcloud/stargate/admin/start.sh > /dev/null 2>&1 &’)
May 20 11:58:13 VM-8-15-centos sshd[31779]: Invalid user syamsul from 27.71.238.208 port 55290
May 20 11:58:13 VM-8-15-centos sshd[31779]: input_userauth_request: invalid user syamsul [preauth]
May 20 11:58:13 VM-8-15-centos sshd[31779]: pam_unix(sshd:auth): check pass; user unknown
May 20 11:58:13 VM-8-15-centos sshd[31779]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=27.71.238.208
May 20 11:58:16 VM-8-15-centos sshd[31779]: Failed password for invalid user syamsul from 27.71.238.208 port 55290 ssh2
May 20 11:58:16 VM-8-15-centos sshd[31779]: Received disconnect from 27.71.238.208 port 55290:11: Bye Bye [preauth]
May 20 11:58:16 VM-8-15-centos sshd[31779]: Disconnected from 27.71.238.208 port 55290 [preauth]

这里是uwsgi.ini配置文件
(python_mall) [root@VM-8-15-centos python-ordering-small-program]# vi uwsgi.ini
[uwsgi]
#源码目录
chdir=/home/python-ordering-small-program
#python 虚拟环境
home=/root/.virtualenvs/python_mall
module=manager
callable=app
master=true
processes=4
http=0.0.0.0:11011
socket=/home/python-ordering-small-program/logs/order.sock
buffer-size=65535
pidfile=/home/python-ordering-small-program/logs/order.pid
chmod-socket=777
logfile-chmod=644
daemonize=/home/python-ordering-small-program/logs/order.log
static-map = /static=/home/python-ordering-small-program/web/static

以下是nginx的配置文件
server{
#listen 80 default_server; (这行去掉之后,就可以正常启动,否则启动失败,提示nginx.conf文件中这个位置的错误。)
server_name 81.71.93.230;
location / {
try_files $uri @application;
}

location @application {
include uwsgi_params;
uwsgi_pass unix:/home/python-ordering-small-program/logs/order.sock;
}
}

以下是uwsgi进程
(python_mall) [root@VM-8-15-centos python-ordering-small-program]# ps -ef | grep uwsgi
root 31249 1 0 11:55 ? 00:00:00 uwsgi --ini uwsgi.ini
root 31255 31249 0 11:55 ? 00:00:00 uwsgi --ini uwsgi.ini
root 31256 31249 0 11:55 ? 00:00:00 uwsgi --ini uwsgi.ini
root 31257 31249 0 11:55 ? 00:00:00 uwsgi --ini uwsgi.ini
root 31258 31249 0 11:55 ? 00:00:00 uwsgi --ini uwsgi.ini
root 31259 31249 0 11:55 ? 00:00:00 uwsgi --ini uwsgi.ini
root 31576 686 0 11:57 pts/0 00:00:00 grep --color=auto uwsgi

以下是uwsgi启动项目的日志
(python_mall) [root@VM-8-15-centos logs]# tail -f order.log
— no python application found, check your startup logs for errors —
[pid: 31258|app: -1|req: -1/8] 125.108.224.247 () {36 vars in 562 bytes} [Thu May 20 11:56:37 2021] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
— no python application found, check your startup logs for errors —
[pid: 31257|app: -1|req: -1/9] 125.108.224.247 () {36 vars in 562 bytes} [Thu May 20 11:56:37 2021] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
— no python application found, check your startup logs for errors —
[pid: 31258|app: -1|req: -1/10] 125.108.224.247 () {32 vars in 514 bytes} [Thu May 20 11:56:38 2021] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
— no python application found, check your startup logs for errors —
[pid: 31256|app: -1|req: -1/11] 125.108.224.247 () {34 vars in 524 bytes} [Thu May 20 11:56:39 2021] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
— no python application found, check your startup logs for errors —
[pid: 31255|app: -1|req: -1/12] 125.108.224.247 () {32 vars in 453 bytes} [Thu May 20 11:56:39 2021] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

nginx启动了,uwsgi也启动了, 现在访问81.71.93.230出现闪掉一下,访问失败,不知道是为什么, 希望老师解答一下,真的折磨人了。

写回答

1回答

编程浪子

2021-05-22

你好

可以加我:1586538192 ,我上服务器看看

0
0

Python Flask构建微信小程序订餐系统(可用于毕设)

微信小程序 + Python Flask 打造订餐系统全栈应用,可用于毕设。

1683 学习 · 1883 问题

查看课程