FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Trouble getting Apache to exec .py files





Tac-Tics
I have the same Python script saved as both a .cgi and a .py file. As you can see, the .cgi executes the script while the .py does not.

http://tac-tics.frih.net/test.cgi
http://tac-tics.frih.net/test.py

My .htaccess is

Code:
DirectoryIndex index.html index.py
AddHandler cgi-script .py
Options +ExecCGI


And I added the handler in DirectAdmin
Handler extension
cgi-script py

The permissions are also both the same. What am I doing wrong?
Traveller
Although not at all familiar with Python, I searched the forum and found THIS POST that Bondings wrote in response to someone else who had asked about Python. I just tried his example (names changed, of course) on my site, and it worked, so I'm sure that if I can do it with NO prior Python experience, it should make perfect sense to you, and get you going.

Good luck, and have fun!
Tac-Tics
Traveller wrote:
Although not at all familiar with Python, I searched the forum and found THIS POST that Bondings wrote in response to someone else who had asked about Python. I just tried his example (names changed, of course) on my site, and it worked, so I'm sure that if I can do it with NO prior Python experience, it should make perfect sense to you, and get you going.

Good luck, and have fun!


Yes. I saw this post as well (and it did work).

However, I believe this example is using mod_python. On my personal apache server, I don't have mod_python. I use CGI instead. I can get my scripts to work by renaming them all as .cgi files, but I want to keep the extensions the same as on my HD.
Bondings
Tac-Tics wrote:
However, I believe this example is using mod_python. On my personal apache server, I don't have mod_python. I use CGI instead. I can get my scripts to work by renaming them all as .cgi files, but I want to keep the extensions the same as on my HD.

So why don't you keep them as a .cgi then? I don't really understand your problem.
Tac-Tics
Bondings wrote:
Tac-Tics wrote:
However, I believe this example is using mod_python. On my personal apache server, I don't have mod_python. I use CGI instead. I can get my scripts to work by renaming them all as .cgi files, but I want to keep the extensions the same as on my HD.

So why don't you keep them as a .cgi then? I don't really understand your problem.


My problem is just that =-) I want to keep the extension consistent with my own system (which won't work with cgi as it's currently set up). Moreover, the more I learn about configuring Apache, the better.

It seemed to me like all I would need to do would be add a single line to my .htaccess. If that isn't the case, I will probably end up renaming them anyway.
Related topics
DOUBLE HDD AND FTP
secure your pc
SUSE Linux 10 apache installation
Question, fix for deleting file owned by apche
Problems with PHP-Nuke on Server2
having trouble scoring on frihost?
Python beginners help!
Apache Owns needed files
PNG VS JPEG
How to have dynamic link button
My new website
Apache mod_rewrite
PHP5 MySQL Config on XP
TMP File Problem
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.