KirkGray
asked on
Can Server side executables by Unix/Linux Scritps?
I'm new to programming for the web, but not to unix. My question is: Can I delploy a server side executable that is just a list of unix commands (like a batch file) that users can hit from their browser?
I want a Web address that points to a server side executable that sends some mail, then outputs some html in finishing. What I've currently got in this script is:
mail -s "a subject" anaddress@anywhere.com < MailMessage.txt
cat testpage.html
When I run this from the telnet prompt it sends the mail and outputs the correct html. When I hit it from my browser it gives my an internal server error. Bummer ;-(
What am I doing wrong? Can U use a Unix script for server side processing? How do I get the browser to tell the server to execute my script rather than display it?
PS: I've already chmod'ed it to 755, so it is executable.
Thanx in advance,
I want a Web address that points to a server side executable that sends some mail, then outputs some html in finishing. What I've currently got in this script is:
mail -s "a subject" anaddress@anywhere.com < MailMessage.txt
cat testpage.html
When I run this from the telnet prompt it sends the mail and outputs the correct html. When I hit it from my browser it gives my an internal server error. Bummer ;-(
What am I doing wrong? Can U use a Unix script for server side processing? How do I get the browser to tell the server to execute my script rather than display it?
PS: I've already chmod'ed it to 755, so it is executable.
Thanx in advance,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx man, the points are all yours!
Please also note that besides writing the CGI script, you may also need to do some config on the web server so that it know it is a CGI, bot a normal html file. The exact config depends on the server. In most cases, you need to set a directory to be "CGI directory" or set the file extension to be recognized as CGI. Check this with your web master.