Re: running cygwin bash scripts from apache

2006-08-06 Thread Robert Mark Bram
Thank you Rene and Max for your replies.

Rene's response did the trick:

 Did you put the script in Apache's cgi-bin directory? 

Once I put it there, the script works ok. Much to my relief.

Thanks for the tip that I can configure Apache to run scripts from other places
to - that might come in handy later.

 Are you using the Apache packaged with Cygwin, or some other 
 Windows Apache? And, what version of Apache?

Max, I have Apache 2.0.55 for Windows installed - I thought I needed the Cygwin
version, but it turns out the Windows version is still ok to run Bash scripts as
long as it has the right shebang line.

Thank you both!

Rob
:)



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



running cygwin bash scripts from apache

2006-08-05 Thread Robert Mark Bram
Hi All,

I have Apache and Cygwin. I would like to run bash scripts from Apache, but am
unsure as to how to do it. Do I need to configure Apache for this at all?

I have seen some posts on the newsgroups that suggest I just need to have a
script that references bash through the shebang line. This is what I tried:

#!C:/cygwin/bin/bash.exe

echo -e Content-type: text/html\n\n
echo html
echo body
echo ==test==
echo /body
echo /html

All I get is the whole script displayed in my browser.

Could this be something to do with line endings? Do I have to specify some other
path for bash or configure Apach somehow?

Any advice would be most appreciated!

Rob
:)


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: running cygwin bash scripts from apache

2006-08-05 Thread Max Bowsher
Robert Mark Bram wrote:
 Hi All,
 
 I have Apache and Cygwin. I would like to run bash scripts from Apache, but am
 unsure as to how to do it. Do I need to configure Apache for this at all?
 
 I have seen some posts on the newsgroups that suggest I just need to have a
 script that references bash through the shebang line. This is what I tried:
 
 #!C:/cygwin/bin/bash.exe
 
 echo -e Content-type: text/html\n\n
 echo html
 echo body
 echo ==test==
 echo /body
 echo /html
 
 All I get is the whole script displayed in my browser.
 
 Could this be something to do with line endings? Do I have to specify some 
 other
 path for bash or configure Apach somehow?
 
 Any advice would be most appreciated!


Are you using the Apache packaged with Cygwin, or some other Windows
Apache? And, what version of Apache?

Max.



signature.asc
Description: OpenPGP digital signature


Re: running cygwin bash scripts from apache

2006-08-05 Thread René Berber
Robert Mark Bram wrote:

 I have Apache and Cygwin. I would like to run bash scripts from Apache, but am
 unsure as to how to do it. Do I need to configure Apache for this at all?
 
 I have seen some posts on the newsgroups that suggest I just need to have a
 script that references bash through the shebang line. This is what I tried:
 
 #!C:/cygwin/bin/bash.exe

Have you tried posix paths? i.e.
#!/bin/bash

 echo -e Content-type: text/html\n\n
 echo html
 echo body
 echo ==test==
 echo /body
 echo /html
 
 All I get is the whole script displayed in my browser.

Did you put the script in Apache's cgi-bin directory? or is Apache configured to
run scripts in the directory you used?

 Could this be something to do with line endings? Do I have to specify some 
 other
 path for bash or configure Apach somehow?

The above, no.  But you'll have those problems too unless you use something 
like:

echo -e whatever\r\n

 Any advice would be most appreciated!

Look at the samples that Apache installs (in its cgi-bin directory), I think
there is one shell script, one perl script and maybe other.
-- 
René Berber


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/