Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed Webmin on an Ubuntu Server where I host multiple websites. I create a new virtual host and new user for every website I host. My process is:

  1. Create a new user for the website
  2. SSH with that user and create a www folder (I think this is wrong?)
  3. Create a Virtual Host for the website
  4. Point the DNS to the server

Doing this allows the user to create files/folders and seems to serve the websites fine. I do however have problems with some frameworks/cms with permissions. eg wordpress cannot install plugins, I have to copy them manually. This leads me to beleive my permissions are not setup correctly.

Alternatively, I can skip #2 and let webmin/apache create the root www folder, which gives it the group/user www-data. But this prevents my created user from creating files.

I would like to know how can I modify my steps in order to allow the www folder (and subsequent files/folders) to have the correct permissions.

share|improve this question

2 Answers 2

Webmin is not designed for doing web hosting services.

But as such if you don't mind doing manual intervention let Webmin create the www directory then go into your system and change the group permissions for the new www directory to be set for the new group of the new user.

Typically when a new user is added a group is created for the same user. Give the group full access to the new www directory (chmod 770) and the user will be able to add content but no one else will be able to access the new www directory.

share|improve this answer
    
Thanks for the reply. I will give this a shot, it does make sense! –  neolaser Apr 18 '13 at 1:44

Reinstall the packages to get the correct permissions.

When you remove packages, some files are left behind such as configuration in case you were to ever reinstall the package at a later date, all your config, etc would still be there.

Before doing this, create backups if you don't already have one.

# This will remove ALL files
sudo apt-get purge pkgname

Now all files and directories belonging to that package should be gone. When you reinstall them, they should have the correct permissions.

If you're having trouble finding out which package a file or directory belongs to, don't worry. There is an easy solution to that.

Examples:

For a file:

$ dpkg -S /etc/deluser.conf
adduser: /etc/deluser.conf

For a directory:

$ dpkg -S /etc/ifplugd
wpasupplicant: /etc/ifplugd
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.