Need help with cgi and so on

Hello all, i`m new here and new in programming with cgi. But i need it for my running project. I`ve googled half a week with no success.

All i need is to run an .sh-file via cgi.

My file is stored in /home/bots/

but if i try

#!/bin/sh

echo 'Content-type: text/html'
echo

echo '<html>'
echo '<body>'
echo '<center><h1>'

/home/bots/logout.sh

echo '</h1></center>'
echo '</body>'
echo '</html>'

i get an error message. In the logout.sh i make some stuff with screen and i get the message:
No screen session found.

But i`m sure there is running a session.
if i log in into the shell all is working fine.

What web server and version are you running? What platform? Linux? Solaris? Windows XP?

There might be a screen session for your user, but is there one for the user the web server is running as? Remember, a user isn't allowed to access the sessions of any other user.

Have running an

Apache/2.2.8 (Linux/SUSE).

is it possible to login as the user the screen is running at with cgi-script?

Normally with Apache server you must configure the CGI directives and directory. There are rules where the CGI directory can reside.

My first guess is that you have not configured Apache correctly to run CGI scripts and that you can't run CGI in your /home/bots/ directory.

Take a look at this page from Apache, Configuring Apache to permit CGI.

Ok, done all but no success.
I would make all new if someone can give me step by step instructions.
All i wanne do is to run an .exe-file in an screen session.
start it with:

mono my.exe

This programm should run in an screen - session.
And now i want to send commands to this programm.
The commands should come from web.
:frowning:

---------- Post updated at 01:44 PM ---------- Previous update was at 07:50 AM ----------

Ok, forget my previos post.

I have played a litte and found something that makes me wonder.

My logut.cgi

#!/bin/sh

echo 'Content-type: text/html'
echo

echo '<html>'
echo '<body>'
echo '<center><h1>'


sudo -u username /home/bots/logout.sh

echo '</h1></center>'
echo '</body>'
echo '</html>'

And i edited the sudoers like:

username   ALL=(ALL) NOPASSWD: /home/bots/logout.sh

If i check the error_log i find:

[Sun Nov 01 17:13:25 2009] [error] [client ***.***.***.***] usernames's password:

Where is here the problem? I think the path is right.