Tribeless Nomad (tribelessnomad) wrote in lj_dev,
Tribeless Nomad

/doc/find CGI script

Please read this if you're interested in the design of the new documentation system, or if you have expertise in FastCGI or non-Apache servers like IIS.

Earlier today (talkread.bml?itemid=22974104), I introduced a plan for assigning canonical URLs to new LJ documentation. Under this plan, a document which could be requested directly as
will normally be linked to (from outside the documentation system) using the less specific URL
The redirection is performed by a simple CGI script which will later be enhanced to do various things like selecting from multiple document formats.

I have no experience with IIS or servers other than Apache. To avoid future porting difficulties, it would be helpful if people familiar with IIS or other servers could comment on whether the plan I've described would be more difficult to implement on other servers.

The CGI script is running on my goathack server as cgi-bin/ and is supported by some general-purpose CGI code in cgi-bin/

View cgi-bin/ as text.
View cgi-bin/ as text.

There are a few FIXME lines in, but they all refer to trapping obscure errors which are nearly always ignored in other CGI scripts.

To get these scripts working, I added the following directives to /etc/httpd.conf:
FastCgiServer /home/tribelessnomad/cgi-bin/ -processes 1 -initial-env LJHOME=/home/tribelessnomad

Alias /doc/find /home/tribelessnomad/cgi-bin/

<Directory /home/tribelessnomad/cgi-bin>
    SetHandler fastcgi-script
By the way, I'm pretty familiar with CGI but not with FastCGI / signal handling, so the FastCGI support I've provided is based mainly on what I found in existing files like 404notfound.cgi.

Anyone want to suggest improvements?

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded