Python web server

A

arvind

When I run the script on server,only HTML part gets executed.
But the python code appears as it is on the screen in the text format.
How to run the CGI script on web server using Python2.4.3?
 
B

Bruno Desthuilliers

arvind said:
When I run the script

Which one ? And how ?
on server,

Which one ?
only HTML part gets executed.

HTML executed ???
But the python code appears as it is on the screen in the text format.
How to run the CGI script on web server using Python2.4.3?

Depends on your web server. But there's very probably all the needed
documention somewhere, and I'm pretty confident google will find it.
 
P

Paul Boddie

arvind said:
When I run the script on server,only HTML part gets executed.
But the python code appears as it is on the screen in the text format.
How to run the CGI script on web server using Python2.4.3?

We don't have much specific information from you here, but taking a few
guesses, it sounds like you have put a Python program in some directory
that your Web server knows about, but when you visit the address in
your browser that should let you use that program, you just see the
program text, not the output of the program when it is run.

What you need to do is to tell your Web server that the file is a
"script". With Apache, for example, instead of using configuration
directives like "Alias", you use "ScriptAlias" instead. Of course,
Apache has lots of different ways to make files behave like scripts,
and you may be using a completely different Web server, so a bit more
information would be welcome.

Still, one really simple method with Apache is to expose your program
like this:

ScriptAlias /myprogram "/home/me/programs/myprogram.py"

Provided you set the permissions of myprogram.py to be readable and
executable by the Web server user (if appropriate), and provided the
Web server user can navigate to the /home/me/programs directory, you
should at least get the program running. More configuration may be
needed - why not let us know how far you get?

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top