[已解决]python apache2 fcgid 问题

今天想试用一下python fcgid 装好以后发现
执行cgi脚本无效,错误日志如下:
编译fcgid的时候参考 http://blog.brandonking.net/?p=34
在Makefile 中添加了
CFLAGS = -arch ppc -arch ppc64 -arch i386 -arch x86_64

[Wed Oct 29 10:17:03 2008] [emerg] (13)Permission denied: mod_fcgid: can't get lock, pid: 15556
[Wed Oct 29 10:17:03 2008] [emerg] (13)Permission denied: mod_fcgid: can't get lock, pid: 15555
[Wed Oct 29 10:17:04 2008] [error] mod_fcgid: fcgid process manager died, restarting the server
向各位英雄请教,小弟先行谢过~

Apache config:

LoadModule fcgid_module modules/mod_fcgid.so

<IfModule mod_fcgid.c>
  AddHandler fcgid-script .fcgi .fpy .fcg
  SocketPath /Applications/xampp/xamppfiles/temp/fcgid_sock
  SharememPath  /Applications/xampp/xamppfiles/temp/fcgid_shm
  IPCConnectTimeout 20
Alias /fcgi /Applications/xampp/xamppfiles/fcgi-bin/
<Directory "/Applications/xampp/xamppfiles/fcgi-bin">
	SetHandler fcgid-script
	# FCGIWrapper "/usr/bin/env python2.5" .py 
	DirectoryIndex index.html index.py index.pl index.php
    Options +ExecCGI +FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>
</IfModule>


test.fcgi 脚本内容如下,已经装好flup包了
#!/usr/bin/env python2.5
try:
    from flup.server.fcgi import WSGIServer

    def myapp(environ, start_response):
        start_response('200 OK', [('Content-Type', 'text/plain')])
        return ['Hello World!\n']

    WSGIServer(myapp).run()

except Exception, e:
    print 'Content-Type: text/plain\r\n\r\n',
    print 'Oops...'
    print
    print 'Trac detected an internal error:'
    print
    print e
    print


问题已经解决了
确实是权限问题
修改httpd.conf的

User nobody
Group admin




User www
Group www


就OK了

你可能感兴趣的:(apache,nginx,python,脚本,lighttpd)