title: Running a .cgi script via /var/www/cgi-bin in lighttpd web server on raspberry pi
body: <p>I am following a few year old <a href="https://www.hackster.io/mjrobot/iot-raspberry-pi-robot-with-video-streamer-and-pan-tilt-f50e53" rel="nofollow noreferrer">tutorial on a web-driven car</a></p>
  
  <p>I have a file structure:</p>
  
  <pre><code>/var/
  
     /www/ (index.html for a webpage with buttons is contained here and displays 
      perfectly)
  
         /cgi-bin/ (containing cgi scripts with permissions granted)
  </code></pre>
  
  <p>the html code contains functions calling the scripts from /cgi-bin/:</p>
  
  <pre><code>function centertilt()
  {
      xmlhttp.open("GET","cgi-bin/centertilt.cgi",true);
      xmlhttp.send();
  }
  </code></pre>
  
  <p>and buttons calling those functions</p>
  
  <pre><code>button {
          color: blue;
          background:lightgrey;
          border: 1px solid #000;
          border-radius: 8px;
          position: center;
  }
           ...
  &lt;button style="height: 50px; width: 100px; font-size: 25px" onclick="centertilt()"&gt;0&lt;/button&gt;
           ...
  </code></pre>
  
  <p>When I run the .cgi scripts via the CLI they work perfectly but the buttons don't call them when pressed.</p>