found; Falling back on auto-configurationcreating temp directory/tmp/pv_day.root.20161228.022837.113256Running Step 1 of 1 ... Streaming final output from/tmp/pv_day.root.20161228.022837.113256/output ... "2016-12-27" 47783 "2016-12-26 " 299427Removing temp directory/tmp/pv_day.root.20161228.022837.113256 ...Standard input stdin mode, this way only accepts the first file # Python3 pv_day.py No configs found; Falling back on Auto-configurationcreating temp directory /tmp/pv_ Day.roo
:#Python3 top_10_spider.py access_all.log-20161227No Configs found; Falling back on auto-configurationcreating Temp directory/tmp/top_10_spider.root.20161228.091326.295972Running Step1 of 2... Running Step2 of 2... Streaming final output from/tmp/top_10_spider.root.20161228.091326.295972/output ...33542"Magpie-crawler"25880" Other"16578"Sogou web Spider"6383"Bingbot"3688"Baiduspider"1487"Yahoo! slurp"1096"Jikespider"731"Yisouspider"648"Baiduspider-image"470"Googlebot"Removing temp directory/tmp/
This article describes how to use Nginx + uWsgi to implement the deployment instance of the Django framework site static and dynamic separation of Python, that is, static processing by Nginx and Python page processing by Django's built-in HTTP server, for more information, see:
Django is not very friendly in processin
Because:
Django processing static files is not very friendly;Requests for PHP or other resources may need to be processed in the future;
So consider the combination of Nginx, using NIGNX to do its good route distribution function, while doing static and dynamic separation, that is, the HTTP request is uniformly distributed by Nginx, static files are processed by Nginx
Environment:
CentOS X64 6.4
Nginx 1.5.6
Python 2.7.5
One: the class library and Python2.7.5 that need to install
Install the necessary development packs
Yum Groupinstall "Development Tools"
Yum install zlib-devel bzip2-devel pcre-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
CentOS with Python2.6.6, but we can install Python2.7.5 again:
CD ~
wget http://python.org/ftp/
, a permissions issue. Nginx is the way to install the sudo, start the appropriate is also the root user, then we also need to start supervisor with the root user. To add a configuration file under supervisor.conf:[program:nginx]command=/usr/sbin/nginx startsecs=0 stopwaitsecs=0 autostart=false autorestart=false stdout_logfile=/home/wang/supervisor/log/nginx
project named mysite:
cd /home/user/wwwdjango-admin.py startproject mysite
Now, the/home/user/www directory should have a sub-folder named mysite. we need to drop a wsgi configuration file to/home/user/www/mysite, the configuration file is named wsgi. py, the content is as follows:
Next, modify the uwsgi configuration file. run the following command to create a configuration file according to the preceding settings:
Cat>/etc/uwsgi/apps-enabled/www. ini
Pay attention to the socket configura
For Python-based Web projects, common deployment methods are:
FCGI: Generate a listener process for each project, and then interact with the HTTP service, using a spawn-fcgi or framework-led tool.
WSGI: Use the HTTP Service's MOD_WSGI module to run each project.
But there is a uwsgi, which neither WSGI nor fcgi agreements, but has created a UWSGI agreement, which the authors say is about 10 times times as fast as the FCGI protocol. The
Python writes a squid to access the log analysis applet, pythonsquid
In the past two weeks, several people in the group want to learn python, so we have created such an environment and atmosphere for everyone to learn.
Yesterday, I posted a requirement in the group to count and sort the number of ip segments and the number of URLs in the squid access
Using Python scripts to deploy MoinMoin on Nginx and uwsgi, uwsgimoinmoin
MoinMoin is deployed using apache + mod_wsgi in CentOS, but the editing and saving pages are slow. Therefore, you are ready to redeploy the MoinMoin using nginx + uwsgi.
This document assumes that Quick MoinMoin on CentOS has completed basic installation beyond apache and mod_wsgi following
This article describes how to deploy MoinMoin on Nginx and uwsgi using Python scripts. The example is based on the CentOS operating system, for more information about how to use apache + mod_wsgi to deploy MoinMoin in CentOS, but it is slow to edit and save the page.
This document assumes that Quick MoinMoin on CentOS has completed basic installation beyond apache and mod_wsgi following official instructio
MoinMoin was deployed under CentOS using APACHE+MOD_WSGI, but editing and saving the page was slow, and was ready to be redeployed using NGINX+UWSGI
This article assumes that the basic installation of Apache and Mod_wsgi has been completed in accordance with the official guidelines for Quick MoinMoin on CentOSInstalling Nginx
By default, there is no nginx source
Recently tried to migrate the project to the Python environment, especially a clean Debian system, ready to reconfigure the environment, the Internet to find some running the Python Web Environment solution, finalized NGINX+UWSGI combination, Nginx used more, skilled Uwsgi is said to have a good performance and would l
; # ssl_certificate Cert.pem; # Ssl_certificate_key Cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers high:!anull:! MD5; # ssl_prefer_server_ciphers on; # location/{# root HTML; # index index.html index.htm; # } #} }
It is important to note that directories that do not require URL rewrite, such as directories for CSS and images, need to be indicated in the configuration file, otherwise they will not be accessible
Location ~ ^/static/{
.--------------------------------------------------------------------------------UWSGI ConfigurationUwsgi support INI, XML and other configuration methods, in this paper, INI as an example, in the/ect/directory under the new Uwsgi9090.ini, add the following configuration:[Uwsgi]Socket = 127.0.0.1:9090Master = TRUE//Master processVhost = TRUE//multi-station modeNo-site = TRUE//multi-station mode when no ingress modules and files are setWorkers = 2//number of child processesReload-mercy = 10Vacuum
:
?
1 2
CD C:nginx start Nginx
Then in the browser to visit the http://loaclhost/should be able to see the Nginx welcome interface. Finally go to the root of your Django project, and then use the command to run the server:
?
1
Python manage.py runfcgi method=threaded host=127.0.0.1 port=8051
Refresh localhos
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.