[ Contents | << Previous | Next >> ]


Trouble Shooting

Here are some possible problems, and what you might check to fix them. Every server is setup somewhat different, so it is impossible to anticipate all problems.

When relevant, where the error shows up--in a web browser, the Apache logs, or when run on the command line--is in [brackets].


Scripts Do Not Run

Forbidden [Web browser]
Options ExecCGI is off in this directory: /home/httpd/html/calendar2/month.pl [Apache log]

The directory where the CGI scripts are installed is not setup as a CGI directory. Ask your system admin where to put CGI scripts. It should be a ScriptAliased directory.

The browser downloads the Perl script, rather than running it.

The directory is not ScriptAliased; see above.

(Nor does .pl have a CGI handler, but I strongly recommend using ScriptAliased directories rather than a .pl handler, for security reasons.)

(After fixing the Apache configuration, you may have to quit your web browser to clear the problem.)

Internal Server Error [Web browser]

This is a fairly generic error--you will need to look in the Apache logs or run the script from the command line to see a more specific error message.

	prompt> tail -f /var/log/apache/error.log
	[Thu Dec  5 20:50:13 2002] DBI->connect(database=calendar3;host=localhost) failed: Access denied for user: 'kalendus@localhost' to database 'calendar3' at Kalendus.pm line 83
	[Thu Dec  5 20:50:13 2002] Can't connect to MySQL database: Access denied for user: 'kalendus@localhost' to database 'calendar3'

	prompt> cd cgi-bin/calendar/
	prompt> ./month.pl
	[Thu Dec  5 20:48:23 2002] DBI->connect(database=calendar3;host=localhost) failed: Access denied for user: 'kalendus@localhost' to database 'calendar3' at Kalendus.pm line 83
	...
	[Thu Dec  5 20:50:37 2002] Can't connect to MySQL database: Access denied for user: 'kalendus@localhost' to database 'calendar3'

Permission denied. [Command line]
Permission denied: exec of /home/httpd/cgi-bin/calendar/month.pl failed [Apache log]

The scripts do not have execute bits set.

	prompt> ls -l month.pl
	-rwxr-xr-x    1 mgates   www          6.6k Nov 25 23:21 month.pl

The permissions are typically as shown above, -rwxr-xr-x. The last three letters in particular must be r-x. Use 'chmod 755 month.pl' to fix it if necesary.

Command not found. [Command line]
No such file or directory: exec of /home/httpd/cgi-bin/calendar/month.pl failed [Apache log]

Perl is not installed at /usr/bin/perl. Locate where perl is installed.

	prompt> which perl
	/usr/bin/perl

The #! (shee-bang) line at the top of each .pl file must match that location.

Can't locate Time/JulianDay.pm in @INC [Command line or Apache log]
Can't locate DBI.pm in @INC
Can't locate CGI.pm in @INC

The listed Perl module has not been installed. Ask your system admin to install it. See the Perl setup.

Unknown MySQL Server Host 'mysql.example.com'

The hostname in cgi-bin/calendar/KalendusConfig.pm does not exist in the DNS. See the MySQL setup. Try logging in with the mysql command line client:

	prompt> mysql -h mysql.example.com -u kalendus -p calendar
	Enter password: ****

Can't connect to MySQL server on 'mysql.example.com'

(MySQL host is not localhost.) The MySQL server is not running, or is not listening on the network port. Check with your system admin, or look in the MySQL documentation. See above.

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

(MySQL host is localhost.) The MySQL server is not running, or is not listening on the network port. Check with your system admin, or look in the MySQL documentation. See above.

Access denied for user: 'kalendus@www.example.com' (Using password: YES)

The username and/or password in cgi-bin/calendar/KalendusConfig.pm is not correct. See above.

Access denied for user: 'kalendus@www.example.com' to database 'calendar'

It successfully logged into the MySQL server, but the username does not have select priveleges to the 'calendar' database. See above.

Unknown database 'calendar'

It successfully logged into the MySQL server, but the database didn't exist. Either the database name in cgi-bin/calendar/KalendusConfig.pm is not correct, or the database was not created. See above.

Table 'calendar.calendar' doesn't exist

Probably the mysql tables were not created. See the MySQL setup.


Scripts run incorrectly

No month names show up

Probably the mysql tables were not populated with data. See the MySQL setup.

There are no fonts, colors, or images

Either the static HTML files were not installed, or their location in cgi-bin/calendar/KalendusConfig.pm is not correct. If you load the page in a web browser and view the HTML source, you can see where it expects the files to reside:

	<link rel="StyleSheet" type="text/css" href="/calendar/style.css" />

See the Apache setup.

You only want authorized users to add and edit events, but it never asks for a password.

Apache has not been setup to secure the cgi-bin/calendar/auth/ directory. Ask your system admin. If you are the system admin, consult the Apache documentation, especially the security tutorials. See the Apache setup.

You only want authorized users to view events, but it never asks for a password.

Apache has not been setup to secure the cgi-bin/calendar/ directory. See above.