M
Mark Pelletier
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?
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?