Scour on the Internet, how to set up a cgi script. Found only what needs to be changed CHMOD . But where and how, it was not possible to find ... here I study at school where there is a terminal class with computers. We have a page on the school website where we can test our scripts. Is this setting operation done on the server? This is the first question. And if not, how to do it in a terminal class?
2 answers
Is this setting operation done on the server?
Yes, the scripts are on the server and access rights are set in the same place (chmod \ chown)
and if not, how to do it in a terminal class?
In windows or linux class? In the first version, nothing at all is necessary. In the second one, also change chmod \ chown to such as is customary in the settings of your web server.
- There linux. Although there is a cgi-bin folder on the computer where we drop scripts. And where do you need to change chmod / chown parameters? - Dikaz
- Although it is there on the computer - is it on the server? Then you need to connect there using ssh and set permissions. Do not be surprised that this is all done automatically with you \\ transparently ie. all you have to do is put the script in the cgi-bin folder. Or does it not work that way? What mistake? 500 Internal Server Error? )) - Anton Shevtsov
- doesn't work that way .... 500th error - Dikaz
- 1. check for errors in the perl -c file filename.cgi 2. if there are no errors, make sure that the correct headers are sent ie before the first output (print), there must be correct headers (print "Content-type: text / html \ n \ n") 3. Make sure that the modules are used (use ...) that is on the server 4. if the first three points are fulfilled, then we should just ask the local administrator \\ teacher ps to add to the beginning use CGI :: Carp qw (fatalsToBrowser); to see errors in the browser - Anton Shevtsov
- Thank you ... for your attention .... I will try to do everything right.) - Dikaz
- Put the script in the
cgi-binor whatever folder you have for cgi-scripts. - chmod a + x filename
- perl -c filename, if errors come out - correct the code
- Try through the browser
Another browser has a log in which errors will pour. Being on the server via ssh, look in the Apache config (httpd.conf) "ErrorLog", there will be a log file name nearby. Or ask the server admin where the error log of Apache is. He must understand.
See what is written there at the time of the script call through the browser.
- All thanks turned out ... - Dikaz