title: Can't launch lighttpd service daemon
body: <p>I want to set up lighttpd on my remote ubuntu server and launch flask app but I have some troubles when I use systemctl restart lighttpd</p>
  
  <p>Here is error logs:</p>
  
  <p>systemctl status lighttpd</p>
  
  <pre><code>● lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2019-01-15 14:31:38 UTC; 3s ago
    Process: 19104 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
    Process: 19097 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
   Main PID: 19104 (code=exited, status=255)
  
  Jan 15 14:31:38 ubuntu systemd[1]: Starting Lighttpd Daemon...
  Jan 15 14:31:38 ubuntu lighttpd[19097]: Syntax OK
  Jan 15 14:31:38 ubuntu systemd[1]: Started Lighttpd Daemon.
  Jan 15 14:31:38 ubuntu systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
  Jan 15 14:31:38 ubuntu systemd[1]: lighttpd.service: Unit entered failed state.
  Jan 15 14:31:38 ubuntu systemd[1]: lighttpd.service: Failed with result 'exit-code'.
  
  </code></pre>
  
  <p>tail /var/log/lighttpd/error.log</p>
  
  <pre><code>2019-01-15 14:31:38: (log.c.164) server started
  2019-01-15 14:31:38: (mod_fastcgi.c.1112) the fastcgi-backend /var/www/landing/landing.fcgi failed to start:
  2019-01-15 14:31:38: (mod_fastcgi.c.1116) child exited with status 8 /var/www/landing/landing.fcgi
  2019-01-15 14:31:38: (mod_fastcgi.c.1119) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
  If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
  2019-01-15 14:31:38: (mod_fastcgi.c.1406) [ERROR]: spawning fcgi failed.
  </code></pre>
  
  <p>Here is my lighttpd.conf</p>
  
  <p>cat /etc/lighttpd/lighttpd.conf</p>
  
  <pre><code>server.modules = (
          "mod_access",
          "mod_alias",
          "mod_compress",
          "mod_redirect",
          "mod_rewrite",
          "mod_fastcgi",
  )
  
  server.document-root        = "/var/www/"
  server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
  server.errorlog             = "/var/log/lighttpd/error.log"
  server.pid-file             = "/var/run/lighttpd.pid"
  server.username             = "www-data"
  server.groupname            = "www-data"
  server.port                 = 80
  
  index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
  url.access-deny             = ( "~", ".inc" )
  static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
  
  compress.cache-dir          = "/var/cache/lighttpd/compress/"
  compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )
  
  include_shell "/usr/share/lighttpd/create-mime.assign.pl"
  include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
  
  fastcgi.server = (
      "/" =&gt;
      ((
          "socket" =&gt; "/tmp/landing-fcgi.sock",
          "bin-path" =&gt; "/var/www/landing/landing.fcgi",
          "check-local" =&gt; "disable",
          "max-procs" =&gt; 1
      ))
  )
  
  alias.url = (
      "/static/" =&gt; "/var/www/landing/static/",
  )
  
  url.rewrite-once = (
      "^(/static($|/.*))$" =&gt; "$1",
      "^(/.*)$" =&gt; "/landing.fcgi$1"
  )
  </code></pre>
  
  <p>And my landing.fcgi</p>
  
  <pre><code>from flup.server.fcgi import WSGISerever
  import app
  
  if __name__ == '__main__':
      WSGIServer(app, bindAddress='/tmp/landing-fcgi.sock').run()
  </code></pre>