dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

WebDAV and lighttpd help

Sun May 27, 2012 10:35 pm

Hello, I'm trying to make a online accessible file server so I can have one unlimited (harddrive limited actually) to store my files.

I tried following this guide ( http://www.howtoforge.com/how-to-set-up ... an-squeeze ), and have failed to make this work. I'm getting errors from the lighttpd package:


$ sudo apt-get install lighttpd lighttpd-mod-webdav apache2-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
lighttpd is already the newest version.
The following NEW packages will be installed:
apache2-utils lighttpd-mod-webdav
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/200 kB of archives.
After this operation, 500 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously deselected package apache2-utils.
(Reading database ... 46656 files and directories currently installed.)
Unpacking apache2-utils (from .../apache2-utils_2.2.16-6+squeeze7_armel.deb) ...
Selecting previously deselected package lighttpd-mod-webdav.
Unpacking lighttpd-mod-webdav (from .../lighttpd-mod-webdav_1.4.28-2+squeeze1_armel.deb) ...
Processing triggers for man-db ...
Setting up lighttpd (1.4.28-2+squeeze1) ...
chown: invalid group: `www-data:www-data'
dpkg: error processing lighttpd (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up apache2-utils (2.2.16-6+squeeze7) ...
configured to not write apport reports
dpkg: dependency problems prevent configuration of lighttpd-mod-webdav:
lighttpd-mod-webdav depends on lighttpd (= 1.4.28-2+squeeze1); however:
Package lighttpd is not configured yet.
dpkg: error processing lighttpd-mod-webdav (--configure):
dependency problems - leaving unconfigured
configured to not write apport reports
Errors were encountered while processing:
lighttpd
lighttpd-mod-webdav
E: Sub-process /usr/bin/dpkg returned an error code (1)


I can't seem to install it or remove/ lighttpd. Now everything I install leads to a /usr/bin/dpkg error after it, so its really being a pain in the butt. Does anyone know what to do about this?

Thank you.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: WebDAV and lighttpd help

Mon May 28, 2012 4:34 pm

"chown: invalid group: `www-data:www-data'" suggests that it's expecting a group named "www-data" - check your /etc/groups file and the groupadd command.
And fixing that might allow you to do 'sudo dpkg-reconfigure lighttpd'
(this is from memory, so may not be 100% correct)

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: WebDAV and lighttpd help

Mon May 28, 2012 6:45 pm

That looks familiar. i had similar probs with that www-data user/group combo
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: WebDAV and lighttpd help

Mon May 28, 2012 11:05 pm

How do I remove the www-data:www-data and replace it with the right group?

What file and where?

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: WebDAV and lighttpd help

Tue May 29, 2012 10:55 am

dh04000 wrote:How do I remove the www-data:www-data and replace it with the right group?
Short answer: you can't. It's the default group that the lighttpd package is trying to configure itself to use. So the only way to "fix" it would be to hack the lighttpd.deb file, which you don't want to be doing ;)

That's why I suggested using the groupadd command to add the missing www-data group. When you see "www-data:www-data" in the chown error, this is indicating user:group, i.e. a user called www-data and a group called www-data.

(I guess the www-data group is a "standard Debian" group which is why lighttpd is expecting it to exist, but for some reason it's been left out of the Raspi version of Debian?)

rich_
Posts: 1
Joined: Sat May 12, 2012 3:09 pm

Re: WebDAV and lighttpd help

Tue May 29, 2012 3:28 pm

Had the same problem today. Solved by editing /var/lib/dpkg/info/lighttpd.postinst

Edit the lines, replacing www-data:www-data to another groupname

Code: Select all

chown www-data:www-data /var/log/lighttpd /var/run/lighttpd
chown www-data:www-data /var/cache/lighttpd /var/cache/lighttpd/compress var/cache/lighttpd/uploads
For example (after groupadd www-data)

Code: Select all

chown www-data /var/log/lighttpd /var/run/lighttpd
chown www-data /var/cache/lighttpd /var/cache/lighttpd/compress var/cache/lighttpd/uploads
Now you can configure.

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: WebDAV and lighttpd help

Tue May 29, 2012 5:00 pm

Thank you all for the help so far! After I get home from work at 5-6pm I'll try out some of those changes and see what happens.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: WebDAV and lighttpd help

Tue May 29, 2012 8:09 pm

rich_ wrote:Edit the lines, replacing www-data:www-data to another groupname
After you groupadd www-data, I don't think you need to edit the postinst file.
chown (short for CHange OWNer) can be used in two ways:
chown user:group file
will change the owner of 'file' to 'user', and the group of 'file' to 'group'

chown user file
will just change the owner of 'file' to 'user', and leave the group unchanged.

(and there's also the chgrp command which can be used to change the group without changing the owner)

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: WebDAV and lighttpd help

Tue May 29, 2012 10:53 pm

I edited the /var/lib/dpkg/info/lighttpd.postinst file such that www-data:www-data now reads just www-data. I then saved over the file. Now when I try to reconfigure I still get this message. Any ideas on this?

sudo dpkg-reconfigure lighttpd
/usr/sbin/dpkg-reconfigure: lighttpd is broken or not fully installed

Also I can't restart lighttpd either

/etc/init.d/lighttpd force-reload
chown: invalid group: `www-data:www-data'
/mnt/EXTERNAL$ /etc/init.d/lighttpd restart
chown: invalid group: `www-data:www-data'


:(

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: WebDAV and lighttpd help

Tue May 29, 2012 11:46 pm

Don't edit the postinst file, just add the group www-data. It should be there by default on Debian systems I think, but obviously isn't with the image you're using.

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: WebDAV and lighttpd help

Wed May 30, 2012 11:28 am

Could you provide me with the example code for adding the group? I'm not familiar with this command

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: WebDAV and lighttpd help

Wed May 30, 2012 11:39 am

dh04000 wrote:Could you provide me with the example code for adding the group? I'm not familiar with this command
Neither am I. http://lmgtfy.com/?q=linux+groupadd

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: WebDAV and lighttpd help

Wed May 30, 2012 1:47 pm

AndrewS wrote:
dh04000 wrote:Could you provide me with the example code for adding the group? I'm not familiar with this command
Neither am I. http://lmgtfy.com/?q=linux+groupadd
Not kind dude...

I need more than a generic example, I need help making a command for this difficult situation.

Will this work for my situation?

useradd -G www-data <the username of my RPI?>

I don't understand groups, this is above my understanding of linux.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: WebDAV and lighttpd help

Wed May 30, 2012 1:52 pm

Sorry. I believe the command already posted by rich_ should do the trick:

Code: Select all

sudo groupadd www-data

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: WebDAV and lighttpd help

Wed May 30, 2012 5:48 pm

Ok, that command of sudo groupadd www-data worked.

No more errors being thrown anymore.

Now, lets see if I can complete the rest of this guide.....

This command: htpasswd -c /var/www/web1/passwd.dav test

Seems to specify the user "test", is this necessary, or can I make it my name, or does it have to be the user name of the RPi I'm using?

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: WebDAV and lighttpd help

Wed May 30, 2012 9:34 pm

Never done any of this myself, so I searched and found http://httpd.apache.org/docs/2.0/programs/htpasswd.html
It looks like this test user is one which only exists in webDAV, i.e. is independent of the 'normal' user accounts on the RPi. So you can call it whatever you want (but 'best security practices' recommend you should choose different passwords for your login-account and your webdav-account).

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: WebDAV and lighttpd help

Thu May 31, 2012 2:02 am

Ok, I dd the last part of the guide and tried this command:
cadaver http://www.example.com/webdav

Got this result:

Could not open collection:
302 Found
dav:/webdav/?

Does this mean the webdav is not working? I couldn't get connected from Win7, but I've looked at 3 different pages and have been told how to connect 3 different ways, so I'm not sure if I'm even doing it right.....

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: WebDAV and lighttpd help

Thu May 31, 2012 11:51 am

Hi,

I had exactly the same problem installing Lighttpd with the missing www-data grouop, I wish I'd found this post before, it took me a little while to pick through the issue, and finding out that simply running:

sudo groupadd www-data

.. before installing lightttpd was all that was needed

I put the solution on my blog, so I dont forget next time I come to install lighttpd, http://stuffaboutcode.blogspot.co.uk/20 ... httpd.html

LHIS
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

Return to “Beginners”