Internal Server Error (Code 500), or Not Found (404), or Forbidden (401)

Question:

When accessing the Centova Cast web interface I get an "Internal Server Error (500)", "Not Found (404)", or "Forbidden (401)" message. What is the problem?

Answer:

These errors are generated by your web server (Apache), not Centova Cast. To understand why, it helps to understand how requests are handled by your server when you bring up a page in your web browser.

  1. Browser connects to Apache, says "I want to receive the page /login/index.php"
  2. Apache looks up the path for /login/index.php and makes sure it exists
  3. Apache fires up PHP, and says "I need you to run /login/index.php, and then send me back the HTML"
  4. PHP opens /login/index.php and reads the script it contains
  5. PHP passes control to the script (Centova Cast in this case) which runs and generates its HTML, and passes that HTML back to PHP
  6. PHP sends the HTML back to Apache.
  7. Apache sends it back to your browser.

This is of course heavily oversimplified, but generally that's how a normal request works. The problem in your case is that in step 2 (for code 401 or 404 errors) or steps 2-4 (for code 500 errors) Apache or PHP is unable or unwilling to open the script file.

As illustrated above, this takes place long before PHP ever passes control to Centova Cast (in step 5), so the message is definitely not being generated by Centova Cast. As such, this is an Apache/PHP issue and you'll need to contact your systems administrator and ask him to look into this problem for you. A good place to start looking is the Apache master error log.

Tip: If suPHP is installed on your server and you're encountering a code 500 (Internal Server Error) immediately after installing or upgrading Centova Cast, it's likely that the permissions/ownerships are set incorrectly on the Centova Cast files under your web root. suPHP is extremely strict about permissions/ownerships and will throw an Internal Server Error if the files under the web root are not owned by the correct user account.

If that's the case in your situation, you can fix this by running:

chown -R username.groupname /path/to/webroot/ chmod -R 0755 /path/to/webroot/

You must of course replace username with the username for your web site, groupname with the group name for your web site (which is usually identical to the username), and /path/to/webroot/ with the actual path to your web root.