[afnog] FreeBSD, Apache24, mod_python, CGI, Genshi
Frank Habicht
geier at geier.ne.tz
Wed Sep 14 04:53:55 UTC 2016
Hi all,
need help.
on FreeBSD (FreeBSD 10.2-RELEASE-p18) with Apache24, installed mod_python
trying to follow
https://gitlab.labs.nic.cz/labs/ulg/
mod_python enabled like this:
[geier at stats2 ~]$ grep -A 1 'Third party modules'
/usr/local/etc/apache24/httpd.conf
# Third party modules
IncludeOptional etc/apache24/modules.d/[0-9][0-9][0-9]_*.conf
[geier at stats2 ~]$ cat /usr/local/etc/apache24/modules.d/270_mod_python.conf
## $FreeBSD: head/www/mod_python35/files/270_mod_python.conf.sample.in
411163 2016-03-15 14:02:09Z ohauer $
## vim: set filetype=apache:
##
## module file for mod_python 3.5.x
##
## PROVIDE: mod_python
## REQUIRE:
## make sure the following module is activated (httpd.conf or here)
#LoadModule python_module libexec/apache24/mod_python.so
LoadModule python_module libexec/apache24/mod_python.so
[geier at stats2 ~]$
and apache restarted.
[geier at stats2 ~]$ cat /usr/local/www/apache24/data/ulg/.htaccess
<FilesMatch "(.pyc|.*~)">
Deny from all
</FilesMatch>
Options +ExecCGI
AddHandler cgi-script .py
PythonPath "sys.path+['/usr/local/www/apache24/data/ulg']"
#AddHandler python-program .py
#PythonHandler foobar
PythonDebug On
[geier at stats2 ~]$
tried various combinations of the last 4 lines.
Some don't run python, deliver the source over http. not what we want.
The other (better?) ones give me :
500 Internal Server Error
"Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request."
and in the log :
[Mon Sep 12 15:37:34.073605 2016] [cgi:error] [pid 43409] [client
2001:4258:1:ff00:a5a0:9a9f:7316:9a45:55019] AH01215: env: python: :
/usr/local/www/apache24/data/ulg/ulg.py
[Mon Sep 12 15:37:34.073690 2016] [cgi:error] [pid 43409] [client
2001:4258:1:ff00:a5a0:9a9f:7316:9a45:55019] AH01215: No such file or
directory: /usr/local/www/apache24/data/ulg/ulg.py
[Mon Sep 12 15:37:34.073769 2016] [cgi:error] [pid 43409] [client
2001:4258:1:ff00:a5a0:9a9f:7316:9a45:55019] End of script output before
headers: ulg.py
does the first log line show an incorrect call to python?
does the "PythonHandler" need to be set? if yes, to what?
I also changed file ulgbird.py to comment out:
#import ulggraph
so that (to avoid graphviz dependencies) - no improvement.
I also installed py27-pygraphviz - no improvement.
Does anyone know what I'm doing wrong, or which online guide / document
I should be reading?
Thanks,
Frank
More information about the afnog
mailing list