473,799 Members | 3,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cgi relay for python cgi script

Hi,

Is there an easy way to execute a python cgi script on a different
machine from the cgi server?

I could write my own server, but I was wondering if something is
available that would allow me to use a cgi script as is without
modification.

Amir

Oct 4 '05 #1
7 1724
Amir Michail wrote:
Is there an easy way to execute a python cgi script on a different
machine from the cgi server?


http://www.google.com/search?q=reverse+proxy

</F>

Oct 4 '05 #2
Fredrik Lundh wrote:
Amir Michail wrote:
Is there an easy way to execute a python cgi script on a different
machine from the cgi server?


http://www.google.com/search?q=reverse+proxy

</F>


Is there an easy way to do this without modifying the configuration of
the cgi server and without running a cgi server on the other machine
where the script will actually run?

Perhaps someone wrote a simple server that provides the required
environment for the cgi script to run?

I'm looking for something simple that does not require root access.

Amir

Oct 4 '05 #3
Amir Michail wrote:
Is there an easy way to do this without modifying the configuration of
the cgi server and without running a cgi server on the other machine
where the script will actually run?

Perhaps someone wrote a simple server that provides the required
environment for the cgi script to run?

I'm looking for something simple that does not require root access.


you could of course use something like

http://docs.python.org/lib/module-CGIHTTPServer.html

or some other light-weight web server, but you should probably have in mind
that doing things like this without coordinating with your server administrators
and security architects *before* you start tinkering can be a excellent way to
get fired...

</F>

Oct 4 '05 #4
Fredrik Lundh wrote:
Amir Michail wrote:
Is there an easy way to do this without modifying the configuration of
the cgi server and without running a cgi server on the other machine
where the script will actually run?

Perhaps someone wrote a simple server that provides the required
environment for the cgi script to run?

I'm looking for something simple that does not require root access.


you could of course use something like

http://docs.python.org/lib/module-CGIHTTPServer.html

or some other light-weight web server, but you should probably have in mind
that doing things like this without coordinating with your server administrators
and security architects *before* you start tinkering can be a excellent way to
get fired...

</F>


I would like to do this to improve performance by avoiding nfs. (The
required data is not on the cgi server.)

The advice I got was to use something like MySQL with a client/server
architecture.

However, I thought it would be easier to simply run the core part of
the script off the cgi server, thereby avoiding nfs for data lookups.

So I guess the point is that such a solution is more likely to be a
security risk than MySQL?

Amir

Oct 4 '05 #5
Amir Michail wrote:
Fredrik Lundh wrote:
Amir Michail wrote:

Is there an easy way to do this without modifying the configuration of
the cgi server and without running a cgi server on the other machine
where the script will actually run?

Perhaps someone wrote a simple server that provides the required
environmen t for the cgi script to run?

I'm looking for something simple that does not require root access.


you could of course use something like

http://docs.python.org/lib/module-CGIHTTPServer.html

or some other light-weight web server, but you should probably have in mind
that doing things like this without coordinating with your server administrators
and security architects *before* you start tinkering can be a excellent way to
get fired...

</F>

I would like to do this to improve performance by avoiding nfs. (The
required data is not on the cgi server.)

The advice I got was to use something like MySQL with a client/server
architecture.

However, I thought it would be easier to simply run the core part of
the script off the cgi server, thereby avoiding nfs for data lookups.

So I guess the point is that such a solution is more likely to be a
security risk than MySQL?

Amir

You are hardly likely to improve performance by substituting a fairly
high-level application like CGI or MySQL for NFS. But later you suggest
that security is the issue rather than performance. I'm confused.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Oct 4 '05 #6
"Amir Michail" <am******@gmail .com> writes:
Is there an easy way to execute a python cgi script on a different
machine from the cgi server?


What exactly do you mean by that? You can set a form target to
another machine, if that's what you mean.
Oct 4 '05 #7
On Oct 4, 2005, at 2:35 AM, Amir Michail wrote:
Is there an easy way to execute a python cgi script on a different
machine from the cgi server?

I could write my own server, but I was wondering if something is
available that would allow me to use a cgi script as is without
modification.


What I would try: Set up an SSH account for the CGI to run as on the
other machine, and set up a passwordless SSH public/private key pair.
Store the private key on the web server under the account used to run
CGI programs.

Then write a small "stub" CGI that runs the other CGI via SSH. Not sure
how environment variables will need to be transferred - SSH may have a
way to set environment, or you may need a stub on both ends, or just
build a SSH invocation that runs 'env' on the remote system. Your stub
could be as simple as:

#!/bin/sh
ssh us**@cgi.host.c om /usr/bin/env HTTP_HOST="$HTT P_HOST"
OTHER_ENV_VARS /my/cgi/script "$@"

Depending on your security needs, you may need to do things with
alternate shells for the CGI user account, etc., but that can be done.
And it will probably also need some input sanitization, etc. so you
aren't executing arbitrary commands.

-Michael

Oct 4 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
9095
by: Tomas Christiansen | last post by:
Im trying to make a simple TCP socket "relay" or "proxy", but my skills in Python are not high (yet). The only thing it should do, is to open the connection on behalf of the client, and when the client closes the connection, it should do so too. It's going to "relay" PCL and/or PostScript printjobs to a TCP/IP printer. Does anyone have some sugggestions on code-examples? I've tried googling around, but couldn'r find anythin usefull.
0
1339
by: JP | last post by:
I have been at odds with our network guy over an application that is designed to send alert emails to accounts outside of our domain to users. The issue is the mail server is not set for "open relay" so any Mail.Send() that is to an account outside of our domain server gets rejected by the SMTP. Any accounts inside the domain get sent properly. System.Web.HttpException: Could not access 'CDO.Message' object. --->...
2
1444
by: Jinsong Liu | last post by:
I need to using System.Web.Mail to send out notifications from my ASP.NET application. Based on what I know, a relay enabled SMTP server is required. Is there any way I can use a SMTP server which has relay disabled? thanks
8
3554
by: D | last post by:
Hi all .. how could one test to see if an open relay exists on a specific email server?
1
5814
by: Martin Pöpping | last post by:
Hello, I´m having a problem with the mail-method. It throws me an exeption and says: Mailbox unavailable. The server response was: 5.7.1 Unable to relay I´ve changed the server properties like it was described in: http://codebetter.com/blogs/peter.van.ooijen/archive/2006/04/05/142331.aspx
1
5718
by: Benedict Verheyen | last post by:
Hi, i get an "Unable to relay for" when trying to send an email from within my network to an email address not on my domain. I don't understand why it says "relaying" as i'm sending from an internal domain user to an external user. Email server is exchange 2003 See this trace
5
6658
by: Carmine [www.thetotalsite.it] | last post by:
Hi everyone, I get a really odd error while using SMTPClient.Send() function in ASP.Net. The error is the following: Dim smtp As New Net.Mail.SmtpClient("smtp.thetotalsite.it", 25) Dim bodyMSG As String bodyMSG = "something" smtp.Send("something@thetotalsite.it", someone@gmail.com, "Message from thetotalsite", bodyMSG)
1
3796
by: tshad | last post by:
I have a W2K3 Server we are setting up to run a Windows Service for a client at their location. I don't want this machine to go through exchange or their local mail server, I just want the Server to send out a message from the SMTP Virtual Server to me (in a different company) to tell me that some exception has happened in our service. The problem is that it creates an error about a relay: Exception Type:...
0
2294
by: varunrap | last post by:
When using SMTP to send mail in python, I get "Relay Access Denied" for a few email IDs I am trying to send an email to and "Helo command rejected: You are not a member of " for a few others. The general error message is "SMTPRecipientsRefused(senderrs)" For security reasons, cannot put in email IDs but this is what the error message looks like. SMTPRecipientsRefused: { u'ID1@email.com\r': (554,'<Email Server>: Helo command rejected:...
0
10488
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10029
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6808
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.