我在RedHat 5机器上运行Apache httpd 2.4.4。 我正在使用Django并通过mod_wsgi运行。 我在/ usr / bin中安装了Python 2.4.3,在/ usr / local / bin中安装了Python 2.7.6,我想使用2.7.6。 我从源代码构build2.7.6,并构build了mod_wsgi-3.4。 我已经创build了一个使用2.7.6的virtualenv,并且从命令shell中,python -V告诉我它正在使用2.7.6(在执行. virtpy/bin/activate )。 运行import sys; sys.version import sys; sys.version显示我2.7.6以及sys.executable显示我/www/sqla/virtpy/bin/python 。 当我从httpd运行它时,加载库时出现问题,当我查看sys.version ,我看到2.7.3 。 奇怪的是, sys.executable仍然显示我/www/sqla/virtpy/bin/python , 与我从命令shell中看到的完全一样 。 具体来说,当python试图加载_socket,我看到这个错误从httpd: ImportError: /www/sqla/virtpy/lib/python2.7/lib-dynload/_socket.so: undefined symbol: _PyInt_AsInt 如果我尝试从命令shell导入_socket,没问题。 我有. /www/sqla/virtpy/bin/activate . /www/sqla/virtpy/bin/activate在我的/ etc / sysconfig / httpd中. /www/sqla/virtpy/bin/activate ,并重新启动了Apache。 同一个可执行文件如何给出不同版本的python? […]
所以我得到403: Forbidden在我的apache2.4虚拟主机之一的错误。 有趣的是,/ /var/log/apache2/error.log报告: authz_core:error] [pid 4878:tid 140394394269440] [client 10.214.154.19:33009] AH01630: client denied by server configuration 而且….虽然我还有其他使用authz的虚拟主机(主要用于颠覆主机),但除了我遇到的问题之外,我禁用了所有这些虚拟主机,重新启动了Apache,而且没有明显的区别。 这里是我的Apache2站点可用的文件,尽pipe我禁用了所有其他主机configuration,并将我的configuration降到最低,但仍然拒绝访问。 <VirtualHost *:443> WSGIScriptAlias /example /data/example/example.wsgi <Directory /data/example> WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all Require all granted </Directory> LogLevel info SSLEngine on SSLCertificateFile /etc/ssl/certs/example.pem SSLCertificateKeyFile /etc/ssl/private/example.key </VirtualHost> 此外,为了validation它不是我的wsgi脚本,我用下面的脚本replace了脚本: def application(environ, start_response): start_response('200 OK',[('Content-type','text/html')]) return ['<html><body>Hello World!</body></html>'] 而这并没有任何明显的差异。 […]
我有以下的apache2 / wsgiconfiguration,这工作正常,除了apache保持logging: [info] Initial (No.1) HTTPS request received for child 1 (server myserver:443) [error] [client <IP>] client denied by server configuration: /empty/<API_CALL> 每次调用“ https:// myserver / rest / API_CALL ” <VirtualHost *:443> ServerName myserver:443 DocumentRoot /empty/ <Directory /> Order allow,deny Deny from all </Directory> SSLEngine On SSLCertificateFile /cert.pem SSLCertificateKeyFile /key.pem SSLVerifyClient optional_no_ca SSLOptions +StdEnvVars […]
我得到一个错误,试图访问我的Django应用程序。 我正在运行Gentoo,Web服务器是Apache,mod_wsgi模块显示Django。 错误说 OperationalError at /admin/ could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 我知道Django可以连接到Postgres数据库,因为我可以成功运行python manage.py syncdb 。 我也可以用psql -U root -d mysite进入交互式terminal。 sockets的ls -la是 root@ip-99-99-99-99 /var/run/postgresql # ls -la total 12K drwxr-x— 2 postgres 4.0K Mar 7 18:39 ./ drwxr-xr-x 6 root […]
安装mod_wsgi给出403错误 httpd.conf我添加了下面的代码 WSGIScriptAlias /wsgi "C:/xampp/www/htdocs/wsgi_app/wsgi_handler.py" <Directory "C:/xampp/www/htdocs/wsgi_app/"> AllowOverride None Options None Order deny,allow Allow from all </Directory> wsgi_handler.py status = '200 OK' output = 'Hello World!' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] 注意:localhost是我的虚拟主机域,它工作正常,但是当我请求http://localhost/wsgi/ got 403错误。 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:/xampp/www/htdocs/localhost" ServerName localhost ServerAlias www.localhost ErrorLog "logs/localhost-error.log" CustomLog "logs/localhost-access.log" combined </VirtualHost> […]
我刚才部署了一个应用程序,目前正在生产中。 我了解并尝试设置代码重新加载。 我阅读并遵循了文档。 现在我正在寻找一种方法来检查,看看我是否正确地configuration了一切,而不会对生产网站做出明显的改变。 我怎么去testing这个?
当我运行ps aux我得到了以下进程表http://pastebin.com/NJsASBek ,它显示了每个subprocess使用了多less内存。 我们可以看到Apache的过程如下所示: www-data 26487 0.0 0.9 245476 14920 ? Sl 17:32 0:00 /usr/sbin/apache2 -k start 其中2687是PID,但我不知道,如果这属于foo1.domain.com或foo2.domain.com或fooX.domain.com等… 我怎样才能知道哪些PID显示的网站(例如ServerName)? 这是如何定义我的apache网站http://pastebin.com/mcew79sH当然,我愿意编辑我的apache网站,如果需要的话。
这只是一个小小的问题,但我想知道是否有人能告诉我这个原因 – 当我重新启动apache时,这些行会写入/var/log/apache2/error.log [Thu Mar 24 10:20:56 2011] [warn] mod_wsgi: Compiled for Python/2.6.5. [Thu Mar 24 10:20:56 2011] [warn] mod_wsgi: Runtime using Python/2.6.6. [Thu Mar 24 10:20:56 2011] [notice] Apache/2.2.16 (Ubuntu) mod_wsgi/3.2 Python/2.6.6 configured — resuming normal operations 我如何解决这个问题? 我是不是该?
我是Linux新手。 我正在pipe理一个(Linux – Apache – mod_wsgi – Django)服务器,其中有多个Python安装。 该网站目前正在工作,但我想找出哪些可执行的Python是用来运行它。 我知道这不是默认的。 另外,mod_wsgi如何知道要使用哪种Python安装? .wsgi脚本没有shebang行。
我正在debuggingCentOS上的MoinMoin抛出一个权限错误的问题,但我无法追查有问题的文件/目录。 我在apache上运行strace -vp <pid> ; 当我遇到问题时,我看到: epoll_wait(10, {{EPOLLIN, {u32=3487534344, u64=140367313734920}}}, 2, 10000) = 1 accept4(6, {sa_family=AF_INET6, sin6_port=htons(52621), inet_pton (AF_INET6, "::ffff:105.193.30.91", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28], SOCK_CLOEXEC) = 11 ## Later on… read(7, 0x7fffa658ad7f, 1) = -1 EAGAIN (Resource temporarily unavailable) 但是,由于apache已经在运行,所以在文件7上我看不到相应的open() 。 因此我看到权限问题,但我仍然不知道哪个文件是问题。 我知道我可以尝试捕获所有的文件打开时,我重新生成的Apache,但我希望有一种方法来映射文件7到一个真正的文件名…有没有办法做到这一点? 编辑1: 使用@lain的指导,我跑了lsof | grep 266474069 lsof | grep 266474069 ,但结果不清楚… [root@lnxlmf moin]# […]