OpenBSD Journal

Minimalist HTTP Daemon Activated in Base

Contributed by tbert on from the slowhttpd(8) dept.

Reyk Flöter (reyk@) recently committed the rc(8) glue to make his forked-from-relayd http server usable:

CVSROOT:	/cvs
Module name:	src
Changes by:	reyk@cvs.openbsd.org	2014/07/22 11:37:16

Modified files:
	usr.sbin       : Makefile 
	etc            : Makefile changelist rc.conf 
Added files:
	etc/rc.d       : httpd 

Log message:
Enable httpd(8) in the builds to get more testing, feedback and
improvements.  It is not "finished" but serves static files.

ok deraadt@

This code is derived from relayd(8), which means that it shares the privsep architecture and human-readable configuration syntax common to many OpenBSD-originated daemons.

This is still early work, and in a series of follow-up commits, reyk@ has fixed a smattering of issues that have come up during early use. If you have a need for a web server that does little more than serves static content, go ahead and give it a spin and see if you can keep Herr Flöter up late again!

(Comments are closed)


Comments
  1. By A Non (87.179.67.123) mail@me.de on

    What's wrong with nginx? Why another httpd?

    Comments
    1. By Billy Larlad (69.178.112.236) on

      > What's wrong with nginx? Why another httpd?

      I dunno, but I am inclined to trust a minimalist http server from the OpenBSD devs, running on OpenBSD, more than a fully-featured http server from others, who are developing for many platforms. No disrespect to the nginx folks intended, of course.

      I am curious if there is any plan to replace nginx in base with this. On the one hand, the commit message says "httpd(8) is not intended to provide a fully-featured replacement for nginx(8) or the Apache" but it also says "but it will provide enough functionality that is needed in the OpenBSD base system.

      Anyhow, I'll be giving it a try as soon as I can.

      Comments
      1. By Anonymous Coward (2601:8:9c80:305:64:e372:96c1:b234) on

        > > What's wrong with nginx? Why another httpd?
        >
        My guess is that the OpenSSL debacle is making the devs more introspective about what they are putting into base. I would love a static only HTTPd. I don't need fancy ass CGI and what-not. Something to push out the files to myself or a few select people with an xhtml and css would be stellar. My only suggestion would be to have hooks for LibreSSL, if they are reading this. :)

        > I dunno, but I am inclined to trust a minimalist http server from the OpenBSD devs, running on OpenBSD, more than a fully-featured http server from others, who are developing for many platforms. No disrespect to the nginx folks intended, of course.
        >
        > I am curious if there is any plan to replace nginx in base with this. On the one hand, the commit message says "httpd(8) is not intended to provide a fully-featured replacement for nginx(8) or the Apache" but it also says "but it will provide enough functionality that is needed in the OpenBSD base system.
        >
        > Anyhow, I'll be giving it a try as soon as I can.
        >

      2. By Anonymous Coward (75.104.65.120) on


        > I am curious if there is any plan to replace nginx in base with this. On the one hand, the commit message says "httpd(8) is not intended to provide a fully-featured replacement for nginx(8) or the Apache" but it also says "but it will provide enough functionality that is needed in the OpenBSD base system.

        It seems to me they are only providing nginx or apache as a package/port from 5.6 on. This is reasonable for me, so long as the port/package is chrooted. Would be a pain to have to manually chroot the nginx package and somehow keep it up to date and maintained on a system.

        I searched the archives and can't find any discussion of moving a chrooted nginx to ports but that's my hope.

    2. By pelikan (2a01:490:19:19:58ab:4f0:31e4:69b6) on http://storkhole.cz

      > What's wrong with nginx? Why another httpd?

      nginx got a lot of money recently and (probably as a result of that) has grown a lot. The codebase is getting harder to understand and is pretty much un-forkable (everything being ngx_*, "optimized" standard library replacements, and so on). Having a web server for basic needs doesn't need to be this complicated. There's always ports for the fancy stuff...

      The transition to nginx has given us a lot for ports integration, but unfortunately the current versions aren't what nginx used to be any more.

    3. By reyk (79.194.195.79) reyk@openbsd.org on http://bsd.plumbing/

      > What's wrong with nginx? Why another httpd?

      The responses from Billy Larlad and pelikan summarize it very well.

      Reyk

      Comments
      1. By Sebastian Rother (80.153.96.240) on

        > > What's wrong with nginx? Why another httpd?
        >
        > The responses from Billy Larlad and pelikan summarize it very well.
        >
        > Reyk


        So what is minimalistic for you Reyk?
        SSI, CGI/FastCGI/SCGI, vHosts, IDN, deflate/gzip compression?
        You sometimes like to have a rewrite rule too or block some broser agents or manipulate the requests or prevent some http-methods like POST/PUT/DELETE..and so on.

        If you wanna ship only plain html-Files you could use thttpd or even micro thttpd but you choosed to implement something new so you do have a concept and a plan. :-)

        I angree that nginx becomes more and more a media whore and implements a lot stuff you normaly don't need (mp4 streaming, yay..) compared to stuff you likely do want like sane(er....) authentication methods (anything else then http-basic auth...).

        It would be very kind if there could be a little undeadly article explaining the longterm goals and what features are planed. Also the domain openhttpd.org is owned by henning@ for some years so I assume this could be a useable project name.

        Maybe also external developers would join this effort if they get attracted by some undeadly article about this project.

        Kind regards,
        Sebastian

  2. By Anonymous Coward (185.31.136.244) on

    Do you plan to support php-fpm?
    Thanks

  3. By Anonymous Coward (75.104.65.120) on

    This is depressing if there will no longer be an httpd daemon in base that supports basic scripting languages like php/python, etc...

    I was looking into what it will take for me to move my sites to nginx when 5.6 comes out but now it seems I may have to forgo the protection of using the OpenBSD base solution to using a port just to get basic php functionality? ugh. :(

    I suppose the old apache 1.3.x could be used still from ports but I doubt it would still be actively maintained. I guess for those of us needing php support we should just plan to switch to nginx anyway even if it's not from base?

    Comments
    1. By Gessler (10.1.1.50) on

      I have only tested it with php-fpm, no cgi, php works well. Have a look at the /etc/examples/httpd.conf file. The new daemon should do it for most people.
      My httpd.conf(I only run a webserver to use SqStat and distribute a wpad file):
      ext_addr="10.1.1.1"
      prefork 2
      server "default" {
      listen on $ext_addr port 80
      location "*.php" {
      fastcgi socket "/run/php-fpm.sock"
      }
      }
      When I remember the apache .conf, oh my god.... this new beast is perfect for me.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]