[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cgi's don't work in vhost config with apache

Justin Ryan <jryan@rackspace.com> schrieb am Thu, Sep 26, 2002 at 09:00:38AM -0500:
> I first stuck the script(s) in /usr/lib/cg-bin without modifying apache
> configuration.  I tried adding the ScriptAlias line and <Directory>
> entry from apache's global config to the <VirtualHost> - no cigar.

I've done it this way:

        <Directory /home/dkg/www/python>
                AddHandler python-program .py
                PythonHandler mptest
                PythonDebug On

> #!/usr/bin/python
> print "Content-Type: text/plain\n\n"
> print "Hello Web!"

Try the following code:

from mod_python import apache 

def handler(req):

	req.content_type = "text/plain"
	req.write("High, Girls!")

	return apache.OK

# Schwanzlaengenvergleich ;)
echo `uptime|grep days|sed 's/.*up \([0-9]*\) day.*/\1\/10+/'; \
cat /proc/cpuinfo|grep MHz|awk '{print $4"/30 +";}'; free|grep '^Mem' \
|awk '{print $3"/1024/3+"}'; df -P -k -x nfs | grep -v 1k \
| awk '{if ($1 ~ "/dev/(scsi|sd)"){ s+= $2} s+= $2;} END \
{print s/1024/50"/15+70";}'`|bc|sed 's/\(.$\)/.\1cm/'

Reply to: