[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

cgi scripts don't know hostname

mark.pelletier

9/19/2007 9:43:00 PM

Forgive me if this is a dumb question, but it's got me stumped.

I'm running a WEBrick server and I've mounted HTTPServlet::FileHandler
as follows:

s.mount("/cgi-bin",HTTPServlet::FileHandler,
cgi_dir,{:FancyIndexing=>true})

However, the scripts in the cgi-bin directory can't find the hostname
when they're run by the web server. E.g., the following script

#!/usr/bin/ruby -w

s = %{
<html>
<body>
Hi #{ENV['HOSTNAME']} Bye
</body>
</html>
}
print s

prints the html with the machine name embedded in it when I run it from
the command line, but only "Hi Bye" when I look at it in the browser.
What's up with that?
--
Posted via http://www.ruby-....

5 Answers

mark.pelletier

9/21/2007 3:16:00 PM

0

It turns out that the cgi scripts run this way have an empty or at least
incomplete ENV. I worked around it by marshaling the server's ENV and
having
the cgi's read it at startup. Not a great solution, but it works.

Mark Pelletier wrote:
> Forgive me if this is a dumb question, but it's got me stumped.
>
> I'm running a WEBrick server and I've mounted HTTPServlet::FileHandler
> as follows:
>
> s.mount("/cgi-bin",HTTPServlet::FileHandler,
> cgi_dir,{:FancyIndexing=>true})
>
> However, the scripts in the cgi-bin directory can't find the hostname
> when they're run by the web server. E.g., the following script
>
> #!/usr/bin/ruby -w
>
> s = %{
> <html>
> <body>
> Hi #{ENV['HOSTNAME']} Bye
> </body>
> </html>
> }
> print s
>
> prints the html with the machine name embedded in it when I run it from
> the command line, but only "Hi Bye" when I look at it in the browser.
> What's up with that?

--
Posted via http://www.ruby-....

retardsman

1/29/2011 8:57:00 PM

0

On Jan 29, 9:17 am, John Doe <j...@usenetlove.invalid> wrote:
> retardsman <remarksman yahoo.com> wrote:
> > John Doe <j...@usenetlove.invalid> wrote:
> >> The one-way media is whining about the Obama administration not
> >> doing enough to speak out for democracy in Egypt. Ha ha. Does
> >> the one-way media really think that all of those guys on the
> >> street (and they are all guys) who are throwing bricks are
> >> upset because they are not being ruled by a Clinton style
> >> feminist majority democracy? Of course, they are all mamas boys
> >> out there throwing bricks, they are just upset that their mamas
> >> don't have equal rights.
>
> >> The only reason Joseph "feminist warrior puppet" Biden and the
> >> rest of the Obama administration would be peevish about the
> >> issue is because they expect Egypt is heading for something
> >> entirely different than a United-States-friendly democracy.
>
> > joe's big sis used to beat and terrorize him as a kid
>
> > his psychological response as an adult to the helplessness and
> > rage he felt as a boy is being taken out -- both nationally and
> > internationally -- on innocent boys and men
>
> > 'cause we dare not stand up to females in america, dare we?
>
> > it was precisely this psychological profile that paved his v.p.
> > road
>
> >> And the one-way media thinks that the Internet is promoting
> >> democracy. I think they're in for a surprise.
>
> > feminism isnt killing the spread of democracy, feminism is
> > democracy
>
> > let's stop kidding each other: what we're spreading around the
> > world is a greedy, materialistic, hypocritical, authoritarian
> > matriarchy
>
> A democracy with only men being allowed to vote would preserve the
> family unit, that could be written into a Constitution. And who
> knows, maybe some developing country will do that.
> --
>
>
>

i'm afriad, john, that things have gone a bit too far for
"constitutional remedies"

developing countries would surely not be allowed to "develop"
thataway ... and i think you can guess who wouldnt allow it

good idea tho -- at least you recognize the seriousness of the problem

ray

None4U

1/30/2011 4:42:00 PM

0


"retardsman" <remarksman@yahoo.com> wrote in message
news:185c32ff-dd48-47a4-8759-55f523034523@y36g2000pra.googlegroups.com...
On Jan 28, 10:17 pm, John Doe <j...@usenetlove.invalid> wrote:
> The one-way media is whining about the Obama administration not
> doing enough to speak out for democracy in Egypt. Ha ha. Does the
> one-way media really think that all of those guys on the street
> (and they are all guys) who are throwing bricks are upset because
> they are not being ruled by a Clinton style feminist majority
> democracy? Of course, they are all mamas boys out there throwing
> bricks, they are just upset that their mamas don't have equal
> rights.
>
> The only reason Joseph "feminist warrior puppet" Biden and the
> rest of the Obama administration would be peevish about the issue
> is because they expect Egypt is heading for something entirely
> different than a United-States-friendly democracy.


joe's big sis used to beat and terrorize him as a kid

his psychological response as an adult to the helplessness and rage he
felt as a boy is being taken out -- both nationally and
internationally -- on innocent boys and men

'cause we dare not stand up to females in america, dare we?

it was precisely this psychological profile that paved his v.p. road
>
> And the one-way media thinks that the Internet is promoting
> democracy. I think they're in for a surprise.


feminism isnt killing the spread of democracy, feminism is democracy



Feminism is naziism. feminism is in denial that women want to stay home,
and have a husband family and kids.
feminism is using the gubment to force women to remain single and poor and
gubment dependant.



None4U

1/30/2011 4:43:00 PM

0


"retardsman" <remarksman@yahoo.com> wrote in message
news:d3678eb2-98e6-4f04-b464-ede202f110df@m20g2000prc.googlegroups.com...
On Jan 29, 9:17 am, John Doe <j...@usenetlove.invalid> wrote:
> retardsman <remarksman yahoo.com> wrote:
> > John Doe <j...@usenetlove.invalid> wrote:
> >> The one-way media is whining about the Obama administration not
> >> doing enough to speak out for democracy in Egypt. Ha ha. Does
> >> the one-way media really think that all of those guys on the
> >> street (and they are all guys) who are throwing bricks are
> >> upset because they are not being ruled by a Clinton style
> >> feminist majority democracy? Of course, they are all mamas boys
> >> out there throwing bricks, they are just upset that their mamas
> >> don't have equal rights.
>
> >> The only reason Joseph "feminist warrior puppet" Biden and the
> >> rest of the Obama administration would be peevish about the
> >> issue is because they expect Egypt is heading for something
> >> entirely different than a United-States-friendly democracy.
>
> > joe's big sis used to beat and terrorize him as a kid
>
> > his psychological response as an adult to the helplessness and
> > rage he felt as a boy is being taken out -- both nationally and
> > internationally -- on innocent boys and men
>
> > 'cause we dare not stand up to females in america, dare we?
>
> > it was precisely this psychological profile that paved his v.p.
> > road
>
> >> And the one-way media thinks that the Internet is promoting
> >> democracy. I think they're in for a surprise.
>
> > feminism isnt killing the spread of democracy, feminism is
> > democracy
>
> > let's stop kidding each other: what we're spreading around the
> > world is a greedy, materialistic, hypocritical, authoritarian
> > matriarchy
>
> A democracy with only men being allowed to vote would preserve the
> family unit, that could be written into a Constitution. And who
> knows, maybe some developing country will do that.
> --
>
>
>

i'm afriad, john, that things have gone a bit too far for
"constitutional remedies"

No they havnt. You forgot the Constitutional remedy to shoot all the Commie
traitors.


retardsman

1/31/2011 5:47:00 AM

0

On Jan 30, 8:43 am, "DogDiesel" <nos...@nospam.none> wrote:
> "retardsman" <remarks...@yahoo.com> wrote in message
>
> news:d3678eb2-98e6-4f04-b464-ede202f110df@m20g2000prc.googlegroups.com...
> On Jan 29, 9:17 am, John Doe <j...@usenetlove.invalid> wrote:
>
>
>
>
>
> > retardsman <remarksman yahoo.com> wrote:
> > > John Doe <j...@usenetlove.invalid> wrote:
> > >> The one-way media is whining about the Obama administration not
> > >> doing enough to speak out for democracy in Egypt. Ha ha. Does
> > >> the one-way media really think that all of those guys on the
> > >> street (and they are all guys) who are throwing bricks are
> > >> upset because they are not being ruled by a Clinton style
> > >> feminist majority democracy? Of course, they are all mamas boys
> > >> out there throwing bricks, they are just upset that their mamas
> > >> don't have equal rights.
>
> > >> The only reason Joseph "feminist warrior puppet" Biden and the
> > >> rest of the Obama administration would be peevish about the
> > >> issue is because they expect Egypt is heading for something
> > >> entirely different than a United-States-friendly democracy.
>
> > > joe's big sis used to beat and terrorize him as a kid
>
> > > his psychological response as an adult to the helplessness and
> > > rage he felt as a boy is being taken out -- both nationally and
> > > internationally -- on innocent boys and men
>
> > > 'cause we dare not stand up to females in america, dare we?
>
> > > it was precisely this psychological profile that paved his v.p.
> > > road
>
> > >> And the one-way media thinks that the Internet is promoting
> > >> democracy. I think they're in for a surprise.
>
> > > feminism isnt killing the spread of democracy, feminism is
> > > democracy
>
> > > let's stop kidding each other: what we're spreading around the
> > > world is a greedy, materialistic, hypocritical, authoritarian
> > > matriarchy
>
> > A democracy with only men being allowed to vote would preserve the
> > family unit, that could be written into a Constitution. And who
> > knows, maybe some developing country will do that.
> > --
>
> i'm afriad, john, that things have gone a bit too far for
> "constitutional remedies"
>
> No they havnt. You forgot the Constitutional remedy to shoot all the Commie
> traitors.- Hide quoted text -
>
> - Show quoted text -

i let god handle the violence

he's so much more thorough