2

I'm setting up a private Ubuntu web server. In my company I'm used to a deployment where the home folder of www-data is in /home/www-data, but on my plain Ubuntu installation it is in /var/www.

Now how can I change this? With usermod -d? And is this a good idea anyway?

sspross
  • 151
  • 1
  • 1
  • 5

3 Answers3

3

The simple answer is:

usermod -d /home/www-data www-data

But keep in mind you are changing the Ubuntu apache defaults and maybe breaking some things. Check the Ubuntu docs for details here.

sspross
  • 151
  • 1
  • 1
  • 5
0
  • Are you using Apache web server?

  • You can still continue with the same default Document Root Directory "/var/www/html" but if you wish to change your document root directory, you can make the changes in your web server configuration file which you can find in "/etc/apache2/" (In case of ubuntu serve, please refer to this path for web server configuration file)

  • You should go through the Ubuntu server giude, It will probably answer your questions on getting your web server setup

    https://help.ubuntu.com/8.04/serverguide/httpd.html

Big Data
  • 114
  • 2
  • 11
  • Why are you linking to 8.04's server guide? We're on 12.10 now... and 13.04 has the same doc. https://help.ubuntu.com/13.04/serverguide/httpd.html – ceejayoz Apr 22 '13 at 16:10
  • Thanks for your answer! I will not use apache, I have a Django application server setup, so I think I can change the home folder of www-data with `usermod -d /home/www-data www-data` and leave the apache configuration as it is. What do you think? – sspross Apr 22 '13 at 16:13
0

If you need to have the dir contents moved, add the -m option to usermod:

usermod -m -d /home/www-data www-data
Cec
  • 101
  • 1