[Wed Apr 19 20:45:32 2006] [error] [client 68.170.0.35] fopen: Permission denied[Wed Apr 19 20:45:32 2006] [error] [client 68.170.0.35] Premature end of script headers: debug.cgi
Now, if I add -w or -d to the perl statement it works fine, but I get a hell of a lot of messages generated.
As far as the permissions, I can't find a file under /calendarscript which are not set to 777, file extensions were changed to .cgi
When I run debug.cgi with -w I get the Success! message.
thanks in advance,
mike
How did you install it and what permissions are allowed on your server? 777 is not allowed on many servers as it can be a security concern.
On every server I've installed, only the .pl (in your case .cgi) files and their directory needed to be chmod to 755. All the rest only 666.
** if I add -w or -d to the perl statement it works fine, but I get a hell of a lot of messages generated **
For the -w that is to be expected as it is telling Perl to display warnings which is usually only useful during script development. What does your host's CGI FAQs say to use as the shebang?
Dan O.
------------------
[Thu Apr 20 04:05:54 2006] [error] [client 207.46.98.131] File does not exist: /usr/local/plesk/apache/vhosts/kta-hike.org/httpdocs/robots.txt[Thu Apr 20 04:05:54 2006] [error] [client 207.46.98.131] File does not exist: /usr/local/plesk/apache/vhosts/kta-hike.org/httpdocs/mid.htm
I don't see anything in your docs about these two files.
- debug.cgi works fine, no errors reported- I can launch calendar_admin.cgi and perform most functions, the only one which I tried but could not get to work was "View Calendar" -- I did not try adding events- I can create users and calendars- I can maintain calendar preferences
What does not work:
- "View calendar" from calendar_admin.cgi- calendar.cgi
both return the following errors:
[Thu Apr 20 09:57:48 2006] [error] [client 12.46.238.11] failed to open log file /var/log/httpd/suexec_log, referer: http://kta-hike.org/cgi-bin/calendar_admin.cgi
[Thu Apr 20 09:57:48 2006] [error] [client 12.46.238.11] fopen: Permission denied, referer: http://kta-hike.org/cgi-bin/calendar_admin.cgi
[Thu Apr 20 09:57:48 2006] [error] [client 12.46.238.11] Premature end of script headers: calendar.cgi, referer: http://kta-hike.org/cgi-bin/calendar_admin.cgi
I'm afraid all the message means is the script failed to run but says nothing about why. You (or your host's support) could try running the script from the command line (telnet, SSH, etc.) to see what error(s) Perl reports.
I ran the script with the -t option, this is what I see:
[Thu Apr 20 14:22:04 2006] [error] [client 12.46.238.11] Insecure dependency in require while running with -t switch at calendar.cgi line 40.
[Thu Apr 20 14:22:04 2006] [error] [client 12.46.238.11] Insecure dependency in eval while running with -t switch at /usr/local/plesk/apache/vhosts/kta-hike.org/cgi-bin/calendarscript/lib/asp.inc line 9.
[Thu Apr 20 14:22:04 2006] [error] [client 12.46.238.11] Insecure dependency in open while running with -t switch at /usr/local/plesk/apache/vhosts/kta-hike.org/cgi-bin/calendarscript/lib/CGISession.inc line 126.
Looking at line 126 in CGISession.inc:
sub saveSession { my ($self) = shift; if ($self->isValid()) { delete $self->{"_isnew"}; my ($filename) = $self->fileName(); open(OUT,"> $filename") | | &FATALERROR("Session file [".$self->fileName()."] could not be opened for writing!"); foreach $name (keys %$self) { print OUT "$name=".$self->{$name}."\n"; } close(OUT); } }
I have tested all of the functions under calendar_admin.cgi and, with the exception of "view calendar" everything works fine. Is this of any help?
Also, I don't see the error message that the function should return if there is an error (FATALERROR), where (or how) could I see that?
[This message has been edited by mdlipay (edited April 20, 2006).]
Doesn't help.
** Insecure dependency in require... **
Those are just warning and should not affect running of the script.
** I have tested all of the functions under calendar_admin.cgi and, with the exception of "view calendar" everything works fine. Is this of any help? **
No, other than knowing for sure that calendar_admin.cgi isn't the problem.
Do you have shell access to be able to run the calendar.cgi file (without any -t -w flags/switches) directly to see what error(s) Perl reports??
Can't open perl script "\r": No such file or directory.Use -S to search $PATH for it.
But they should be able to.
How about SSH or SSH2?
** This is what I get without the -t - Can't open perl script "\r": **
Sorry, I have no idea what that might be referring to.
I can't see there being anying in the script's code which could be responsible if the administration script works. Have you tired re-uploading a fresh copy of that script. Maybe it got corrupted in the initial upload?
Thinking the $BASE may need to be populated, does this look correct:
$BASE_DIR = "/usr/local/plesk/apache/vhosts/kta-hike.org/cgi-bin/calendarscript/";
But even if so, if the $BASE_DIR variable needed to be set, it would be needed in all 3 of the .pl files, not just the calendar.pl file... which is apparently not the case since you say the other scripts run.
JFYI
./calendar.cgi: line 10: BEGIN: command not found./calendar.cgi: line 13: =: command not found./calendar.cgi: line 17: syntax error near unexpected token `{'./calendar.cgi: line 17: ` if ($BASE_DIR ne "") { $BASE_DIR =~ s|([^/])$|$1/|; }'
Here is the beginning of the script:
#!/usr/bin/perl## CalendarScript# Version: 3.21## Copyright 2003 Scott# http://www.CalendarScript.com/ #
BEGIN { # CHANGE THE LINE BELOW IF NECESSARY # Be sure to remove the # before $BASE_DIR, and change the path between the quotes $BASE_DIR = "/usr/local/plesk/apache/vhosts/kta-hike.org/cgi-bin/calendarscript/";
# DO NOT CHANGE ANYTHING BELOW HERE!
if ($BASE_DIR ne "") { $BASE_DIR =~ s|([^/])$|$1/|; } else { my ($path) = $ENV{'PATH_TRANSLATED'} | | $ENV{'SCRIPT_FILENAME'}; unless ($path) { print "Content-type:text/html\n\n<B>ERROR:</B><BR>Your server does not provide the PATH_TRANSLATED or SCRIPT_FILENAME environment variables.<br><br>Please see the installation documentation for how to set the \$BASE_DIR variable manually."; exit(0); } $path =~ s|[^/\\]*$| |; $path =~ s|([^/])$|$1/|; $BASE_DIR = $path . "calendarscript/"; }
I was just re-reading your comment above, and the install instructions. The instructions say:
"In some situations, web hosts do not allow files in or under the cgi-bin to be chmod 777, for security reasons. These are often situations where the scripts run as your own user ID, not as a user like 'nobody'. If you verify with your web host that this is the case for your site, then you should CHMOD 744 the 'calendarscript' directory and all files under it."
This is what I did; however, your comments above state to CHMOD 666. which is correct???
I don't know why that would be, it used in the calendar_admin.pl file too! Maybe check all lines above that one for problems.
** ./calendar.cgi: line 13: =: command not found **
I don't know where that's coming from if what you've posted of your file is correct.
** ./calendar.cgi: line 17: syntax error near unexpected token `{' **
Again, I don't know what would be causing such an error message besides an error in one of the preceding lines...if what you've posted of your file is correct.
** your comments above state to CHMOD 666. **
666 is both read and write permissions (which is what the scripts need to read and write to files) but not execute permissions (which can be the security problem). If the script runs Ok under just 744 than great! Every server is different, check your host's CGI FAQ's for what is acceptable on their servers.