Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a windows 7 system.
On this system i am running a VM Virtual box LAMP Server with Ubuntu 12.04,apache2, mysql and phpmyadmin... which is accessable via the internet.

I installed Wordpress CMS and it is working ok. I am able to add new posts, pages, and change themes.

When i attempt to upload media i get the following error

file391.jpg has failed to upload due to an error
Unable to create directory wp-content/uploads/2013/11. Is its parent directory writable by the server?*

When i go to the parent directory and look at the permissions i notice that the ownership of the folder is root.

Do i change owner? Should i create a new user or user group called worpress and give it ownership???

Not sure how best to do this on a Web server.

share|improve this question
see this post to change ownership of a folder… – Avinash Raj Nov 7 '13 at 5:20

Apache2 is using the group www-data. You may want to add your current user into the www-data group by executing : sudo useradd -g www-data username.

Alternatively, you can do a recursive chown to the web root folder. To do this, issue the following command : sudo chown -R www-data:www-data /var/www

share|improve this answer
how do i know what group apache2 is using??? – adam Nov 10 '13 at 6:47
Ubuntu (and Debian) uses www-data as default user and group for apache2 by default. You can specify other users to join the www-data group though. You may want to check the contents of the umbrella file apache2.conf which will have something like User ${APACHE_RUN_USER} and Group ${APACHE_RUN_GROUP}. – Chester Nov 11 '13 at 1:48
You can also use apache2ctl -S to display your current setup. – Chester Nov 11 '13 at 1:54

Your Answer


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.