如何用nginx部署python写的socket服务器代码
展开全部
1.安装nginx安装过nginx这就不好从新演示了.默认你也安装好了nginx.
2.安装flup$:dpkg -l *flup*打印信息:Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===========================-===========================-======================================================================
ii python-flup 0.2126-1 Implements Python Web Server Gateway Interface (WSGI)
$:apt-get install python-flup
3:配置nginx.conf.这个是按照网上配置的.
server {listen 1235;
server_name localhost;
#charset koi8-r;
#access_log /dev/null;
access_log /usr/local/nginx/logs/access.log;
location / {
#location /htm {
# root /home/utest/ms;#}root /home/utest/ms;
fastcgi_pass 127.0.0.1:1234;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param CONTENT_LENGTH $content_length;
include fastcgi_params;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;}}解释:端口:1235--为监听端口.端口:1234----为web服务器运行的端口.
from=olddocs
2.安装flup$:dpkg -l *flup*打印信息:Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===========================-===========================-======================================================================
ii python-flup 0.2126-1 Implements Python Web Server Gateway Interface (WSGI)
$:apt-get install python-flup
3:配置nginx.conf.这个是按照网上配置的.
server {listen 1235;
server_name localhost;
#charset koi8-r;
#access_log /dev/null;
access_log /usr/local/nginx/logs/access.log;
location / {
#location /htm {
# root /home/utest/ms;#}root /home/utest/ms;
fastcgi_pass 127.0.0.1:1234;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param CONTENT_LENGTH $content_length;
include fastcgi_params;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;}}解释:端口:1235--为监听端口.端口:1234----为web服务器运行的端口.
from=olddocs
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询