Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Recognizing files coded in Python |
|
Author |
|
cep
Joined: 23 Sep 2008 Posts: 4 Location: cep
|
Posted: Sat 31 Jan '15 2:21 Post subject: Recognizing files coded in Python |
|
|
I am looking for help.
I have installed mod_python and the mods-enabled directory in the Apache2 directory looks correct (links to the available directory and the .load file), but I can't get Apache2 to process Python coded files.
I am missing something, but don't know what. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 31 Jan '15 5:25 Post subject: |
|
|
maybe;
AddHandler mod_python .py |
|
Back to top |
|
cep
Joined: 23 Sep 2008 Posts: 4 Location: cep
|
Posted: Sat 31 Jan '15 19:53 Post subject: |
|
|
AddHandler already configured as you suggested.
Any other ideas? |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 31 Jan '15 20:39 Post subject: |
|
|
No, not from me. Did you restart the Apache service or reboot the server?
However lack of showing us anything other the a minor description of what you did (which did not include mentioning AddHandler) doesn't help anybody help you since we're just guessing at this stage.
Show the configuration you used specific to your problem, don't just drop the entire config here as it's against the rules. Maybe someone will see something you may have done incorrectly or didn't do at all. |
|
Back to top |
|
cep
Joined: 23 Sep 2008 Posts: 4 Location: cep
|
Posted: Sun 01 Feb '15 1:28 Post subject: |
|
|
Okay, Since you just said 'maybe, Addhandler' I assumed you knew the entire Directory definition.
My Directory define in apache2.conf is:
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
Addhandler mod_python .py
PythonHandler mod_python.publisher
</Directory>
My Directory define in sites-available/000-default.conf is:
ServerAdmin webmaster@localhost
DocumentRoot "/var/www/html"
DirectoryIndex index.html index.php index.py
<Directory /var/www/html>
OPtions +Indexes +FollowSymLinks -MultiViews +ExecCGI
AllowOverride None
Require all granted
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
In mods-available/python.load there is the statement:
LoadModule python_module /usr/lib/apache2/modules/mod_python.so
I hope this is all the configuration statements that are needed to add processing python files in Apache. |
|
Back to top |
|
|
|
|
|
|