Project

General

Profile

[Solved] Issue Starting Lighttpd

Added by airsoftsoldrecn9 about 7 years ago

Hello

I am experiencing a bit of trouble with a new installation of lighttpd 1.4.44 from Optware (Running on TomatoUSB Router). When attempting to start lighttpd and load the config file I receive the following error:

Server:/opt/etc/lighttpd# lighttpd -f ./lighttpd.conf
Undefined config variable: var.vhosts_dir
2017-02-08 01:38:19: (configfile.c.1148) source: cat /opt/etc/lighttpd/conf.d/*.conf line: 230 pos: 45 parser failed somehow near here: +
2017-02-08 01:38:19: (configfile.c.1148) source: ./lighttpd.conf line: 70 pos: 12 parser failed somehow near here: (EOL)

Where are config variables to be defined and may I have an example of proper syntax?

===================Version==========================
lighttpd/1.4.44 (ssl) - a light and fast webserver
Build-Date: Jan 6 2017 11:46:24

===================Modules Installed================
lighttpd-mod-access - 1.4.44-1b
lighttpd-mod-accesslog - 1.4.44-1b
lighttpd-mod-auth - 1.4.44-1b
lighttpd-mod-authn_file - 1.4.44-1b
lighttpd-mod-cgi - 1.4.44-1b
lighttpd-mod-fastcgi - 1.4.44-1b
lighttpd-mod-simple_vhost - 1.4.44-1b
lighttpd-mod-status - 1.4.44-1b

Should modules be enabled in some way following installation, or is the server.list modules section in lighttpd.conf sufficient?

====================lighttpd.conf====================

## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory

server.modules = (
#                               "mod_rewrite",
#                               "mod_redirect",
#                               "mod_alias",
                                "mod_access",
#                               "mod_cml",
#                               "mod_trigger_b4_dl",
                                "mod_auth",
#                               "mod_status",
#                               "mod_setenv",
                                "mod_fastcgi",
#                               "mod_proxy",
                                "mod_simple_vhost",
#                               "mod_evhost",
#                               "mod_userdir",
#                               "mod_cgi",
#                               "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#                               "mod_expire",
#                               "mod_secdownload",
#                               "mod_rrdtool",
                                "mod_accesslog")

server.document-root        = "/opt/share/www/" 
server.upload-dirs          = ( "/tmp" )
server.errorlog             = "/opt/var/log/lighttpd/error.log" 
server.pid-file             = "/opt/var/run/lighttpd.pid" 
#server.username             = "http" 
#server.groupname            = "www-data" 

index-file.names            = ( "index.php", "index.html",
                                "index.htm", "default.htm",
                                "index.lighttpd.html" )

#static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

# mimetype mapping

mimetype.assign             = (    
  ".pdf"          =>      "application/pdf",    
  ".sig"          =>      "application/pgp-signature",    
  ".spl"          =>      "application/futuresplash",    
  ".class"        =>      "application/octet-stream",    
  ".ps"           =>      "application/postscript",    
  ".torrent"      =>      "application/x-bittorrent",    
  ".dvi"          =>      "application/x-dvi",    
  ".gz"           =>      "application/x-gzip",    
  ".pac"          =>      "application/x-ns-proxy-autoconfig",    
  ".swf"          =>      "application/x-shockwave-flash",    
  ".tar.gz"       =>      "application/x-tgz",    
  ".tgz"          =>      "application/x-tgz",    
  ".tar"          =>      "application/x-tar",    
  ".zip"          =>      "application/zip",
  ".mp3"          =>      "audio/mpeg",
  ".m3u"          =>      "audio/x-mpegurl",    
  ".wma"          =>      "audio/x-ms-wma",    
  ".wax"          =>      "audio/x-ms-wax",    
  ".ogg"          =>      "application/ogg",    
  ".wav"          =>      "audio/x-wav",    
  ".gif"          =>      "image/gif",    
  ".jpg"          =>      "image/jpeg",    
  ".jpeg"         =>      "image/jpeg",    
  ".png"          =>      "image/png",    
  ".xbm"          =>      "image/x-xbitmap",    
  ".xpm"          =>      "image/x-xpixmap",    
  ".xwd"          =>      "image/x-xwindowdump",    
  ".css"          =>      "text/css",    
  ".html"         =>      "text/html",    
  ".htm"          =>      "text/html",    
  ".js"           =>      "text/javascript",    
  ".asc"          =>      "text/plain",    
  ".c"            =>      "text/plain",    
  ".cpp"          =>      "text/plain",    
  ".log"          =>      "text/plain",    
  ".conf"         =>      "text/plain",    
  ".text"         =>      "text/plain",    
  ".txt"          =>      "text/plain",    
  ".dtd"          =>      "text/xml",    
  ".xml"          =>      "text/xml",    
  ".mpeg"         =>      "video/mpeg",    
  ".mpg"          =>      "video/mpeg",    
  ".mov"          =>      "video/quicktime",    
  ".qt"           =>      "video/quicktime",    
  ".avi"          =>      "video/x-msvideo",    
  ".asf"          =>      "video/x-ms-asf",    
  ".asx"          =>      "video/x-ms-asf",    
  ".wmv"          =>      "video/x-ms-wmv",    
  ".bz2"          =>      "application/x-bzip",    
  ".tbz"          =>      "application/x-bzip-compressed-tar",
  ".tar.bz2"      =>      "application/x-bzip-compressed-tar" 
 )

### Options that are useful but not always necessary:
#server.chroot               = "/" 
#server.port                 = 81
#server.bind                 = "localhost" 
#server.tag                  = "lighttpd" 
#server.errorlog-use-syslog  = "enable" 
#server.network-backend      = "write" 

### Use IPv6 if available
#include_shell "/opt/share/lighttpd/use-ipv6.pl" 

#dir-listing.encoding        = "utf-8" 
#server.dir-listing          = "enable" 

include       "/opt/etc/lighttpd/mime.conf" 
include_shell "cat /opt/etc/lighttpd/conf.d/*.conf" 

######### Options that are good to be but not neccesary to be changed #######

## bind to port (default: 80)
server.port                = 80

## bind to localhost (default: all interfaces)
#server.bind                = "grisu.home.kneschke.de" 

## error-handler for status 404
#server.error-handler-404   = "/error-handler.html" 
#server.error-handler-404   = "/error-handler.php" 

## to help the rc.scripts
server.pid-file            = "/var/run/lighttpd.pid" 

###### virtual hosts
##
##  If you want name-based virtual hosting add the next three settings and load
##  mod_simple_vhost
##
## document-root =
##   virtual-server-root + virtual-server-default-host + virtual-server-docroot
## or
##   virtual-server-root + http-host + virtual-server-docroot
##
#simple-vhost.server-root   = "/home/weigon/wwwroot/servers/" 
#simple-vhost.default-host  = "grisu.home.kneschke.de" 
#simple-vhost.document-root = "/pages/" 

##
## Format: <errorfile-prefix><status-code>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix    = "/home/weigon/projects/lighttpd/doc/status-" 

## virtual directory listings
#dir-listing.activate       = "enable" 

## enable debugging
#debug.log-request-header   = "enable" 
#debug.log-response-header  = "enable" 
#debug.log-request-handling = "enable" 
#debug.log-file-not-found   = "enable" 

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot              = "/" 

## change uid to <uid> (default: don't care)
#server.username            = "nobody" 

## change uid to <uid> (default: don't care)
#server.groupname           = "nobody" 


Replies (1)

RE: Issue Starting Lighttpd - Added by gstrauss about 7 years ago

Undefined config variable: var.vhosts_dir

Please see the documentation for how to define vars. Docs_Configuration

    (1-1/1)