Articles of mod wsgi

Django网站性能问题

我的mod_wsgi / django应用程序有或没有memcached内存中caching2秒的响应时间。 响应是相同的2s有或没有DNSparsing(即直接的IP请求) 为了进行比较,一个运行在APC上的mediawiki php程序运行的是一个类似于sub-second的响应。 机器没有内存不足,我可以告诉memcached占用了一些空间。 我已经看到相同的Django应用程序运行在另一台机器(其中我不幸的是知道一些细节,但它似乎在webfactional上运行)两倍更快我的机器是专用主机。 这里是我的apache指令来运行应用程序 <VirtualHost …:80> ServerAdmin … DocumentRoot … ServerName .. WSGIScriptAlias / /../wsgi-script.wsgi CustomLog … common ErrorLog /…/error_log DirectoryIndex index.html </VirtualHost> 编辑确定发现问题的来源 – wsgi 服务的静态文件 ,这是什么耗尽的performance。 静态内容的一些别名types指令修复了这个问题。

Mod_wsgi守护进程的进程状态

有没有办法获得mod_wsgi守护进程和线程的状态? 就像apache的服务器状态页面。 我的服务器需要一些时间来回应,我想看看是否因为所有的守护进程线程都很忙。

Apache mod_wsgi安装错误

我正在运行CentOS 6.7,我正在尝试安装mod_wsgi( https://code.google.com/p/modwsgi/ ) 通常我会这样做: yum安装mod_wsgi 但是因为我需要确保它在Python 2.7下编译(而不是CentOS默认的Python 2.6版本),所以我决定下载repo( https://github.com/GrahamDumpleton/mod_wsgi/releases )并确保它已经configuration我的场景。 为了安装,我遵循了办公指南: https : //code.google.com/p/modwsgi/wiki/QuickInstallationGuide 唯一的区别是我改变了Python版本: ./configure –with-python=/usr/local/bin/python2.7 以上回报: checking for apxs2… no checking for apxs… no checking for gcc… gcc checking whether the C compiler works… yes checking for C compiler default output file name… a.out checking for suffix of executables… checking whether we […]

使用Django应用程序在Apache / mod_wsgi下运行时的file upload问题

我有一个使用mod_wsgi在Apache2(linux)下运行的Django应用程序,并且在守护进程模式下运行时file upload失败,但在embeddedpython解释器时工作。 任何想法是什么可能造成这一点,我怎么解决它? 以下Apacheconfiguration正在运行: <VirtualHost *:80> ServerName mysite.com DocumentRoot /var/www/ Alias /media/ /var/www/media/ <Directory /var/www/> Options -Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all Include /etc/apache2/yslow_optimizations.conf </Directory> WSGIScriptAlias / /var/djangoapp/apache/django.wsgi <Directory /var/djangoapp/apache/> Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/mysite.error.log CustomLog /var/log/apache2/mysite.access.log combined </VirtualHost> 但是,当我添加以下指令来守护进程wsgi时,file upload立即失败。 WSGIDaemonProcess mygroup display-name=%{GROUP} inactivity-timeout=600 WSGIProcessGroup mygroup Apache错误日志中没有任何内容。 […]

目录,代理和位置 – 如何在一个Apacheconfiguration中共存?

主要是通过试验和错误,我已经创build了下面的Apacheconfiguration文件。 它旨在允许通过WSGI的localhost:8002上的服务器和trac服务器共享LDAP服务器,并且看起来在同一个域/端口上。 规则是孤立的,但并不平行。 特别是,如果ProxyPass / ProxyPassReverse行被注释掉,trac WSGI将只能正确服务。 如果没有这个redirect,localhost:8002上的服务器显然没有映射到出站8022端口。 我假设目录,代理和位置规则的组合是我的问题的路线 – 或者也许是他们的顺序? WSGIDaemonProcess trac stack-size=524288 python-path=/usr/lib/python2.5/site-packages WSGIScriptAlias /trac /home/web/foo/parts/trac/tracwsgi/cgi-bin/trac.wsgi <VirtualHost foo.bar.com:8022> ServerName foo.bar.com ServerAlias foo.bar.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost On ProxyPass / http://localhost:8002/VirtualHostBase/http/foo.bar.com:8022/foo/VirtualHostRoot/ ProxyPassReverse / http://localhost:8002/VirtualHostBase/http/foo.bar.com:8022/foo/VirtualHostRoot/ <Directory "/home/web/foo/parts/trac/tracwsgi/cgi-bin"> WSGIApplicationGroup %{GLOBAL} Options +Indexes FollowSymLinks AllowOverride None Allow from all Order […]

如何让Apache在RHEL6中使用MOD_WSGI或MOD_PYTHON运行python脚本?

我试图让Apache来运行Python脚本。 我在RHEL6上安装了MOD_WSGI,Apache,Python。 我甚至编辑了httpd.conf文件来包含这些行。 <Directory /var/www/> Options Indexes FollowSymLinks MultiViews ExecCGI AddHandler cgi-script .cgi AddHandler wsgi-script .wsgi AllowOverride None Order allow,deny allow from all </Directory> 我也重新启动了Apache服务器。 但是当我尝试执行python脚本,它只是在浏览器中打印为纯文本。 它根本没有被执行。 请有人帮忙

Debian Lenny,Python 2.7和mod_wsgi

我正在运行Python 2.5.2附带的Debian Lenny框。 我只想为我的WSGI应用程序运行Python 2.7,保持2.5作为系统的默认值,但是我无法使其工作。 首先,我将Python 2.7.2从源代码安装到/usr/local : Python-2.7.2 # ./configure –enable-shared […] Python-2.7.2 # make […] Python-2.7.2 # make altinstall […] 现在从命令行调用python2.7没有任何问题。 它还可以在/usr/local/lib/python2.7/packagesfind通过pip安装的软件包。 接下来,我构build了mod_wsgi并将其手动复制到Apache模块目录,以便不触及apt-get放置的文件。 mod_wsgi-3.3 # ./configure –with-python=/usr/local/bin/python2.7 […] mod_wsgi-3.3 # make […] mod_wsgi-3.3 # cp .libs/mod_wsgi.so /usr/lib/apache2/modules/mod_wsgi.so-2.7 mod_wsgi-3.3 # cd /usr/lib/apache2/modules modules # ln -sf mod_wsgi.so-2.7 mod_wsgi.so modules # ldd mod_wsgi.so-2.7 linux-vdso.so.1 => […]

Apache2 mod_wsgi django命名虚拟服务器

我试图在Apache上使用mod_wsgi设置两个独立的Django站点。 第一个网站工作正常,但第二个网站cupaday.dyndns.biz给出了一个403: [Tue Feb 07 22:32:57 2012] [error] [client 68.48.6.208] (13)Permission denied: access to / denied有人看到有什么错? 我读了关于部署多个虚拟服务器,大多数人指出,确保有一个允许所有人的目录指令。 我试图设置这个path到我的应用程序,到wsgi目录和实际的。 就像我说的第一个网站snaganitem工作正常。 有谁知道我可以解决这个问题? 或者有没有办法看到403 errror的详细版本? 谢谢。 NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin [email protected] ServerName snaganitem.com ServerAlias www.snaganitem.com LogLevel warn ErrorLog /var/log/httpd/error.log CustomLog /var/log/httpd/access.log combined WSGIScriptAlias / /home/snaganitem/hackpages/apache2/django.wsgi <Location "/static"> SetHandler None </Location> <Directory /home/snaganitem/hackpages/apache2> Order allow,deny Allow from all […]

Apache2 mod_wsgi python 2.6 Django很慢

我已经尝试了大约1000倍的东西,但我似乎无法弄清楚为什么一个简单的Django网站使用apache 2.2.14 / wsgi latest / django 1.3很慢。 我已经证实了这个问题不是我们的数据库通过打开mysql慢查询日志logging。 我已经回顾了另一个100倍的wsgi守护进程configuration设置,但仍然不明白为什么runserver目前比apache更快! 这里是我的Apacheconfiguration,让我知道如果有其他项目将是有用的! WSGIDaemonProcess xxx display-name=xxx group=www-data user=www-data processes=25 threads=1 <VirtualHost *:80> ServerName www.xxx.com ServerAlias xxx.com ServerAlias localhost ServerAdmin [email protected] RewriteEngine Off RewriteCond %{HTTP_HOST} ^xxx\.com$ [NC] RewriteRule ^(.*)$ http://www.xxx.com$1 [R=301,L] RewriteCond %{REQUEST_URI} ^/login/$ RewriteRule /login https://%{HTTP_HOST}%{REQUEST_URI} [R,L] RewriteCond %{REQUEST_URI} ^/signup/ RewriteRule /signup https://%{HTTP_HOST}%{REQUEST_URI} [R,L] ErrorLog /var/log/apache2/xxx-error.log LogLevel […]

在ubuntu上用python 2.7安装mod_wsgi

我尝试使用包pipe理器在我的ubuntu服务器上安装mod_wsgi,但是注意到它取决于python 2.6。 我使用Python 2.7,宁愿避免安装2.6 … 是否mod_wsgi真的依赖于python 2.6,即使我打算只运行python 2.7? 如果没有,有没有办法只安装python 2.7安装mod_wsgi?