Perl script for website won't work
Hey all, I am using red hat 9. I have put a web site up on the computer and have created a form for people to submit, but when they click the submit key it just displays the perl script. If you would like to see it for yourself, go to www.stlukesserviceleague.org and click on student programs and then click on apply now. That will bring you to the form. Then when you click on submit, it will just show you the script without running it. Anyway, this is my first time ever creating script so what am I doing wrong? Thanx you guys always help a ton.
|
Your server might not be configured for cgi. Did you make sure to place your cgi files in the proper directory? Try to write another simple script and see if the same thing happens.
|
Hey all, I think I may have this one figured out. Thank you.
|
So, please tell, so that others might find the answer...
titanium_geek |
Sure, that is a good idea. Ok with red hat 9, apache is set up for it's default document folder to be in /var/www/html/ however the script folder is /var/www/cgi-bin/ so if one was to put a form in a folder like /var/www/html/application/ then in that html form they could not specify the action relative to the site or documents such as what i was trying to do in telling the html that my script was in ../../cgi-bin. I read up on this a bit and found out about folder aliasing which I had no idea about. Basically it is a way of pretending that an important folder (such as a scripts folder like cgi-bin) is already in /var/www/html/ when it really isn't) Anyway, the way I fixed this was to mark that folder (cgi-bin) to process the allow list before the deny list and the allow list was open to all. Then is the html form, I changed the action to point to an absolute url like http://www.stlukesserviceleague.org/...volunteer.cgi. This worked even though there is no real folder named cgi-bin in /var/www/html/. That address (stlukesserviceleague.org/cgi-bin/) actually points to /var/www/cgi-bin/. I am sure i'm not the best at explaining this so if anyone has anyquestions just reply to this post as it send me an email when you do.
|
The main difference is that the cgi-bin has the "ExecCGI" option set - this tells apache that it should execute scripts within that directory. This can be done for any folder by adding ExecCGI to the Options directive for that folder.
You may also be able to do this using .htaccess files but this again will depend on the AllowOveride directive within httpd.conf |
All times are GMT -5. The time now is 01:06 AM. |