Debian:CGI

From LQWiki
Jump to navigation Jump to search

To get CGI scripts running on Debian:

  1. Make sure Apache is installed: dpkg -l | grep apache
  2. Make sure Apache is running. If it isn't, run rcconf to set it to start upon boot-up -- you may have to then manually start it yourself this one time: /etc/init.d/apache start
  3. Make sure your scripts' permissions are set to 0755, and drop them /usr/lib/cgi-bin
  4. Put your HTML files in /var/www. Note that there should already be a default index.html file in there containing helpful information, so don't immediately copy over it.
  5. Link to the CGI scripts from within your HTML files as if they were located in /var/www/cgi-bin even though they aren't and that directory doesn't (and shouldn't) exist anyway.