Most of the problems that people seem to have stem from the incorrect setting of permissions on the URD download directory. In this small post I will try to explain how to set them correctly so that URD functions without any problems. I am assuming Ubuntu, but largely the instructions here can also be used for other operating systems. I also assume basic skills in any unix-like OS and that you know how to work with a shell.

Anyway, installation of URD is rather straightforward. After unzipping the tarball, or installing the .deb, you'll have to run through an install script in the webbrowser that does most of the pre-configuration (like setting up a database, entering a user, etc). Then upon first start of the URD webpage, you'll end up in admin/config. There you have to fill in a few options including the download directory.

This directory has to be created first, which is plain and simple:

Code:

# mkdir my_download_dir

The directory then has the permissions of the default umask and has the ownership and group of the user that created the directory. We will have to correct that tho, as URD requires a different set of permissions. First I'm setting it up for a single URD user system.

The easiest way to do this is change the group to the user apache is running as, typically www-data on ubuntu (but may be many different things on other OS'es, like apache, nobody, www).

Code:

# sudo chgrp -R www-data my_download_dir

(note the dir is normally empty, but if you have started URDD already, it will have created a couple of other directories there. Hence the -R)

Then we have to set it up so that apache can actualy read and write it.

Code:

# chmod -R g+rwx my_download_dir

Make sure you enter the download directory in the admin/config page, and set the group to www-data as well. I suggest to set the download permissions to 66x (where x = 0,4 or 6); keep in mind that for files this means that 66x is set, directories will also get the execute bit set if there are other permissions on the directory (660 will be 770 for directories and 664 will become 775 for directories, etc) It will create all the other directories by itself and the permissions will be correct. If not, just rerun the commands on the main download directory: my_download_dir. The directories are created as user www-data too, if your own user is not a member of the www-data group, it is easiest to chown the directory to your own user:

Code:

sudo chown user -R my_download_dir

You can startup URDD then.

In case you want multiple users to give access to URD things should be organised a bit different. Instead of www-data we gonna use another user and group. Upon installation from the deb package, URD creates a user and group, both named "urd". If not run the install.sh script in the install directory, and it will do so (or create the user and group manually).

Second we need to add all the system's users (not URD's) as a member of the group urd. You can do this by editing the file /etc/group or running vigr. Just find the line

Code:

urd:x:123:

(with 123 being any number) and add all the usernames after it like this

Code:

urd:x:123:user1,user2,user3

Also add the user www-data to this group. This will make apache a member of this group as well.

No proceed as before, but user urd as a group instead of www-data:

Code:

# sudo chgrp -R urd my_download_dir

Code:

# chmod -R g+rwx my_download_dir

and set the configuration group option to urd as well.

You can chown the user of the download directory again, probably to a user that has admin privileges (your user) or use the urd user.

Basically that is it.

There are a few other options. If you don't want to start the urd daemon from the web interface but a startup script, it will typically run as root. You can specify it to drop its privileges to any user or group with the -u and -g options. Using urd in both cases would be a good start. The multi user setup can then be used or you have to add the urd user to the www-data group and use the single user setup.

Note to run chgrp, the user that runs the command has to be a member of the group you want to chgrp to.