title: perl/cgi script not found error 404 apache2
body: <p>I have a perl script in /var/cgi-bin directory which executes normally with the url:</p>
  
  <p>localhost/cgi-bin/filename.pl</p>
  
  <p>but when i call the same file through a html file the loaclhost server return a 404 not found error.</p>
  
  <p>code:
  html file:</p>
  
  <pre><code>&lt;?xml version="1.0"encoding="utf-8"?&gt;
  &lt;html&gt;
              &lt;head&gt;
                              &lt;title&gt;light bulbsr form&lt;/title&gt;
              &lt;/head&gt;
              &lt;body&gt;
  
  &lt;form action="/cgi-bin/bulbs.pl" method="POST"&gt;
  
  user name&lt;input type="text" name="myname" size="30"/&gt;&lt;br&gt;
  
  select the items:&lt;br&gt;
  
  &lt;input type="checkbox" name="b" value="2.39" /&gt; four100 watt light bulbs  &lt;/br&gt;
  &lt;input type="checkbox" name="b" value="4.29"&gt;  eight 100 watt light bulbs &lt;/br&gt;
  &lt;input type="checkbox" name="b" value="3.95"&gt;  four 100 watt  long life bulbs &lt;/br&gt;
  &lt;input type="checkbox" name="b" value="7.49"&gt; eight100 watt  long life bulbs &lt;/br&gt;
  
  Select the mode of the payment:&lt;/br&gt;
  
  &lt;input type ="radio" name="paymode" value="visa" checked="checked"/&gt;Visa&lt;br&gt;
  &lt;input type ="radio" name="paymode" value="Master card"/&gt;Master card&lt;br&gt;
  &lt;input type ="radio" name="paymode" value="Discover"/&gt;Discover&lt;br&gt;
  
                              &lt;input type="submit" value="submit order"/&gt;
                              &lt;input type="reset" value="Clear the form"/&gt;
              &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>perl file:</p>
  
  <pre><code>#!/usr/bin/perl
  use CGI qw(:standard);
  use strict;
  
  
  print header(),start_html ("Bill ");
  print p("The total cost:0");br();
  print end_html;
  </code></pre>
  
  <p>the apache2 000-default.conf:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  ServerAdmin webmaster@localhost
  DocumentRoot /var/www/html
  ScriptAlias /cgi-bin/ /var/cgi-bin/
       &lt;Directory "/var/cgi-bin/"&gt;
               AllowOverride None
               Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
               Require all granted
       &lt;/Directory&gt;
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>