python als apache2 modul will nicht
hi!
da man ja offen für alles sein sollte, habe ich mir mal libapache2-mod-python2.3 installiert (debian sarge). apache2 stop/start lief problemlos, habe dann mal eine datei versuch.py angelegt...wenn ich sie im browser aufrufe will er sie einfach nur runterladen (der server versteht also nicht ganz, was er damit anfangen soll). auch wenn ich in die kopfzeile #! /usr/bin/python schreibe und die datei für alle ausführbar mache, bringts nüscht. im ordner /etc/apache2/mods-enabled/ steht auch lrwxrwxrwx 1 root root 33 2005-07-05 18:16 mod_python.load -> ../mods-available/mod_python.load drin...wie heißt noch mal die datei für den apache2, wo drin steht, was er mit dateien mit der endung .py machen soll? wahrscheinlich in der gleichen wo das für php-dateien drin steht, nur welche war das noch mal? danke für die antworten! |
AW: python als apache2 modul will nicht
Für php-Dateien brauchst du folgende Zeilen in der httpd.conf:
Code:
AddType application/x-http-php .php Zitat:
|
AW: python als apache2 modul will nicht
julian@pc:~$ ls -l /usr/bin/ | grep python
lrwxrwxrwx 1 root root 23 2005-05-08 00:55 pdb2.3 -> ../lib/python2.3/pdb.py lrwxrwxrwx 1 root root 9 2005-05-06 22:39 python -> python2.3 -rwxr-xr-x 1 root root 983480 2005-05-04 09:09 python2.3 das meinst du, oder? wenn ich in die /etc/apache2/httpd.conf reingucke, sehe ich das: julian@pc:~$ cat /etc/apache2/httpd.conf # This is here for backwards compatability reasons and to support # installing 3rd party modules directly via apxs2, rather than # through the /etc/apache2/mods-{available,enabled} mechanism. # #LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so mehr nicht...die httpd.conf wird doch für apache2 nicht mehr benutzt, oder irre ich mich? |
AW: python als apache2 modul will nicht
Zitat:
|
AW: python als apache2 modul will nicht
oh, hm, naja, ich frag vielleicht mal direkt in nem debianforum nach...trotzdem danke für die hilfe!
|
AW: python als apache2 modul will nicht
Man kann das auch in httpd.conf schreiben. Der Apache nutzt die auch, aber man sollte es halt in die andere Datei schreiben.
Das muss übrigens rein damit Python geht: Code:
AddHandler mod_python .psp .psp_ |
AW: python als apache2 modul will nicht
Ohne eine großartige Diskussion lostreten zu wollen: was kann Python, was PHP (oder auch Perl) nicht kann? Warum nutzt man es? Stärken/Schwächen, Unterschiede, Links dazu?
|
AW: python als apache2 modul will nicht
Zitat:
|
AW: python als apache2 modul will nicht
Ich hab gerade keinen Apache2 auf Debian da, aber entweder wars die mod.conf oder httpd.conf.local. Welche genau ist eigentlich wurscht, hauptsache sie wird in die httpd.conf includiert.
|
AW: python als apache2 modul will nicht
ich habe jetzt folgendes in der httpd.conf stehen:
AddHandler mod_python .py aber trotzdem wird mir die datei.py zum download angeboten (ja, apache hab ich neugestartet) Zitat:
python wurde entwickelt, um lesbar zu sein. anweisungsblöcke stehen nicht in {}, sondern werden eingerückt. die anweisungen werden möglichst in sprechenden worten gehalten (z.b. kam bei || in ner if-bedingung ein error, es _muss_ or heißen)...es dürfte ein wenig schneller sein als php (vor allem was oop angeht, wobei das mit php5(.1) auch wieder so ne sache ist)...mehr fällt mir grade nicht ein. musste da halt fürs studium was kleines machen und es gefiel mir auf anhieb. empfehlen kann ich folgende lektüre (gratis ebook): http://www.diveintopython.org/ |
Alle Zeitangaben in WEZ +2. Es ist jetzt 03:26:24 Uhr. |
Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.