Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed CGI via the package manager and enabled the mod, but two hours later I still cant get it to work.

My /etc/apache2/sites-available/default is:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    <IfModule mod_alias.c>
        ScriptAlias /cgi-bin/ /var/www/cgi-bin/

        <Directory /var/www/cgi-bin/>
            AllowOverride None
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>

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

    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

</VirtualHost>

CGI is enabled. When I browse to mydomain.com/cgi-bin/ it goes to /usr/lib/cgi (I believe) instead.

root@zeus:~# a2enmod cgi
Module cgi already enabled
root@zeus:~# apt-get install php5-cgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-cgi is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@zeus:~# sudo service apache2 restart
[....] Restarting web server: apache2[Wed Apr 23 20:20:28 2014] [warn] The ScriptAlias directive in /etc/apache2/sites-enabled/000-default at line 29 will probably never match because it overlaps an earlier ScriptAlias.
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
... waiting [Wed Apr 23 20:20:29 2014] [warn] The ScriptAlias directive in /etc/apache2/sites-enabled/000-default at line 29 will probably never match because it overlaps an earlier ScriptAlias.
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
. ok
share|improve this question

closed as off-topic by Jeff Schaller, PersianGulf, nwildner, Thomas Dickey, jimmij Jun 7 at 7:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, PersianGulf, nwildner, Thomas Dickey, jimmij
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
You have two ScriptAlias directives, of which only one will be used. Maybe you need to decide on which one to use, or alias one of them to something other than /cgi-bin/ – Drav Sloan Apr 24 '14 at 1:58