Why am I getting an (Apache2) 500 when I try to access index.cgi?

Jonathan Hayward asked:

index.cgi and its parent directory are mode 755 owned by the same owner, the DocumentRoot of the site below. The site-enabled/005-icons file has:

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName iconlibrary.mobi
    ServerAlias www.iconlibrary.mobi icon.stornge.com icons.stornge.com

    DocumentRoot /home/jonathan/ikon
    <Directory />
        Options FollowSymLinks
        AllowOverride None

    <Directory /home/jonathan/ikon>
        Options ExecCGI Indexes FollowSymLinks MultiViews
        AllowOverride All
        AddHandler cgi-script .cgi
        DirectoryIndex index.cgi index.html
        Order allow,deny
        allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from ::1/128


There is nothing in the error logs when I attempt to access them from the web; when I tried to run index.cgi from the command line it ran predictably well.

I believe that /index.cgi may not be running as a side effect of something preventing /*.cgi from running. I tried to run the index script as /, then as /index.cgi, and then copied it to /icon.cgi which behaved identically to when it was invoked as / or /index.cgi.



I went through the level 1 technical support questions before posting: for tech support, “Is it plugged in? Is it turned on?” I’ve checked the logs and confirmed that the program runs as expected when executed from the command line, and also checked permissions, etc. I was really hoping for level 2 or level 3 kind of support, not “Check your logfiles; maybe you have a syntax error.” I already stated in the original question that I checked the logfiles and nothing’s there when it serves up a 500.

My answer:

A 500 error in this context often means your CGI script crashed. Check the various log files for clues, look for syntax errors, etc.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.