← Back to team overview

sslug-teknik team mailing list archive

Re: Gentoo, Apache2 og mod_python.

 

On Fri, 2004-05-21 at 13:54, Anders Bruun Olsen wrote:
> > Nogle gode idéer?
> 
> Vi benytter mod_python på mit arbejde og her ser opsætningen sådan her
> ud:
> 
> gorm root # cat /etc/apache2/conf/modules.d/16_mod_python.conf
> <IfDefine PYTHON>
>   <IfModule !mod_python.c>
>     LoadModule python_module    extramodules/mod_python.so
>   </IfModule>
> </IfDefine>
> 
> <IfModule mod_python.c>
> #
> # Mod_python is a module that embeds the Python language interpreter
> # within the server, allowing Apache handlers to be written in Python.
> #
> 
> # This will cause files beneath /home/httpd/htdocs with the extension
> # .spam
> # to be handled by the Python script /home/httpd/htdocs/eggs.py
> #
> #<Directory /home/httpd/htdocs>
> #    <IfModule mod_mime.c>
> #    AddHandler python-program .spam
> #    </IfModule>
> #    PythonHandler eggs
> #</Directory>
> 
> # This will cause all requests to the /python heirachy of your
> # webserver to be handled by the python script /path/to/myhandler.py
> #
> #<Location /python>
> #    SetHandler python-program
> #    PythonPath "sys.path + ['/path/to']"
> #    PythonHandler myhandler
> #</Location>
> 
> # This will cause all requests to the /python heirachy of your
> # webserver to be handled by mod_python's Publisher handler
> #
> #<Location /python>
> #    SetHandler python-program
> #    PythonHandler mod_python.publisher
> #</Location>
> 
> </IfModule>
> 
> gorm root # grep APACHE2_OPTS /etc/conf.d/apache2
> APACHE2_OPTS="-D PHP4 -D PYTHON"
> 
> Derudover kører vi så med vhosts og enabler mod_python for de specifikke
> domæner der skal bruge det i /etc/apache2/conf/vhosts/vhosts.conf. Det ser
> nogenlunde sådan her ud:
> 
>     <Directory "/path/to/scripts/dir">
>         AddHandler python-program .py
>         PythonHandler mod_python.publisher
>         PythonDebug On
>         AllowOverride None
>         Options None
>         Order allow,deny
>         Allow from all
>     </Directory>
> 
> 
> Mon ikke at det kan hjælpe dig lidt på vej?


BINGO!!! Takker!

Jeg havde helt overset konfigurationsfilen /etc/conf.d/apache2

Jeg satte APACHE2_OPTS="-D PYTHON".
Men i 16_mod_python.conf skulle jeg også ændre fra: AddHandler
mod_python .py
til: AddHandler python-program .py
før det virkede. (?)

Selv min database er med på den, så nu kan det kun gå for langsomt. Tak!

Hilsen Ole




References