CGI script to view log files
I'm trying to get a basic perl script to view some log files over the web for some users. For starters, I have this:
Code:
#!/usr/bin/perl -twantrd |
Print <PRE> tags around your log file:
Code:
print "<PRE>\n"; |
Ahhh, thanks!
I have one more question. I'm trying to setup a simple cgi script in perl that will scp some files when it's being called on via the web. For example, http://serverA/cgi-bin/scp.pl, will then run my perl script. The code is simple: Code:
#!/usr/bin/perl -twantrd |
I'm a bit confused about that last post. The link that you posted seems to point to a holding URL that is for sale. That aside, are you saying that you have one script calling another script? Also, I'm confused about your reference to running a bash script and seeing output on your console. If you run a script that writes to standard output as a CGI, the standard output goes to the HTTP socket that is opened by the HTTP server. That's the whole essence of how CGI works. There are some differences between the contexts of running any script, bash, perl, whatever, as an ordinary user from the commandline, and as the user that the web server runs as in the CGI context. One difference is the permissions normally assigned to the cgi-bin directory. As a CGI, your script is trying to write to the cgi-bin directory, which the web server should not have write access to (a fundamental security issue).
Please clarify what you are seeing (or not seeing), in both the test and production situations. --- rod. |
Okay, re-examining your question, I think I see what you may be questioning. You are printing the first line of the HTTP header, but the rest of the HTML is missing. You should probably create a proper HTML page with the <html> <head></head> <body> </body> </html> components. Some confirmation message in the body would be good, too.
I assume you have arranged ssh keys to permit paswordless secure copies. --- rod. |
All times are GMT -5. The time now is 09:30 AM. |