title: Configure Apache2 to allow clients to run Perl Scripts in cgi-bin
body: <p>I have two perl scripts; one acts like the client (and queries); the other acts like the server and returns information.  On an Apache server (not my own) they work perfectly.</p>
  
  <p>However, on my ubuntu/Linux_box with Apache2 (that I set up) they do not; I get a 404 not found error.  The  cgi-bin directory is located at usr/lib/cgi-bin.  What specific files/settings etc have to be changed/altered/etc.  And,  what specific changes/alterations/etc. need to be made?</p>
  
  <p><strong>Edit:</strong>
  I changed the httpd.conf and tried <em>both</em> of the following (but neither worked):</p>
  
  <pre><code>ScriptAlias  /diag/ /usr/lib/cgi-bin
  ScriptAlias  /diag/ /usr/lib/cgi-bin/
  </code></pre>
  
  <p>I am using a perl script as the client, and it did not work. For illustration purposes I attempted to locate the file with the browser shown in the 2nd pic.</p>
  
  <p><img src="https://i.stack.imgur.com/Bpcbu.jpg" alt="linux"></p>
  
  <p><img src="https://i.stack.imgur.com/aUodM.jpg" alt="ms"></p>