next up previous
Next: Private development directory Up: Example Previous: Home page directory

CGI directory

Usually the web server is configured to look for users' CGI programs in a special directory named cgi-bin, which is located in the public_html directory. So the next step is to create this directory.
  ~/> cd public_html
  ~/public_html/> mkdir cgi-bin
  ~/public_html/> chmod go=x cgi-bin
  ~/public_html/> ls -ld cgi-bin
  drwx--x--x    2 joeuser   students      1024 Sep  4 17:31 cgi-bin
The permissions are set differently here for security reasons. (CGI scripts are a rich source of security holes, and on a multi-user system it is best to take all reasonable precautions.) By granting world-access permission to cgi-bin, any process that knows the name of a CGI program in the directory can access it for execution. But by denying read access, no one but you, the owner, can list the directory and find out the names of the programs in it.



Robert Moniot
2000-09-13