-1

I'm an absolute beginner at lighttpd and I'm at my wits end trying to figure out what's gone wrong with the default settings that I've customized atm

debug.log-request-handling = "enable" server.port = 80 server.modules = ( "mod_indexfile", "mod_access", "mod_alias", "mod_redirect", "mod_dirlisting", "mod_staticfile", "mod_access", "mod_alias", "mod_accesslog", "mod_compress", "mod_expire", "mod_redirect", "mod_rewrite", ) server.document-root = "/var/www/html" server.upload-dirs = ( "/var/cache/lighttpd/uploads") server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/run/lighttpd.pid" server.username = "www-data" server.groupname = "www-data" server.bind = "10.0.3.15" # features #https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_feature-flagsDetails server.feature-flags += ("server.h2proto" => "enable") server.feature-flags += ("server.h2c" => "enable") server.feature-flags += ("server.graceful-shutdown-timeout" => 5) #server.feature-flags += ("server.graceful-restart-bg" => "enable") # strict parsing and normalization of URL for consistency and security # https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_http-parseoptsDetails # (might need to explicitly set "url-path-2f-decode" = "disable" # if a specific application is encoding URLs inside url-path) server.http-parseopts = ( "header-strict" => "enable",# default "host-strict" => "enable",# default "host-normalize" => "enable",# default "url-normalize-unreserved"=> "enable",# recommended highly "url-normalize-required" => "enable",# recommended "url-ctrls-reject" => "enable",# recommended "url-path-2f-decode" => "enable",# recommended highly (unless breaks app) #"url-path-2f-reject" => "enable", "url-path-dotseg-remove" => "enable",# recommended highly (unless breaks app) #"url-path-dotseg-reject" => "enable", #"url-query-20-plus" => "enable",# consistency in query string ) index-file.names = ( "index.php", "index.html" ) url.access-deny = ( "~", ".inc" ) static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) # default listening port for IPv6 falls back to the IPv4 port include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port include_shell "/usr/share/lighttpd/create-mime.conf.pl" include "/etc/lighttpd/conf-enabled/*.conf" #server.compat-module-load = "disable" 
2024-02-07 19:23:14: (configfile.c.2109) source: /etc/init.d/lighttpd line: 15 pos: 5 invalid character in variable name 2024-02-07 19:23:14: (configfile.c.2161) configfile parser failed at: = 

I haven't a clue why there's an error at line 15

Never mind I believe I've made a typo at the test command and got it check something it would obviously say was wrong

3
  • According to the error message the problem is in your init script /etc/init.d/lighttpd, not in the config file. Commented Feb 7, 2024 at 12:51
  • Strange I never touched that file but I'll include the lines around it here since I wouldn't even begin to know how to fix something I haven't gotten around to editing yet @GeraldSchneider PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/lighttpd NAME=lighttpd DESC="web server" PIDFILE=/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME Commented Feb 7, 2024 at 16:59
  • Please edit it into the question. It's unreadable in the comments . Commented Feb 7, 2024 at 17:02

1 Answer 1

0

Most people who are beginners make very, very obvious mistakes in judgement because they are too quick to judge rather than to observe

What is the difference between the next two lines?
/etc/init.d/lighttpd
/etc/lighttpd/lighttpd.conf

Do they look exactly the same, or are they different somehow?

/etc/init.d/lighttpd is an init script used to manage the lighttpd daemon.

/etc/lighttpd/lighttpd.conf is a configuration file.

The error message you posted 2024-02-07 19:23:14: (configfile.c.2109) source: /etc/init.d/lighttpd line: ... suggests to me that the test command you are using to check lighttpd syntax is wrong.

WRONG: lighttpd -f /etc/init.d/lighttpd -tt does not make any sense.

RIGHT: lighttpd -f /etc/lighttpd/lighttpd.conf -tt checks lighttpd configuration syntax for /etc/lighttpd/lighttpd.conf configuration file.

Never mind I believe I've made a typo at the test command and got it check something it would obviously say was wrong

Please observe that stackoverflow is not an email thread and that you should update the post to highlight the issue that you found, and then close the post as resolved.

Also observe that when you posted the errors in the error log, you did not post the command that you used, and it turns out the mistake was in the command that you use, which you failed to share in this post when asking "what am I doing wrong?"

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.