Articles of wsgi

Trac / Apache显示脚本内容(WSGI)

我正在苦苦做一个新的Trac 1.0.3安装(在通过easy_install安装相同的问题之后,从源码安装)。 Debian 7.8 Apache 2.2.22 Python 2.7.3 Genshi 0.6 sqlite 3.7.13 WSGI 3.3 我在/var/trac创build了Trac环境, /var/trac /var/trac/cgi-bin保存了trac.wsgi 。 我已经更新了Apache … LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so和我的网站的conf … WSGIScriptAlias /trac /var/trac/cgi-bin/trac.wsgi <Directory /var/trac/cgi-bin> WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> <Location /trac> Order deny,allow Allow from all </Location> 我的/var/trac/log/trac.log (这是空的)在trac.iniconfiguration… [logging] log_file = /var/trac/log/trac.log log_level = DEBUG log_type […]

WSGI在Centos上安装在哪里?

在守护进程模式下运行django时遇到权限问题。 在这里阅读https://code.google.com/p/modwsgi/wiki/ConfigurationIssues#Location_Of_UNIX_Sockets我认为解决的办法是configurationWSGISocketPrefix 问题是/ var / run / wsgi不能在我的centos服务器上find。 closures的东西,我可以find的是:/etc/httpd/run/httpd.pid 我怎样才能find安装wsgi的地方? 或者我可以设置什么其他值WSGISocketPrefix等于?

将OpenERP 8中的Web层安装为独立的HTTP服务器

在Odoo 6.0中,当下载OpenERP时,分别有openerp web(用于web服务器)和openerp服务器源代码tarball。 从版本6.1开始,他们将其全部集成在一起,OpenERP是一个HTTP Web服务器,也可以通过Gunicorn或Apache mod_wsgi(或其他)部署为兼容WSGI的应用程序。 在OpenERP中还有2层,OpenERP服务器和Web层。 在OpenERP Server Developers Documentation for v7.0中 ,提到了Web层 这是一个WSGI兼容的应用程序。 因此,它可以作为独立的HTTP服务器运行,也可以embedded到OpenERP内部。 有没有人知道可能的方式来安装这2层作为独立的,在2连接的服务器? 我一直在寻找,但我不知道。 这是否意味着我必须手动划分源代码,还是这意味着我需要在另一台机器上安装一个Web服务器并进行configuration,以便可以部署openerp源代码? 非常感谢你。

recv还没有准备好(11:资源暂时不可用))(nginx / 1.1.19,supervisorctl,gunicorn)

我有Ubuntu 12.04.5 LTS,django(supervisorctl,gunicorn)的网站。 它工作1年没有问题,但今天我的zabbix服务器发送有关警报(每3-7分钟)关于超时(1-2秒)的消息。 我为nginx运行debugging模式: 2015/08/26 06:24:09 [debug] 24236#0: *214786 http upstream temp fd: -1 2015/08/26 06:24:09 [debug] 24236#0: *214786 http output filter "/management/verify/[email protected]&app_version=4.1&warehouse=131&only_hash=0&pin_number=" 2015/08/26 06:24:09 [debug] 24236#0: *214786 http copy filter: "/management/verify/[email protected]&app_version=4.1&warehouse=131&only_hash=0&pin_number=" 2015/08/26 06:24:09 [debug] 24236#0: *214786 image filter 2015/08/26 06:24:09 [debug] 24236#0: *214786 xslt filter body 2015/08/26 06:24:09 [debug] 24236#0: *214786 http postpone […]

wsgi脚本的环境被隔离在httpd,CentOS 7上

我正在使用mod_wsgi在CentOS 7上托pipe一个简单的wsgi应用程序 ,并尝试删除下面所示的隔离。 wsgi应用程序, 以下脚本是我的wsgi应用程序。 它会创build一个名为/tmp/test-wsgi.txt的文件 枚举/tmp的内容作为一个简单的json列表 码: def application(environ, start_response): status = '200 OK' headers = [('Content-Type', 'application/json')] start_response(status, headers) with open('/tmp/test-wsgi.txt', 'w+') as w: w.write('hello world') files = os.listdir('/tmp') return json.dumps(files) 当我访问我的Web应用程序时,我收到以下回复 ["test-wsgi.txt"] 太好了! 然而, 以root身份连接到相同的主机服务器, 我打开了一个shell并执行cat /tmp/test-wsgi.txt 从玩弄它,似乎在我的wsgi脚本内的任何文件系统操作(枚举/创build/套接字访问)是“环境隔离” (如chroot监狱)。 奇怪的是我没有configuration任何types的隔离。 httpdconfiguration /etc/httpd/conf.d/my-app.conf <VirtualHost *:80> DocumentRoot /opt/my-app/ WSGIScriptAlias / /opt/my-app/apache/wsgi.py <Directory /opt/my-app/apache> Order […]

