public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Lighttpd and Perl
Date: Thu, 30 Sep 2021 18:48:05 -0600	[thread overview]
Message-ID: <b26e9e1b-7ad0-3872-9131-9f5f1df08705@SystematicSw.ab.ca> (raw)
In-Reply-To: <YVYr5uUK11RHniT/@xps13>

On 2021-09-30 15:28, gs-cygwin.com@gluelogic.com wrote:
> On Thu, Sep 30, 2021 at 10:07:24AM +0000, Andy Romens via Cygwin wrote:
>> I am running into a bit of what appears a noob issue with lighttpd.
>> Short and sweet version is I am transitioning from Apache to lighttpd.
>> Gotten pretty far, except now I am having issues with parsing.
>> Our website will run a command in a browser like 
>> ‘server/cgi-bin/myscript.pl?prod,eventhist’ in the web browser.
>> With Apache, it will split everything after the ‘?’ As variables,
>> and return a nicely formatted html result page.
>> However, after switching to lighttpd, it’s not passing those 
>> variables anymore. When I run the script in Cygwin, it works just 
>> fine.
>> I’ve been banging my head on this problem for a few days now, so 
>> any assistance would be greatly appreciated.

> I'd suggest starting at https://wiki.lighttpd.net/#Documentation and
> carefully reading through the link for "How to get help".  Then, you
> can post your improved questions in the lighttpd Support Forum,
> perhaps with more details about your script.
> When running CGI scripts such as "myscript.pl", lighttpd creates a
> standard CGI environment [1], including environment variables such as
> QUERY_STRING, so the problem is likely in your Perl script, and likely
> a misunderstanding of standard CGI environment variables.
> [1] The Common Gateway Interface (CGI) Version 1.1
> https://datatracker.ietf.org/doc/html/rfc3875

There have to be many thousands of perl CGI scripts written in the 17 
years since that RFC was posted that you should be able to pick from, 
preferably with comprehensive client and server metadata debugging 
output, and use with suitable command line scripts or simple web forms 
as basic regression tests for your web server functions.

Does the package itself come with any such server test pages and scripts 
that you can start with, or does the documentation contain such content?

Start with simple client command scripts, web pages, and CGI scripts for 
each of the simple basic datatypes, each with a single form with a 
single field of one type, and check how each is handled by your server 
configuration.

Remember to leave any Apache assumptions at the door, and check how 
lighttpd handles metadata provided or generated, methods, path info, 
query strings, parameters, etc. and what assumptions the perl scripts 
have built in.

Using command line clients' e.g. lynx, wget, curl, and servers' 
debugging logs, and tools like xtail to merge them into a stream showing 
the interactions from both sides of the interface, can be a useful 
approach.

It helps if you can think from the point of view that whichever side you 
are dealing with currently could be causing an issue.

Hope this helps you think about different approaches you could try.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

  reply	other threads:[~2021-10-01  0:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 10:07 Andy Romens
2021-09-30 21:28 ` gs-cygwin.com
2021-10-01  0:48   ` Brian Inglis [this message]
2021-10-06 23:56   ` Andy Romens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b26e9e1b-7ad0-3872-9131-9f5f1df08705@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).