You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Rhoden <ja...@rhoden.id.au> on 2007/03/07 00:07:56 UTC

tomcat connector through cgi-bin?

Hi, Has anyone here ever had to use a cgi-bin directory to try and 
connect to tomcat? ie, some script that when run under cgi-bin, connects 
and forwards the info to tomcat? I cant find much on it, but it would be 
really handy. (Have a web server that i cant install a connector in!).

Best Regards,
Jacob

-- 
_________________________________________________
Jacob Rhoden
Application Architect
Systems Development and Integration
University of Melbourne

Phone: +61 3 8344 2884



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat connector through cgi-bin?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jacob,

Jacob Rhoden wrote:
> Anyway, In case anyone is interested, I have now written a perl
> script which [acts as an HTTP proxy to Tomcat]. So if anyone needs a
> "perl tomcat connector" send me an email. (:

Why not post it to the list. Then it will be in the archives and we can
all point to it when someone asks for this kind of thing.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF8Bi29CaO5/Lv0PARAgRHAJ9Mxp/vPrr9i8feAE8kPye6u2ELEwCgkuZ9
gVYw48cJEvUMwTcSMnB8rpc=
=bLbO
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat connector through cgi-bin?

Posted by Jacob Rhoden <ja...@rhoden.id.au>.
Pid wrote:
> I'd suggest getting a new webserver then: 1) hosting is cheap, 2) you 
> can configure the server to do what you really need it to do.
>
> There's little point in trying to force a cgi environment to forward 
> requests into Tomcat, if your server doesn't support it.
>
> It's a false economy if you spend more than the equivalent hosting 
> cost in your time trying to resolve this - not a really a good idea at 
> all.
>
I agree, that is the best option, and that is the most logical thing! 
However there are external issues which prevent this from happening 
right now *sigh*! I would like to work in a place where the 
cheapest/best thing is the thing that can be done!

Anyway, In case anyone is interested, I have now written a perl script 
which does exactly that. So if anyone needs a "perl tomcat connector" 
send me an email. (:

Best Regards,
Jacob

__________________________________________

Jacob Rhoden - http://www.jacobrhoden.com/


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat connector through cgi-bin?

Posted by Pid <p...@pidster.com>.
Jacob Rhoden wrote:
> Christopher Schultz wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Jacob,
>>
>> Jacob Rhoden wrote:
>>  
>>> Hi, Has anyone here ever had to use a cgi-bin directory to try and 
>>> connect to tomcat? ie, some script that when run under cgi-bin,
>>> connects and forwards the info to tomcat?
>>>     
>>
>> Ugh. This sounds miserable. ;)
>>
>>  
>>> I cant find much on it, but it would be really handy. (Have a web
>>> server that i cant install a connector in!).
>>>     
>>
>> Do you mean that you can't install something like mod_jk? Or, that you
>> can't use a Tomcat <connector> with a port number?
>>
>> You might be able to use proxying (possibly?) already available in your
>> web server to simply proxy requests to an HTTP connector running in
>> Tomcat. I think this would be cleaner than a cgi-bin->Tomcat hack.
>>
>> What is your environment? Perhaps we can come up with a better solution.
>>   
> Its a system where we have no permission on any files except user home 
> directories and the cgi-bin directory. So we can run tomcat as a 
> non-unprivileged user on a high port, but we need the ability to allow 
> files to be served through the apache web server on port 80.
> 
> So it has to be something we can install in the cgi-bin directory. In 
> the past we have had a perl script to simply make a connection to an app 
> server and pass the data through.


> There is a very large set of Perl scripts (that have grown to the point 
> where its inefficient and unmanageable) that I would like to start 
> rationalizing/organizing into a simpler Java app.

Sorry to be so negative, but I'd suggest getting a new webserver then: 
1) hosting is cheap, 2) you can configure the server to do what you 
really need it to do.

There's little point in trying to force a cgi environment to forward 
requests into Tomcat, if your server doesn't support it.

It's a false economy if you spend more than the equivalent hosting cost 
in your time trying to resolve this - not a really a good idea at all.

p

> Best Regards,
> Jacob
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat connector through cgi-bin?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jacob,

Jacob Rhoden wrote:
>> What is your environment? Perhaps we can come up with a better solution.
>>   
> Its a system where we have no permission on any files except user home
> directories and the cgi-bin directory. So we can run tomcat as a
> non-unprivileged user on a high port, but we need the ability to allow
> files to be served through the apache web server on port 80.

Hmm. And the system administrator cannot be convinced to add
configuration directives for your virtual host or anything like that? Hmm...

Do you have access to PHP? I think you might be able to get away with a
small PHP script that uses an HTTP include. I think that would be easier
than writing a Perl-based (or worse, C-based) CGI program.

> So it has to be something we can install in the cgi-bin directory. In
> the past we have had a perl script to simply make a connection to an app
> server and pass the data through.

Can you use that one? Or will it not work for Tomcat for some reason?

Using PHP, you should be able to use the HttpMessage
(http://php.net/manual/en/http.HttpRequest.php) object and stuff it with
cookies, headers, parameters, and the request body from the incoming
request. Make the request and stream the result.

Note that I've never tried this and so I could be completely wrong.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF7teH9CaO5/Lv0PARAkEkAKCP2XAZXdt7rFeIipMnLw3w2j1D/ACfadU9
uYc4R2TqzAZGR2igDXj7G/8=
=1MHZ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat connector through cgi-bin?

Posted by Jacob Rhoden <ja...@rhoden.id.au>.
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jacob,
>
> Jacob Rhoden wrote:
>   
>> Hi, Has anyone here ever had to use a cgi-bin directory to try and 
>> connect to tomcat? ie, some script that when run under cgi-bin,
>> connects and forwards the info to tomcat?
>>     
>
> Ugh. This sounds miserable. ;)
>
>   
>> I cant find much on it, but it would be really handy. (Have a web
>> server that i cant install a connector in!).
>>     
>
> Do you mean that you can't install something like mod_jk? Or, that you
> can't use a Tomcat <connector> with a port number?
>
> You might be able to use proxying (possibly?) already available in your
> web server to simply proxy requests to an HTTP connector running in
> Tomcat. I think this would be cleaner than a cgi-bin->Tomcat hack.
>
> What is your environment? Perhaps we can come up with a better solution.
>   
Its a system where we have no permission on any files except user home 
directories and the cgi-bin directory. So we can run tomcat as a 
non-unprivileged user on a high port, but we need the ability to allow 
files to be served through the apache web server on port 80.

So it has to be something we can install in the cgi-bin directory. In 
the past we have had a perl script to simply make a connection to an app 
server and pass the data through.

There is a very large set of Perl scripts (that have grown to the point 
where its inefficient and unmanageable) that I would like to start 
rationalizing/organizing into a simpler Java app.

Best Regards,
Jacob

-- 
__________________________________________
Jacob Rhoden - http://www.jacobrhoden.com/


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat connector through cgi-bin?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jacob,

Jacob Rhoden wrote:
> Hi, Has anyone here ever had to use a cgi-bin directory to try and 
> connect to tomcat? ie, some script that when run under cgi-bin,
> connects and forwards the info to tomcat?

Ugh. This sounds miserable. ;)

> I cant find much on it, but it would be really handy. (Have a web
> server that i cant install a connector in!).

Do you mean that you can't install something like mod_jk? Or, that you
can't use a Tomcat <connector> with a port number?

You might be able to use proxying (possibly?) already available in your
web server to simply proxy requests to an HTTP connector running in
Tomcat. I think this would be cleaner than a cgi-bin->Tomcat hack.

What is your environment? Perhaps we can come up with a better solution.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF7ftP9CaO5/Lv0PARAjvqAJ9Z1TGdv4OWenrd04g14ywvSGtIggCfSJc2
+ASJtwy/XJsR9Ta6Wrt6yN4=
=+63O
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org