Python web server
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? -- http://mail.python.org/mailman/listinfo/python-list
Re: Python web server
arvind wrote: > 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. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list
Re: Python web server
arvind wrote: > 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 -- http://mail.python.org/mailman/listinfo/python-list
Lowest hassle Python web server?
I keep telling my friends that Python rocks. Now it's time to put my money where my mouth is. I'm about to start writing a server for a phone based game. It needs to handle simlpe requests from some Java code running on the phone at a fairly low transaction rate. There will also be a simple web site allowing users to edit preferences and so forth. I have just enough Python experience to decide that I prefer it over Java for this job. It'll be on a Linux box that I have full control over. I can see from FAQs that there are several possible ways of doing web server work in Python, e.g. Twisted or mod_python in Apache, etc. So I'm wondering: - Could you recommend a solution you've found to be the most convenient? - Does threading cause any more of a hassle in Python than Java? - Is there anything similar to JSP in Java? Thanks, KanZen -- http://mail.python.org/mailman/listinfo/python-list
Web server platform for beginner
Hi, I'm looking at python as a serious alternative for Windows Forms, C# and ASP.Net as it is completely open source. I've determined that wxPython is the best replacement for Windows Forms but have not managed to find a comprehensive list of all the web platforms that python runs on apart from Zope and mod_python. Are there any others which are simpler than mod_python handlers, yet not as extensive as Zope? Cheers, - Chris. -- http://mail.python.org/mailman/listinfo/python-list
Re: Lowest hassle Python web server?
kanzen wrote: - Does threading cause any more of a hassle in Python than Java? What hassles have you had? I thought threads in Java were pretty straightforward. In any case, in Python they are generally very easy to use, provided you have a basic knowledge of thread safety issues and/or provided you restrict all interaction between threads to use the Queue module. - Is there anything similar to JSP in Java? Snakelets? Google will find it for you. -Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: Lowest hassle Python web server?
kanzen wrote: I keep telling my friends that Python rocks. Now it's time to put my money where my mouth is. I'm about to start writing a server for a phone based game. It needs to handle simlpe requests from some Java code running on the phone at a fairly low transaction rate. There will also be a simple web site allowing users to edit preferences and so forth. I have just enough Python experience to decide that I prefer it over Java for this job. It'll be on a Linux box that I have full control over. I can see from FAQs that there are several possible ways of doing web server work in Python, e.g. Twisted or mod_python in Apache, etc. So I'm wondering: - Could you recommend a solution you've found to be the most convenient? - Does threading cause any more of a hassle in Python than Java? - Is there anything similar to JSP in Java? Thanks, KanZen You can look into CherryPy http://www.cherrypy.org/ Hope this helps Adonis -- http://mail.python.org/mailman/listinfo/python-list
Re: Lowest hassle Python web server?
kanzen wrote: I keep telling my friends that Python rocks. Now it's time to put my money where my mouth is. I'm about to start writing a server for a phone based game. It needs to handle simlpe requests from some Java code running on the phone at a fairly low transaction rate. There will also be a simple web site allowing users to edit preferences and so forth. I have just enough Python experience to decide that I prefer it over Java for this job. It'll be on a Linux box that I have full control over. I can see from FAQs that there are several possible ways of doing web server work in Python, e.g. Twisted or mod_python in Apache, etc. So I'm wondering: - Could you recommend a solution you've found to be the most convenient? I've tested a few, and when it finally came that I wanted and needed to do web application development in Python for real, I decided to use Snakelets. So far, I find it a very convenient way to write web applications. It's also very close to how Java servlets/JSP pages work. FWIW, the other frameworks I've tested thoroughly were Quixote and WebWare. - Does threading cause any more of a hassle in Python than Java? - Is there anything similar to JSP in Java? Snakelets Ypages come close to JSP. -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list
Re: Lowest hassle Python web server?
- Does threading cause any more of a hassle in Python than Java? Hello, From the python docs, it states that the threading design is loosely based upon the java module. Certainly, coming from Java I had little trouble getting used to python threading. However heres some gotchyas : - The thing to beware of there is something in Python called the GIL. Read up about that before you start threading stuff - this will explain to you why there is no volatile keyword - this got me confused at first. - There is no synchronize keyword, instead you have to use locks which can be obtained from the threading module - There are no methods such as wait on an object (there is an event object you can get to call wait upon - again threading) - The handy concurrent stuff which has been introduced in J2SE5.0 mainly isn't in python - through you do get Queues in Python (maybe more, I dunno?) The GIL thing makes it easier to do threading with Python (there are disadvantages to the GIL but I won't get into that here - if you're interested read through the history on this group) but it's still threading so beware! Cheers, Neil -- Neil Benn Senior Automation Engineer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 154 e-mail : [EMAIL PROTECTED] Cenix Website : http://www.cenix-bioscience.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Lowest hassle Python web server?
Okay, thanks for your suggestions. Are there any further recommendations as to what Python framework to use if the web server is Apache with mod_python? -- http://mail.python.org/mailman/listinfo/python-list
Re: Lowest hassle Python web server?
kanzen wrote: > I keep telling my friends that Python rocks. Now it's time to put my > money where my mouth is. I'm about to start writing a server for a > phone based game. It needs to handle simlpe requests from some Java > code running on the phone at a fairly low transaction rate. There will > also be a simple web site allowing users to edit preferences and so > forth. I have just enough Python experience to decide that I prefer it > over Java for this job. It'll be on a Linux box that I have full > control over. > > I can see from FAQs that there are several possible ways of doing web > server work in Python, e.g. Twisted or mod_python in Apache, etc. So > I'm wondering: > > - Could you recommend a solution you've found to be the most > convenient? > - Does threading cause any more of a hassle in Python than Java? > - Is there anything similar to JSP in Java? > > Thanks, > KanZen > You might want to take a look a Medusa. It is the basis for the web server that is bundled in Zope. http://www.nightmare.com/medusa/ Larry Bates -- http://mail.python.org/mailman/listinfo/python-list
Re: Lowest hassle Python web server?
Larry Bates wrote: [...] You might want to take a look a Medusa. It is the basis for the web server that is bundled in Zope. Medusa is just an asyncore framework, and not something you can develop web apps with. -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list
Re: Web server platform for beginner
Chris, CherryPy 2 is very easy to get started with. -- http://mail.python.org/mailman/listinfo/python-list
Re: Web server platform for beginner
Chris wrote: > Hi, > > I'm looking at python as a serious alternative for Windows Forms, C# > and ASP.Net as it is completely open source. > > I've determined that wxPython is the best replacement for Windows Forms > but have not managed to find a comprehensive list of all the web > platforms that python runs on apart from Zope and mod_python. > > Are there any others which are simpler than mod_python handlers, yet > not as extensive as Zope? Have you seen http://wiki.python.org/moin/WebProgramming ? May I suggest to give Snakelets a try. --Irmen -- http://mail.python.org/mailman/listinfo/python-list
Re: Web server platform for beginner
If only i'd seen that page ;-) Thanks for the heads up Cheers, - Chris. -- http://mail.python.org/mailman/listinfo/python-list
Basic Auth for simple web server
Hi, I'm a Python newbie; I have to write a simple webserver, and I need to implement a basic authentication as specified in the RFC2617. I wonder if there is a Python library for doing that. Thanks! -- Marco Aloisio -- http://mail.python.org/mailman/listinfo/python-list
setting file permissions on a web server
I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755 scriptname.py but *where* do you run this? Is this done on your personal system, or on the server? What if you are using Windows? If it's done on the server, how do you do it? The only way I've figured out so far how to do this is to upload my cgi files to my server, then within my FTP program I right-click the file and change its permission number that way, but that seems an inefficient way to do it, especially having to do it each time. Is there a way to put the above line within the script perhaps, so that the script sets its permission automatically? Or do certain editors allow you to save files with a predetermined permission? Aside from my right-clicking method, I don't know how else to do it. -- http://mail.python.org/mailman/listinfo/python-list
Advice for Python and Web Server/Services?
I have recently discovered Python and like it quite a bit. I would like to use it on a new project I am starting. The project will gather data from several web services and present the collected data to browser users through a web server. So basically I need a full-time web server and a separate way to poll web services for their data. There is no database involved. The problem is that I have tried several Python web servers (CherryPy, Karrigell, etc) and they all have problems getting out through my Comcast cable modem. There is a 3 second pause every 10th file. Never the 9th or 11th, but always the 10th file. I thought maybe Comcast was limiting incomming HTTP but Apache does not do this so I'm stumped as to why it is happening with the Python servers. All servers work fine over the LAN. Anyway, I wanted to get some advice on what type of setup would be best for this using Apache. The web service polling needs to be going all the time so a straight CGI-type thing is not an option. I've looked in to fastcgi and mod_python but I'm not sure either is what I need. What I want is for my Python program to be polling the web services 24/7 and Apache to serve static pages by itself but call a function in my already running Python program for files with a certain extension (.xml for example). Have any of you done something like this before? Ideally, I'd like to figure out why the Python servers are having problems. This is a very low volume system so straight Python would be great if I can get it working. Thanks for any advice you can give. -- Ron Davis -- Ron Davis -- http://mail.python.org/mailman/listinfo/python-list
Re: Basic Auth for simple web server
On Jun 5, 4:28 pm, Marco Aloisio <[EMAIL PROTECTED]> wrote: > Hi, I'm a Python newbie; > I have to write a simple webserver, and I need to > implement a basic authentication as specified in the RFC2617. > I wonder if there is a Python library for doing that. > > Thanks! > > -- > Marco Aloisio Have a look at paste (http://pythonpaste.org/). For instance, to enable authentication for user foo, you can do the following from paste.auth.basic import AuthBasicHandler def only_for_foo(env, user, passwd): return user == 'foo' and passwd = 'bar' auth_app = AuthBasicHandler( myapp, 'app realm', only_for_foo) (where myapp is your WSGI application, of course). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
John Salerno: >I always read about how you need to set certain file permissions (for >cgi files, for example), but it's never been clear to me *how* you do >this. I know you can run the line > >chmod 755 scriptname.py > >but *where* do you run this? This is a Unix/Linux command. You run it in a shell login on the server (e.g. in Putty, SecureCRT, or some other ssh client you're using). >Is there a way to put the above line within the script perhaps, so that >the script sets its permission automatically? Not in the script itself via cgi of course, because it needs certain permissions before it can be run as cgi script. But you could put the command in an installation script that installs the cgi script. -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
> I always read about how you need to set certain file permissions (for > cgi files, for example), but it's never been clear to me *how* you do > this. I know you can run the line > > chmod 755 scriptname.py > > but *where* do you run this? Is this done on your personal system, or on > the server? What if you are using Windows? If it's done on the server, > how do you do it? > > The only way I've figured out so far how to do this is to upload my cgi > files to my server, then within my FTP program I right-click the file > and change its permission number that way, but that seems an inefficient > way to do it, especially having to do it each time. > > Is there a way to put the above line within the script perhaps, so that > the script sets its permission automatically? Or do certain editors > allow you to save files with a predetermined permission? > > Aside from my right-clicking method, I don't know how else to do it. I guess this would be a good starting point: http://www.linuxcommand.org/man_pages/chmod1.html In short, chmod refers to local files so wherever you run it it will refer to files on that machine. You run it simply by typing it in a shell as a user who has privilage to perform the operatation, which can mean you have to be an owner of the file but if you are root you can do it in any case. Depending on your ftp, scp, http or whatever method you use to transfer files the file permissions may or may not change during the transfer. If permissions are kept intact you can chmod on your local machine and then transfer, if they are not then you transfer first and chmod on the server. When you transfer files from a windows machine to *nix it again depends on the particular method you choose how the permissions will be set. There is no way of putting this permission information into the file itself but some (most?) editors can be set to save the file with a permission of your choice. Hope this helps. -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
Daniel Nogradi wrote: > In short, chmod refers to local files so wherever you run it it will > refer to files on that machine. You run it simply by typing it in a > shell as a user who has privilage to perform the operatation, which > can mean you have to be an owner of the file but if you are root you > can do it in any case. Depending on your ftp, scp, http or whatever > method you use to transfer files the file permissions may or may not > change during the transfer. If permissions are kept intact you can > chmod on your local machine and then transfer, if they are not then > you transfer first and chmod on the server. When you transfer files > from a windows machine to *nix it again depends on the particular > method you choose how the permissions will be set. Thanks, but I'm still a little confused. Since I'm running Windows, I assume that I can't run the chmod line on my own computer. My web server uses Unix, but is it possible for me to have access to a command line for the server? I didn't know that was possible for basic web hosting plans (I'm using 1and1 right now). I suppose I could write a script that would set the permissions of all the files in a particular folder on my computer to 755, but is there a Windows equivalent command for chmod to do this? Or am I stuck having to do it on the server side? -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
> I suppose I could write a script that would set the permissions of all > the files in a particular folder on my computer to 755, but is there a > Windows equivalent command for chmod to do this? Or am I stuck having to > do it on the server side? The chmod has to be executed on the machine the file resides on - aka the server. If your plan includes a ssh-account you can use that. Otherwise you might be able to create an ftplib-based script that will automate this over ftp. Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
> > In short, chmod refers to local files so wherever you run it it will > > refer to files on that machine. You run it simply by typing it in a > > shell as a user who has privilage to perform the operatation, which > > can mean you have to be an owner of the file but if you are root you > > can do it in any case. Depending on your ftp, scp, http or whatever > > method you use to transfer files the file permissions may or may not > > change during the transfer. If permissions are kept intact you can > > chmod on your local machine and then transfer, if they are not then > > you transfer first and chmod on the server. When you transfer files > > from a windows machine to *nix it again depends on the particular > > method you choose how the permissions will be set. > > Thanks, but I'm still a little confused. Since I'm running Windows, I > assume that I can't run the chmod line on my own computer. Correct, chmod is a *nix command. > My web server > uses Unix, but is it possible for me to have access to a command line > for the server? This depends on your arrangements with your web server provider. Perhaps you are allowed to ssh into that machine, perhaps not, you need to ask your provider. In case you can use ssh, then you can log in with putty (an ssh client for windows, grab it from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/) and you will have a command line on the server so you can run chmod there. > I didn't know that was possible for basic web hosting plans (I'm using 1and1 > right now). I have absolutely no experience with public web hosting but I guess some might provide ssh-ing possibilities although I imagine most don't. > I suppose I could write a script that would set the permissions of all > the files in a particular folder on my computer to 755, but is there a > Windows equivalent command for chmod to do this? I have next to zero experience with windows but as far as I know windows doesn't have file permissions at all (anyone, please correct me if I'm wrong :)) so in windows land it doesn't make any sense to "change file permissions". Even if it has some sort of a notion of file permissions I wouldn't know how that gets translated into unix. > Or am I stuck having to do it on the server side? I guess so. But that's not a terribly big problem even if you can't use ssh. What I would do is write a script (in python of course :)) that does the file permission changing and run that script over the web. Since this can have serious security implications my strategy would be to place this script somewhere which is not reachable through the web and only relocate it to a web accessible directory when you want to run it over the web, and when you are done, you place it back to its secure location so nobody can reach it. You can find out how to write this script from http://docs.python.org/lib/os-file-dir.html HTH :) -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
John Salerno wrote: > Thanks, but I'm still a little confused. Since I'm running Windows You misplaced your period, it goes at the end of that line. ;) > assume that I can't run the chmod line on my own computer. Sure you can, install cygwin. chmod only affects files on your computer, and won't alter the Windows permissions (which use a different scheme), but you can do it. > My web server > uses Unix, but is it possible for me to have access to a command line > for the server? I didn't know that was possible for basic web hosting > plans (I'm using 1and1 right now). It is entirely possible (indeed, I don't know how most things would ever get done without it). Most basic hosting plans however don't provide shell access. > I suppose I could write a script that would set the permissions of all > the files in a particular folder on my computer to 755, but is there a > Windows equivalent command for chmod to do this? Or am I stuck having to > do it on the server side? 1. Settings permissions on your computer won't do a thing. 2. There's probably a Windows-equiv of chmod for your own files, but it won't affect files placed on another machine. 3. You're stuck having to do it on the server side. Now a good ftp program can automate this for you, but it's still your job, not the servers. These sound like good questions for your hosting provider, or failing that, google. -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
Daniel Nogradi wrote: > I have next to zero experience with windows but as far as I know > windows doesn't have file permissions at all (anyone, please correct > me if I'm wrong :)) so in windows land it doesn't make any sense to > "change file permissions". Actually Windows has a quite good permission scheme, with full owner/group ACLs and granular permissions for read, write, append, delete, and several others I can't recall. The problem is no one uses them much. The manipulation tools are a pain, and developers routinely ignore them (including Microsoft's own developers, although I hear they've gotten much better lately). > I guess so. But that's not a terribly big problem even if you can't > use ssh. What I would do is write a script (in python of course :)) > that does the file permission changing and run that script over the > web. Since this can have serious security implications my strategy > would be to place this script somewhere which is not reachable through > the web and only relocate it to a web accessible directory when you > want to run it over the web, and when you are done, you place it back > to its secure location so nobody can reach it. You're right about the security concerns, but your solution sounds like more trouble than it's worth. With a bit more effort, you could write a local python script that acts as an ftp client and applies permissions remotely. But why bother when a good ftp client already has that built-in (and is much less likely to contain destructive bugs). > You can find out how to > write this script from http://docs.python.org/lib/os-file-dir.html You're worried about security and you turn a novice with a scripting language loose in the briar patch of unix permissions, on a remote server no less? And I thought I was sadistic! :) -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
Daniel Nogradi wrote: > I have next to zero experience with windows but as far as I know > windows doesn't have file permissions at all (anyone, please correct > me if I'm wrong :)) so in windows land it doesn't make any sense to > "change file permissions". Even if it has some sort of a notion of > file permissions I wouldn't know how that gets translated into unix. This is getting a little off-topic, I admit, but the NT-derived versions of Windows do indeed have file permissions. The Windows-equivalent of chmod (and chown) is cacls ("Change Access Control Lists"): http://www.ss64.com/nt/cacls.html In essence, each file has an owner and a list of other users and groups, who may each have "Full control" (meaning they can change permissions), read-only, write-only, read-write, or no access. Windows 95 and its descendants don't have permissions any more than DOS does. (Except with respect to Windows network file-sharing.) (Heh, I checked just before posting this and someone beat me to it. Here's my post anyway.) :-) -Kirk McDonald -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
Daniel Nogradi wrote: > This depends on your arrangements with your web server provider. > Perhaps you are allowed to ssh into that machine, perhaps not, you > need to ask your provider. In case you can use ssh, then you can log > in with putty (an ssh client for windows, grab it from here: > http://www.chiark.greenend.org.uk/~sgtatham/putty/) and you will have > a command line on the server so you can run chmod there. Turns out that my web hosting company provides ssh access on the next highest plan and up, but not mine. :) Oh well, I think I'll explore FileZilla a little more and see if there's more of an automated way to do it than just right-clicking each file (or even right-clicking multiple files at once, if possible). It shouldn't be too big of a deal anyway, but I'm always after more automated ways to do things...call me lazy! :) -- http://mail.python.org/mailman/listinfo/python-list
Re: setting file permissions on a web server
John Salerno wrote: Most FTP servers do allow to use chmod in a ftp session, although you're client must support it. See for example a cli ftp client (and server) on FreeBSD. > [EMAIL PROTECTED]:~$ ftp ftp.xs4all.nl > Connected to ftp2.xs4all.nl. > 220 XS4ALL ftpd DCLXVI > Name (ftp.xs4all.nl:mhellwig): > 331 Password required for mhellwig. > Password: > 230 User mhellwig logged in. > Remote system type is UNIX. > Using binary mode to transfer files. > ftp> ls MHellwigCV_02_10_01.pdf > 150 Opening ASCII mode data connection for file list > -- 1 mhellwig user 211102 May 19 2003 MHellwigCV_02_10_01.pdf > 226 Transfer complete. > ftp> chmod 400 MHellwigCV_02_10_01.pdf > 200 SITE CHMOD command successful > ftp> ls MHellwigCV_02_10_01.pdf > 150 Opening ASCII mode data connection for file list > -r 1 mhellwig user 211102 May 19 2003 MHellwigCV_02_10_01.pdf > 226 Transfer complete. > ftp> See? -- mph -- http://mail.python.org/mailman/listinfo/python-list
Re: Advice for Python and Web Server/Services?
On Sunday 26 March 2006 5:00 pm, Dennis Lee Bieber wrote: > Any possibility you need to specify an option on the socket > connections to reuse-sockets without the normal time-out? The problem turned out to be keep-alive. Apparently, Comcast is limiting my inbound connections. Apache keeps the connections alive so it works fine. The Python servers don't support keep-alive and are using up the available connections too quickly. I'm now using Apache as a proxy to the Python server and it works well. Thanks for the response. > On Sun, 26 Mar 2006 14:55:12 -0500, Ron Davis <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > I've looked in to fastcgi and mod_python but I'm not sure either is what > > I need. What I want is for my Python program to be polling the web > > services 24/7 and Apache to serve static pages by itself but call a > > function in my already running Python program for files with a certain > > extension (.xml for example). > > I think you'll first need to disconnect the two sides... The program > doing the polling has to run completely stand-alone from your own > web-server. I also think you'll need to create some independent > (file-system?) store which the polling program can write to; so your web > server page can do the selected retrieval -- but since you don't want a > database capable of concurrent access... The polling program needs to > include an asynchronous or threaded scheme with a local socket so the > web server (CGI) process can connect to it and requests the poller to > return the data. > > > Ideally, I'd like to figure out why the Python servers are having > > problems. This is a very low volume system so straight Python would be > > great if I can get it working. > > Any possibility you need to specify an option on the socket > connections to reuse-sockets without the normal time-out? > -- > > > == < > > [EMAIL PROTECTED] | Wulfraed Dennis Lee Bieber KD6MOG < > > [EMAIL PROTECTED] | Bestiaria Support Staff < > > == < > > Home Page: <http://www.dm.net/~wulfraed/>< > >Overflow Page: <http://wlfraed.home.netcom.com/>< -- Ron Davis Custom Software Engineering -- http://mail.python.org/mailman/listinfo/python-list
How to enable Python Scripts with MS IIS Web Server?
Hi. I have MS Windows Server 2003, Enterprise Edition. It has MS Management Console 2.0, Version 5.2 and IIS Manager 6.0 I have a directory called "myDirs". Within this directory are 2 files: 1) index.pl (a perl script) 2) index.py (a python script whose first line is "#!C:\Python21\pythonw.exe") The webserver is listening on port 8080. When I point my browser to http://localhost:8080/myDirs/index.pl, it works... I see the output of the perl script. HOWEVER, When I point my browser to http://localhost:8080/myDirs/index.py, it simply shows the python file as text. It doesn't interpret it at all. How Can I get it to interpret the python file using the interpreter and display the output in the browser? Please explain each step in careful/excruciating detail because I'm a windows Newbie. -Saqib Ali -- http://mail.python.org/mailman/listinfo/python-list
Re: How to enable Python Scripts with MS IIS Web Server?
hi, you should first install win32all : http://starship.python.net/crew/mhammond/ next, 2 ways 2 proceed, but the first is the easier : you make a "test.asp" page in the folder at the top, you write <@Language=Python%> a line below : <%Response.Write("Hello World")%> try if the page works well. if it works then your python/iis install is ok the second way is to keep the .py extension and to associate it with the python executable http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494 hope this helps juju <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > > > > Hi. I have MS Windows Server 2003, Enterprise Edition. > It has MS Management Console 2.0, Version 5.2 > and IIS Manager 6.0 > > > > I have a directory called "myDirs". Within this directory are 2 files: > 1) index.pl (a perl script) > 2) index.py (a python script whose first line is > "#!C:\Python21\pythonw.exe") > > The webserver is listening on port 8080. > > When I point my browser to http://localhost:8080/myDirs/index.pl, it > works... I see the output of the perl script. > > HOWEVER, > When I point my browser to http://localhost:8080/myDirs/index.py, it > simply shows the python file as text. It doesn't interpret it at all. > > How Can I get it to interpret the python file using the interpreter and > display the output in the browser? > > Please explain each step in careful/excruciating detail because I'm a > windows Newbie. > > > -Saqib Ali > -- http://mail.python.org/mailman/listinfo/python-list
connect to a remote web server & upload data from Python using ssh and scp
Hi all, I need to upload data ( text & image data ) to a remote web server from python. I came to know that i could do it using ssh and scp.but am not sure of how to do it. I don't want to use CGI for that . Can anyone help mehow to do it, and where i can get a good tutorial for doing thisI surfed the net..but could'nt find a good doc for this.. Thanks, for your time ! Swarna. Enjoy this Diwali with Y! India Click here-- http://mail.python.org/mailman/listinfo/python-list
RE: connect to a remote web server & upload data from Python using sshand scp
[Swarna Pulavarty] > I need to upload data ( text & image data ) to a remote web > server from python. I came to know that i could do it using > ssh and scp.but am not sure of how to do it. Well, the only difference between "server" and "web server" is that the latter is guaranteed to be listening, probably on port 80, to HTTP requests. If you want to avoid CGI (and, I assume, any other web-interface means of transferring files) then you need to know what *other* services the remote server is running. ssh/scp is one possibility, FTP is another. There are others (rsync or WebDAV, for example). It all depends on what's on offer. If you know the server in question will accept an ssh connection, then one simple solution is to call scp (or pscp from the Putty suite if you're on Win32) from the command line to copy the files you want. If you want to do it from within Python, then you could use os.system or os.popen or one of its cousins to do the same. eg, scp my_local_file.txt [EMAIL PROTECTED]: If you only mean: "I know it's theoretically possible to copy files to servers using ssh/scp but I don't about this particular server" then you'll need to determine whether the server in question will accept ssh connections, and whether you have the right to create such a connection. Try the above, and see if it works. TJG This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk -- http://mail.python.org/mailman/listinfo/python-list
Looking for a high performance web server written in Python, and supports CGI/FastCGI
Basically I am trying to find a high performance web server. Since Python is installed on all of the servers, It'll be great if the web server is written in Python as well. Otherwise, I will have to install lighttpd or other web servers. Then the largest issue with Python-based web servers is performance. That's why I start to look into medusa or twisted-based servers. Twisted seems too big and complicated for what I really want to do and the original medusa web server only has very basic functionality. And I'd like the web server to have CGI/FastCGI and possible SCGI support for flexibility in application development. My applications here are really internal testing or data provider tools. Am I asking a lot? I think this is basic requirement for a web server these days :D What it looks like is that, although there seem to be many Python http servers available, there isn't really one that's simple, fast and feature-rich (cgi/fcgi/scgi) - I guess I am asking too much ;-p It seems that the only candidate that meetings the requirements but "written in Python" is lighttpd. Any recommendations? -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
On Thu, 6 Jul 2006 09:36:25 -0700, Jack <[EMAIL PROTECTED]> wrote: >Basically I am trying to find a high performance web server. Since >Python is installed on all of the servers, It'll be great if the web >server is written in Python as well. Otherwise, I will have to install >lighttpd or other web servers. > >Then the largest issue with Python-based web servers is performance. >That's why I start to look into medusa or twisted-based servers. Twisted >seems too big and complicated for what I really want to do and the >original medusa web server only has very basic functionality. Even though it may seem that way, it really isn't. Keep in mind that since you're only looking for a web server, 90% of Twisted won't even come into play for you. If you want, you can even install *only* the webserver (of course, unless you're on an embedded platform where disk space is at a premium there's not really much point). A bigger problem, I reckon, is that twisted.web doesn't support FastCGI and twisted.web2 is still a moving target. You haven't really said much about your requirements though. Perhaps if you describe them in more detail (for example, what does "high performance" mean to you?) someone can make a more useful recommendation. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
Jack wrote: > I will have to install lighttpd or other web servers. do that. If all you need is a webserver there's little reason to have it in python. Just use one of the several high quality open source webservers. -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
To be honest, I'm not sure what kind of performance I can get even with medusa or twisted. I assume it won't be as fast as servers written in C/C++ and use async sockets, but should be much better than multi-processed or multi-threaded servers in written in Python. Not sure if anyone else has an idea about medusa or twisted performance. Any chance that it's close to Apache? But even so, I guess I may still have to go with lighttpd for FastCGI/ CGI/SCGI support. > You haven't really said much about your requirements though. Perhaps > if you describe them in more detail (for example, what does "high > performance" mean to you?) someone can make a more useful recommendation. > > Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
>> I will have to install lighttpd or other web servers. > > do that. > > If all you need is a webserver there's little reason to have it in > python. Just use one of the several high quality open source webservers. lighttpd is a great web server. I just didn't want to bother download the source, configure, make and make install, and have a bunch of files installed into the system (The binaries are mostly not the latest version.) If a server can be set up with a few python files, it sounds like a cleaner approach :) lighttpd does have an option to make a monilithic build that has everything in one file but somehow I couldn't make the scons-based build work. (Any tips?) -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
>> I will have to install lighttpd or other web servers. > > do that. > > If all you need is a webserver there's little reason to have it in > python. Just use one of the several high quality open source webservers. If it is a Python web server, it would be nice to extend it by putting code right into the web server. The performance should be better than FastCGI because it removes the cost to send the requests/replies back and forth. -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
I just did some testing between CherryPy's web server and lighttpd. My test was very simple and I used ab.exe for this purpose. CherryPy web server can serve about 140 simple request / second, while lighttpd can handle around 400 concurrent requests. > You haven't really said much about your requirements though. Perhaps > if you describe them in more detail (for example, what does "high > performance" mean to you?) someone can make a more useful recommendation. > > Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
On 07/07/06, Jack <[EMAIL PROTECTED]> wrote: > I just did some testing between CherryPy's web server and lighttpd. > My test was very simple and I used ab.exe for this purpose. > CherryPy web server can serve about 140 simple request / second, while > lighttpd can handle around 400 concurrent requests. > > > You haven't really said much about your requirements though. Perhaps > > if you describe them in more detail (for example, what does "high > > performance" mean to you?) someone can make a more useful recommendation. > > Karrigell has an async server, in standalone mode it won't be as fast as lighttpd but its simpler to use and code in than cherrypy. However, it can also work behind lighttpd, so you might get a good mix of server speed and fast development time. http://www.karrigell.com HTH :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
Tim Williams wrote: > On 07/07/06, Jack <[EMAIL PROTECTED]> wrote: > > I just did some testing between CherryPy's web server and lighttpd. > > My test was very simple and I used ab.exe for this purpose. > > CherryPy web server can serve about 140 simple request / second, while > > lighttpd can handle around 400 concurrent requests. > > > > > You haven't really said much about your requirements though. Perhaps > > > if you describe them in more detail (for example, what does "high > > > performance" mean to you?) someone can make a more useful recommendation. > > > > > Karrigell has an async server, in standalone mode it won't be as fast > as lighttpd but its simpler to use and code in than cherrypy. > However, it can also work behind lighttpd, so you might get a good > mix of server speed and fast development time. > > http://www.karrigell.com > Yes, agree about Karrigell's quick development time - an almost flat learning curve if you've programmed for the web before, and none of the arcana which you can run into elsewhere. "high performance"? - I'm using it to provide an intranet for a small library with *three* networked computers - performance is impeccable! Gerard -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
On 7 Jul 2006 06:27:43 -0700, Gerard Flanagan <[EMAIL PROTECTED]> wrote: > > Tim Williams wrote: > > On 07/07/06, Jack <[EMAIL PROTECTED]> wrote: > > > I just did some testing between CherryPy's web server and lighttpd. > > > My test was very simple and I used ab.exe for this purpose. > > > CherryPy web server can serve about 140 simple request / second, while > > > lighttpd can handle around 400 concurrent requests. > > > > > > > You haven't really said much about your requirements though. Perhaps > > > > if you describe them in more detail (for example, what does "high > > > > performance" mean to you?) someone can make a more useful > > > > recommendation. > > > > > > > > Karrigell has an async server, in standalone mode it won't be as fast > > as lighttpd but its simpler to use and code in than cherrypy. > > However, it can also work behind lighttpd, so you might get a good > > mix of server speed and fast development time. > > > > http://www.karrigell.com > > > > Yes, agree about Karrigell's quick development time - an almost flat > learning curve if you've programmed for the web before, and none of the > arcana which you can run into elsewhere. > > "high performance"? - I'm using it to provide an intranet for a small > library with *three* networked computers - performance is impeccable! If you disable the Reverse-DNS lookups in one of the python (not Karrigell) web modules (I'll dig out a previous post somewhere about this), it speeds up karrigell tremendously, my apps aren't huge, but I have no problems with karrigell across the internet :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
I wrote the last posting at late late night and I didn't know what I was typing at that time ;-p I didn't mean the test with CherryPy was not concurrent connections, or the test with lighttpd was all concurrent connections. I actually tried both concurrent (-c in ab command line) and non-concurrent (without -c in ab command line) and I tried the threading and threadpooling in CherryPy. The result did not vary much. This article http://www.cherrypy.org/wiki/CherryPySpeed says CherryPy can process around 400-500 requests/second. It's set up is: Pentium M 1.6, 1G RAM, Windows XP2 laptop, test done with apache 2.0.41 ab. I have a slightly better hardware set up: Pentium M 1.7MHz, 1.5G RAM on Windows XP2 laptop, test done with Apache 2.2 ab However, I don't get even close. The best I get is around 140 requests/second. I'm using the same test script as the CherryPy test with slight modification just to make it run. As a matter of fact, the Cygwin build of lighttpd only gets around 430 requests/second for a 2-byte static file. I disabled firewall and antivirus on the box when tests were done. Any idea about the huge difference? It would be very interesting if some CherryPy (or python) users can post their performance benchmarks. Jack "Jack" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I just did some testing between CherryPy's web server and lighttpd. > My test was very simple and I used ab.exe for this purpose. > CherryPy web server can serve about 140 simple request / second, while > lighttpd can handle around 400 concurrent requests. > >> You haven't really said much about your requirements though. Perhaps >> if you describe them in more detail (for example, what does "high >> performance" mean to you?) someone can make a more useful recommendation. >> >> Jean-Paul > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
Jack wrote: > I wrote the last posting at late late night and I didn't know what I was > typing at that time ;-p > > I didn't mean the test with CherryPy was not concurrent > connections, or the test with lighttpd was all concurrent > connections. I actually tried both concurrent (-c in ab command line) > and non-concurrent (without -c in ab command line) and I tried > the threading and threadpooling in CherryPy. The result did not > vary much. > > This article http://www.cherrypy.org/wiki/CherryPySpeed says CherryPy > can process around 400-500 requests/second. It's set up is: > > Pentium M 1.6, 1G RAM, Windows XP2 laptop, test done with apache 2.0.41 > ab. > > I have a slightly better hardware set up: > > Pentium M 1.7MHz, 1.5G RAM on Windows XP2 laptop, test done with Apache > 2.2 ab > > However, I don't get even close. The best I get is around 140 > requests/second. I'm using the same test script as the CherryPy test > with slight modification just to make it run. As a matter of fact, > the Cygwin build of lighttpd only gets around 430 requests/second for > a 2-byte static file. I disabled firewall and antivirus on the box when > tests were done. Any idea about the huge difference? It would be very > interesting if some CherryPy (or python) users can post their performance > benchmarks. It would be good to know which version of CherryPy you are using. That wiki page is talking about the CP 2.0 branch; 2.1 and later are quite different. If you have a later version, try using cherrypy/test/benchmark.py Note also that you can use lighttpd as an HTTP server for CherryPy apps via FCGI/SCGI. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
> >> I will have to install lighttpd or other web servers. > If it is a Python web server, it would be nice to extend it by putting code > right into the web server. The performance should be better than FastCGI > because it removes the cost to send the requests/replies back and forth. you'll need to make a distinction between a webserver written in python (primary purpose to serve data) and a web framework that integrates python and allows you to generate said data with python as for the so called load test that you mention above, those "tests" are pointless and provide no insight whatsoever to the realistic behavior of the server ... unless of course all your users are expected to connect from the same machine while asking for the same 2 byte file at the maximum speed the system allows them to. -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
You are right. Load test can be complicated because of the various patterns of web applications and usages. The simple tests I mentioned and conducted just give myself some idea about the performance. Given the same set up, some numbers should be comparable and reveal some aspects on web servers' performance. They are by no means formal load tests, but they are helpful to me :-) "Istvan Albert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> >> I will have to install lighttpd or other web servers. > >> If it is a Python web server, it would be nice to extend it by putting >> code >> right into the web server. The performance should be better than FastCGI >> because it removes the cost to send the requests/replies back and forth. > > you'll need to make a distinction between a webserver written in python > (primary purpose to serve data) and a web framework that integrates > python and allows you to generate said data with python > > as for the so called load test that you mention above, those "tests" > are pointless and provide no insight whatsoever to the realistic > behavior of the server ... unless of course all your users are expected > to connect from the same machine while asking for the same 2 byte file > at the maximum speed the system allows them to. > -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
Just thought I'd mention it. As stated in some posts I put on the list in the last few days, I'm working on a FastCGI server for python. Of course its not as fast as lighttpd, but I think it still has many applications. I've currently got a *very* simple prototype, but I expect the finished module to subclass BaseHTTPRequestHandler and work similar to the CGIHTTPServer module. I'll let everyone know when its ready, and you can try it out if you like ;) -- mthorley -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
I'm using CherryPy 2.2.1. I just ran benchmark.py multiple times. The fastest it got is 195 req/sec, with 50 threads. Python was taking 50+% CPU when the test was running. > It would be good to know which version of CherryPy you are using. That > wiki page is talking about the CP 2.0 branch; 2.1 and later are quite > different. If you have a later version, try using > cherrypy/test/benchmark.py > > Note also that you can use lighttpd as an HTTP server for CherryPy apps > via FCGI/SCGI. -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI
Thanks Tim and Gerard for recommending karrigell. I just checked it out. It is indeed a nice package. However, I didn't find it easier to learn or use than CherryPy though. I read through CherryPy tutorials and have got a good idea how to use it. I also read Karrigell docs. The way Karrigell uses subpath behind CGI file name is a little strange to me. Nonetheless, Karrigell looks very nice to me but I may start with CherryPy. What's missing (according to my requirement/wishlist) is, as a web server, the build-in web server does not handle CGI or FastCGI apps, making python the only way to write apps... "Tim Williams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 07/07/06, Jack <[EMAIL PROTECTED]> wrote: >> I just did some testing between CherryPy's web server and lighttpd. >> My test was very simple and I used ab.exe for this purpose. >> CherryPy web server can serve about 140 simple request / second, while >> lighttpd can handle around 400 concurrent requests. >> >> > You haven't really said much about your requirements though. Perhaps >> > if you describe them in more detail (for example, what does "high >> > performance" mean to you?) someone can make a more useful >> > recommendation. >> > > > Karrigell has an async server, in standalone mode it won't be as fast > as lighttpd but its simpler to use and code in than cherrypy. > However, it can also work behind lighttpd, so you might get a good > mix of server speed and fast development time. > > http://www.karrigell.com > > HTH :) -- http://mail.python.org/mailman/listinfo/python-list