哪个是最好的方式来使用不同的python版本使用apache2多个wsgi应用程序?

现在我已经使用apache2和mod-wsgi在我的服务器上部署了一个python2 django应用程序。 现在我想部署另一个,但是这是用python3编写的。 我的问题是,mod-wsgi被编译为python2。 我有什么替代scheme来部署? 我可以使用mod-uwsgi for python3进行另一个部署。 PD:我也在使用virtualenvs。 谢谢!

如何configurationPython的Apache WSGI只提供不存在的文件?

我想在网站的根目录(/)上设置带有WSGI和Apache的Django,但是我希望通过WSGI(和Django)只将那些没有相应文件的URL直接提供给Apache服务器。 对于PHP我会做这样的事情: RewriteCond %{REQUEST_FILENAME} !-f 然后重写一些index.php什么的。 但如何与WSGI做到这一点?

如何将URL前缀(/维基)添加到在uWSGI和nginx上运行的MoinMoin?

我只是设置uWSGI和nginx(与uWSGI模块),并希望得到MoinMoin设置。 我使用下面的命令与MoinMoin一起运行uWSGI: /usr/bin/uwsgi -s moin.sock –wsgi-file wiki/server/moin.wsgi -M -p 4 在nginx中,我把它设置成这样: location / { uwsgi_pass unix:///mnt/moin/moin.sock; include uwsgi_params; } 如果我想让MoinMoin在我的服务器的根目录下运行,这可以正常工作,但是我希望我的MoinMoin在/ wiki上运行而不是/ 。 我改变了我的nginxconfiguration来反映这一点: location /wiki { uwsgi_pass unix:///mnt/moin/moin.sock; include uwsgi_params; } 重新启动这两个服务器后,MoinMoin中的链接仍然希望转到/ PageName而不是/ wiki / PageName 。 我想我将不得不在MoinMoin中指定一个设置。 我看到wikiconfig.py有一个url_prefix_static选项,但是我不确定这是否被弃用,或者是否有更好的方法。

通过configuration了Django-WSGI-Apache的LAN连接的机器访问内容

我configuration我的系统能够在我的机器上使用Apache部署Django的东西(Ubuntu 11.10)。我遵循http://blog.stannard.net.au/2010/12/11/installing-django-with -apache-and-mod_wsgi-on-Ubuntu-10-04 / 。一切都很顺利。我能够运行我在http://wsgi.helloserver上使用Django创build的url,也是在http:// hello。 djangoserver “。 现在我希望我能够通过LAN从另一台计算机(Windows Vista)运行相同的IP。我configurationIP后运行ifconfig Ubuntu 192.168.1.2和Windows 192.168.1.3使用我的Windows机器,我能够ping Ubuntu和恶作剧versa.Also我能够访问Ubuntu的本地主机使用Windows.ie try.php躺在Apache的家可以执行从Windows中击中“ http://192.168.1.2/trying.php ”然而现在我怎么得到“ http: //hello.djangoserver “从我的Windows机器上工作。 不得不提交url,因为我不允许发布超过2个url 编辑:在我的urls.py我一直在寻找“^你好/ $”这将调用相应的视图,在我的情况下hello.So在我的本地机器“ http://hello.djangoserver/hello ”工作正常。 现在,这就是我想要做的。在我的另一台机器(Windows),我通过局域网电缆连接,我希望能够运行“ http://hello.djangoserver/hello ”或192.168.1.2 / hello哪些目前不工作。所以将肖恩的答案https://serverfault.com/a/340154/103875工作?如果是的话如何? 谢谢

Django的WSGI应用程序在一个子目录中?

最近,我想把我的一个WSGI应用程序放到一个子目录中,这样其他包含各种脚本的目录就像以前一样工作。 为了做到这一点,我在全局命名空间的httpd.conf中添加了下面的指令(也试图把它放在VirtualHost ,它给出了相同的效果): WSGIScriptAlias /hello/ /var/www/hello/hello.wsgi 然后,我跑了django-admin startproject hello 。 重新加载Apacheconfiguration后,我可以确认http://localhost/hello/指向一个Django的“欢迎”屏幕。 然后,我编辑了hello/urls.py在urlpatterns元组中添加下面一行: url(r'^hello/', 'hello.views.home'), 接下来,我创build了具有以下内容的hello / views.py: from django.http import HttpResponse def hello(request): return HttpResponse("Hello world") 不幸的是,当我尝试访问http://localhost/hello/hello ,我得到一个标准的Apache 404消息,并在错误日志中input以下内容: [Mon Dec 23 19:49:44 2013] [error] [client 31.182.131.38] Target WSGI script not found or unable to stat: /var/www/hello/hello.wsgihello 注意hello.wsgihello 。 第二个hello是URL中/hello/之后出现的文本。 对于http://localhost/hello/unknown ,这将是hello.wsgiunknown 。 这里是我的hello.wsgi : […]