Skip to Content
Apache: The Definitive Guide, 3rd Edition
book

Apache: The Definitive Guide, 3rd Edition

by Ben Laurie, Peter Laurie
December 2002
Intermediate to advanced
588 pages
25h 57m
English
O'Reilly Media, Inc.
Content preview from Apache: The Definitive Guide, 3rd Edition

Script in cgi-bin

Use ScriptAlias in your host’s Config file, pointing to a safe location outside your web space. This makes for better security because the Bad Guys cannot read your scripts and analyze them for holes. “Security by obscurity” is not a sound policy on its own, but it does no harm when added to more vigorous precautions.

To steer incoming demands for the script to the right place (.../cgi-bin ), we need to edit our ... /site.cgi/conf/httpd1.conf file so it looks something like this:

User webuser
Group webgroup
ServerName www.butterthlies.com

#for scripts in ../cgi-bin
ScriptAlias /cgi-bin /usr/www/APACHE3/cgi-bin
DirectoryIndex /cgi-bin/script_html

You would probably want to proceed in this way, that is, putting the script in the cgi-bin directory (which is not in /usr/www/APACHE3/site.cgi/htdocs), if you were offering a web site to the outside world and wanted to maximize your security. Run Apache to use this script with the following:

./go 1

You would access this script by browsing to http://www.butterthlies.com/cgi-bin/mycgi.cgi.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tomcat: The Definitive Guide, 2nd Edition

Tomcat: The Definitive Guide, 2nd Edition

Jason Brittain, Ian F. Darwin
HTTP: The Definitive Guide

HTTP: The Definitive Guide

David Gourley, Brian Totty, Marjorie Sayer, Anshu Aggarwal, Sailu Reddy
Nginx HTTP Server - Fourth Edition

Nginx HTTP Server - Fourth Edition

Martin Bjerretoft Fjordvald, Nedelcu

Publisher Resources

ISBN: 0596002033Supplemental ContentErrata Page