scripts.mit.edu

MIT SIPB Script Services for Athena

Why doesn't my FastCGI website work?

There are many reasons that this could occur, but here are a couple issues that you might encounter.

Incorrect Permissions

Since a .fcgi script is run by actually launching the script directly on our server as a command, it needs to be marked as “executable” to function, and if it is not, you will get a “500 Internal Server Error” when you try to visit the page.

To check if this is the problem, run ‘ls -l’ on your script, like follows:

$ ls -l index.fcgi
-rw-r--r-- 1 sipb cela 100 Jul 26 19:45 index.fcgi

(where ‘index.fcgi’ is replaced with the name of your script.)

The symbols at the far left represent the permissions of the file. If it says “-rwxr-xr-x” (i.e. has three x’s), then it is executable, and this is not your problem. But if it doesn’t have three x’s, and is (for example) “-rw-r—r—”, then you will need to mark it as executable:

$ chmod +x index.fcgi

It should then work (or at least fail for a different reason), and should show up with the correct permissions when you run ‘ls -l’ on your script:

$ ls -l index.fcgi
-rwxr-xr-x 1 sipb cela 100 Jul 26 19:45 index.fcgi

Not reloading your script

If you or someone else has recently visited a FastCGI site, and then you made changes to it, the changes may not appear immediately, because a process running the old version of the script may still be running.

To fix this, SSH into the server that your browser is currently load-balanced to, and run the following command:

$ pkill -u $USER index.fcgi

(where ‘index.fcgi’ is replaced with the name of your script.)

To determine the server that your browser is currently load-balanced to, scroll to the bottom of scripts.mit.edu to where it says something like “You are currently connected to shining-armor.mit.edu.” The name ‘shining-armor.mit.edu’ would be the name of the server that you’re currently load-balanced to.

Not including a trailing slash

Some web frameworks may by default require a trailing slash to be appended to a FastCGI URL.

So, if you’re accessing “https://yourwebsite.scripts.mit.edu/index.fcgi”, and it doesn’t work, you might also try “https://yourwebsite.scripts.mit.edu/index.fcgi/” (with the added trailing slash).

Previous:
Next:
© 2004-2019, the SIPB scripts.mit.edu project.
These pages may be reused under either the GFDL 1.2 or CC-BY-SA 3.0.
Questions? Contact scripts@mit.edu.

You are currently connected to bees-knees.mit.edu.