title: cgi-bin directory contents: What else can be stored there, apart from the CGI scripts/executables?
body: <p>What files should/should not be stored in the cgi-bin folder/directory on a web server?</p>
  
  <p>Obviously, executable scripts/files that make up a web application, called from a web browser can be stored there.</p>
  
  <p>But is there a common industry opinion about what else can be stored there?</p>
  
  <p>Is there a very strong reason why nothing else apart than the scripts/executables is allowed there?</p>
  
  <p>My preference is to store all files belonging to an application in the cgi-bin directory/folder, as a subfolder off it - for each application.</p>
  
  <p>For example directory cgi-bin/myapplication would contain:</p>
  
  <ul>
  <li>the cgi scripts/executables</li>
  <li>datafiles</li>
  <li>configuration files</li>
  </ul>
  
  <p>This simplifies installation and also simplifies the steps to run different versions of a application in parallel, e.g. for trialling a new version.</p>
  
  <p>Concerns about security access to non-script files can be addressed by using the correct user permissions and also Apache .htaccess to control access to the directory and files.</p>
  
  <p>It would seem that popular free applications are in favour of this everything-under-one-directory approach: The versions of bugzilla, the free defect and feature tracking tool, e.g. 3.4.4 are offered in this structure, while earlier versions, e.g. 2.x installed bugzilla components to at least three folders. </p>
  
  <p>Drupal, the powerful and popular free content management system also takes this approach of everything-under-one-directory, albeit doesn't use the cgi-bin folder but the approach is the same.</p>
  
  <p>What are your thoughts?</p>