lighttpd help please

527 views
Skip to first unread message

Steven Teng

unread,
Feb 11, 2018, 5:26:59 PM2/11/18
to Alt-F
Hello all,

Total linux newb. Bare with me.   I've been trying to get webdav working via lighttpd.  I've followed the previous posts of changing the location of the server root.  In my case it is /mnt/md0/Webdav and ticking webdav.  (yes, I've saved to flash)

/mnt/md0/Webdav/htdocs was created. Permissions looks good "lighttpd network" 



starting in the lightppd webgui saids started, after refreshing, it is stopped.

"rclighttpd start" in ssh gets "Starting lighttpd: OK." without errors

So far I've tried removing the package, deleted all the remnants (left overs after uninstall), and reinstalled.

There is no log to attached because it is never created in /var/logs/lighttpd and don't know why.  Permissions looks good "lighttpd network" 


Things running are pretty much default except I enabled swat and minidnla.


I'm out of ideas.  Anyone out there can can point me in the right direction?



Alt-F-1.0, kernel 4.4.86
DNS-325 rev-A1

João Cardoso

unread,
Feb 12, 2018, 1:12:37 PM2/12/18
to Alt-F


On Sunday, 11 February 2018 22:26:59 UTC, Steven Teng wrote:
Hello all,

Total linux newb. Bare with me.   I've been trying to get webdav working via lighttpd.  I've followed the previous posts of changing the location of the server root.  In my case it is /mnt/md0/Webdav and ticking webdav.  (yes, I've saved to flash)

/mnt/md0/Webdav/htdocs was created. Permissions looks good "lighttpd network" 



starting in the lightppd webgui saids started, after refreshing, it is stopped.

I can't reproduce that.
Using *exclusively* the webUI, I first installed lighthttpd, then configure it, creating and specifying the server root through the Browse button and checking the other necessary checkboxes as shown:


Started it using the webUI and then accessing it though the webPage button (or on another tab on port 8080, as in http://dns-320l:8080)


pages can be accessed OK and logs are there (System->Utilities, View Logs -- listed ad "access" and "errors" (yes, not a good name...) and  no issues reported.

Also using https on port 8443, as in https://dns-320l:8443/ works OK after accepting the connection after the usual https "take me out of here!" warning due to the self-signed certificate, which is expected.

What have you done differently? Editing configuration files?

Deleting the package might not delete configuration files that the user might have modified, that is probably the reason why it doesn't works after reinstall.
After deleting the package, remove everything under /etc/lighttpd, /usr/lib/lighttpd/ and /var/lib/lighttpd.

And at first stick to the webUI until you are sure its' working.

Steven Teng

unread,
Feb 12, 2018, 2:17:28 PM2/12/18
to Alt-F
Hi João,

Thanks for responding and the pointers.  Here is the current config via gui after removal, cleaning up all location you've you've mentioned, and then reinstall via gui package manager.



Same results after saving to flash and clicking start in the webgui.  I do not see any access or error logs in the webgui utilites -> view logs. nor /var/log/lighttpd/


/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -t
Syntax OK



/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -D
gives off
2018-02-12 19:09:29: (log.c.118) opening errorlog '/var/log/lighttpd/error.log'                   failed: Permission denied

/var/log/lighttpd/ is empty
ls /var/log/lighttpd/ -la
total 0
drwxr-xr-x    2 lighttpd network         40 Feb 12 13:36 .
drwxr-xr-x    8 root     root           220 Feb 12 13:36 ..



I'm pretty sure I did a factory default going to rc5 or rc6 or to 1.0 gold.  I may have installed syncthing at one point in between.

Only conf changes I can recall  modifying is the httpd.conf to allow access to webgui via a vpn connection (VPN From Router)

I guessing this is somehow unique to my current setup and I may have to do a factory defaults.  I'm just hesitant since I don't want to mess with my raid 1.


 
Steve

João Cardoso

unread,
Feb 12, 2018, 8:07:09 PM2/12/18
to Alt-F


On Monday, 12 February 2018 19:17:28 UTC, Steven Teng wrote:
Hi João,

Thanks for responding and the pointers.  Here is the current config via gui after removal, cleaning up all location you've you've mentioned, and then reinstall via gui package manager.



Same results after saving to flash and clicking start in the webgui.  I do not see any access or error logs in the webgui utilites -> view logs. nor /var/log/lighttpd/


/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -t
Syntax OK



/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -D
gives off
2018-02-12 19:09:29: (log.c.118) opening errorlog '/var/log/lighttpd/error.log'                   failed: Permission denied

/var/log/lighttpd/ is empty
ls /var/log/lighttpd/ -la
total 0
drwxr-xr-x    2 lighttpd network         40 Feb 12 13:36 .
drwxr-xr-x    8 root     root           220 Feb 12 13:36 ..



the "opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied" error message is pretty clear...
Have you changed in the conf the user and group that the server is to be run under? The log folder permissions and ownership seems correct, so the only explanation is that the server is running under another user/group.
The default is
## Run as a different username/groupname.
server.username  = "lighttpd"
server.groupname = "network"


If you can't figure out what is happening/have changed, you might also want to debug if through syslog instead of creating the error log. by reading around
## If you want to log to syslog you have to unset the 
## server.errorlog setting and uncomment the next line.

Then, after starting the server, you can watch syslog by using the 'logread' command

logread
...
Feb 13 00:49:48 DNS-320L daemon.err lighttpd[1533]: (log.c.164) server started 

 

I'm pretty sure I did a factory default going to rc5 or rc6 or to 1.0 gold.  I may have installed syncthing at one point in between.

Only conf changes I can recall  modifying is the httpd.conf to allow access to webgui via a vpn connection (VPN From Router) 

I guessing this is somehow unique to my current setup and I may have to do a factory defaults.  I'm just hesitant since I don't want to mess with my raid 1.



As lighttpd is a disk-installed package, all its files and configurations are on disk, so a "factory reset" will not help (and disks/partitions/filesystems/RAID are used as they are found, no configuration is ever saved about them)

Steven Teng

unread,
Feb 13, 2018, 2:20:15 PM2/13/18
to Alt-F
João,

Thanks for all the time you've spent on this with me.  After pulling some hair out and digging around, I realized that my minidnla wasn't work as well.  

The culprit was me.  I notice some of my user permissions in many of the directories (/etc, /var, ..etc) that should not have been there.  It must have been a chown -R I messed up back in 2016 and never realized I did.

After some attempts in restoring the directory permissions and failing, I decided to 
1) disable "Boot Enabled"  of installed packages
2) rebooted
3) renaming Alt-f directory
4) reenabled packages
4) installed lighttpd

Yes, heavy handed, but i messed it up pretty bad

All is well and working now.

Thanks again for answering my pleas for help.

jaka

unread,
Dec 14, 2021, 3:32:30 PM12/14/21
to Alt-F
Hi João,

I've had the same symptoms as Steven described in the first post here. I followed your suggestions but with no success.
I could also change permissions for folders that lighttpd is using but with no success.

Then I commented those two lines in the config file:
##server.username  = "lighttpd"
##server.groupname = "network"

And then I could finally run lighttpd.
Later I was trying to find what is the default user - what user is running lighttpd with those two lines commented.

One thing I've tried was to manually change permissions of folder /var/log/lighttpd/ and allow access only for user root . Lighttpd has started with not problem but somehow modified permissions to drwxr-xr-x lighttpd network.

So who is running my lighttpd now?
Could my soultion somehow be dangerous?

Thanks for giving a new life to our old devices.

torek, 13. februar 2018 ob 20:20:15 UTC+1 je oseba ste...@gmail.com napisala:
Reply all
Reply to author
Forward
0 new messages