Item12370: Problems with configure and lighttpd

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: minor
Applies To: Engine
Component: Configure
Branches: trunk
Reported By: CrawfordCurrie
Waiting For:
Last Change By: CrawfordCurrie
Been trying to configure a site on lighttpd with the new configure (trunk).

  1. BasicSanity.pm now fails because $ENV{PATH} is undef - crash on the regex at line 165
  2. If openssl is not installed - and it's not expressed as a dependency - then WebMasterName.pm crashes
    • {WebMasterName} reports Error: S/MIME signing with self-signed certificate requested, but files are not present. Please generate a certificate with the action button.
    • the certificate-generating code generates a tmpfile which it passes to a subprocess. However the tmpfile has been flushed and closed. (File::Temp version 0.22)
  3. Initial .htpasswd contains a single line containing :: - this breaks the parser in HtpasswdUser.pm because the line does not split into 5 fields.
    • Not tested this, but a passwd file may have 3 or more fields - the code assumes 5, which is the case for a file generated by foswiki but I suspect it precludes reuse of an existing passwd.
  4. {Log}{LogDispatch}{FileRolling}{Enabled}= is enabled by default. However it reports an error that Log::Log4perl is not installed. This module is not expressed as a required dependency, so configure should handle this case.
-- CrawfordCurrie - 29 Jan 2013

Hi Crawford, Thanks! Keep them coming.

  • 2). The SSL signing stuff should all be optional, so the dependencies are supposed to be optional. The buttons should probably be inactive if the required modules are missing. I assume it only crashes if you push the generate buttons?

  • 3) This should probably be an error on release 1.1.x too. I don't think we changed the HtpasswdUser code. I'll have to check the logs.

  • 4) LogDispatch. I thought I added all the dependencies to lib/CPAN/lib ... maybe I missed one. If it's going to be enabled by default, all the deps need to be provided. I think Sven might have even opened a task on this one. I think this might have been the root cause behind Item12171

-- GeorgeClark - 29 Jan 2013

Crawford, could you post a sample Lighttpd config? I've got a copy running for testing. I'm surprised we don't have any support guides for Lighttpd

-- GeorgeClark - 30 Jan 2013

1. I'll check-in a fix - though PATH being undefined is rather surprising.

2. I don't believe there are crashes here. There are errors reported.

2a. This message is because {Email}{EnableSMIME} is set, but there is no certificate and key file installed. I'll rework the message. You do get an error if you click the button - roughly "Unable to create certificate (No openssl: not found)". I'll add some text to the description noting that the certificate action buttons require openssl to be installed.

2b. The tempfile is flushed, but not closed. flush simply ensures that all output is written to disk before the subprocess starts. It doesn't close the file. The close happens when $tmpfile goes out of scope, which is after openssl is run. Is this based on code-reading, or an actual failure? The code does work here with File::Temp 0.22. If a failure, I need details...how did you detect it?

-- TimotheLitt - 30 Jan 2013

Crawford, could you please provide more information on the HtpasswdUser issue?

I created a new .htpasswd file, containing a single :: record. I was able to register and login. I'm not seeing any errors.

The 5 delimiters is the maximum number of fields to be split. That code should work just fine with fewer, especially since typical .htpasswd entries have 3 entries, and htdigest have 4.

user:hash:email
user:realm:hash:email

I don't recall why I set it to allow 5 entries. I expect there was a reason. smile

-- GeorgeClark - 03 Feb 2013

Issue in fix for SafeEnvPath breaks guessing of the initial setting.

-- GeorgeClark - 04 Feb 2013

My config is as follows:
crawford@ghost /etc/lighttpd/conf-available $ more 50-foswiki.conf 
server.modules += (
   "mod_simple_vhost",
   "mod_cgi",
   "mod_accesslog"
   )
simple-vhost.server-root = "/home"
simple-vhost.document-root = "/"
accesslog.filename = "/var/log/lighttpd/access.log"
server.breakagelog = "/var/log/lighttpd/stderr.log"

$HTTP["url"] =~ "/foswiki/.*/bin" {
   cgi.assign = ( "" => "" )
}
-- CrawfordCurrie - 04 Feb 2013

Regarding the missing PATH, See http://redmine.lighttpd.net/issues/2332 for the workaround
server.modules = ( "mod_setenv" )
setenv.add-environment = ( "PATH" => env.PATH )

Works fine.

-- GeorgeClark - 05 Feb 2013

MichaelDaum has started LighttpdBestPractice, and I think with that we can can close this task.

-- CrawfordCurrie - 15 Mar 2013

Closed - thanks to all for the fixes!

-- CrawfordCurrie - 13 Mar 2014

 
Topic revision: r14 - 13 Mar 2014, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy