title: Bash script for deployment as a cgi
body: <p>i have a bash script that copies and modifies a bunch of configuration files in my app running as a cgi for fast deployment and testing.</p>
  
  <p>This script is in the public_html folder of my hosting and it works perfectly, permissions set to 755.</p>
  
  <p>I am making other cgi scripts in a subfolder public_html/foo/bar.cgi and giving it 755 permission.</p>
  
  <pre><code>#!/bin/bash
  
  echo "Content-type: text/html"
  echo ""
  
  # test if we are in the correct place
  touch foo 2&gt;&amp;1
  
  echo '&lt;html&gt;'
  echo '&lt;head&gt;'
  echo '&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;'
  echo '&lt;/head&gt;'
  
  echo '&lt;body&gt;'
  echo '&lt;p&gt;Hello World&lt;/p&gt;'
  echo '&lt;p&gt;&amp;nbsp;&lt;/p&gt;'
  echo '&lt;hr/&gt;'
  
  echo '&lt;/body&gt;'
  echo '&lt;/html&gt;'
  
  exit 0
  </code></pre>
  
  <p>This doesn't work, the server answers with a 403.
  I have checked the folder permission, and set it to 755 and 777 without results</p>
  
  <p>UPDATE: Changed name from test.cgi to testscript.cgi and it's woking now</p>