I'm trying to setup LAMP on my Ubuntu server and got most of it working, but I'm struggling with permissions..

Right now I can't install wordpress b/c it is unable to write the config file.. And on a wordpress installed I moved from my old server, it won't let me upload any images.

I guess this is a permission issue, but I'm unsure how to solve it..

A few screenshots of my settings

enter image description here

enter image description here

public_html is where files are stored..

I used these tutorials to setup Apache, FTP, phpmyadmin



But I got confused about all the chown and chmod parts..

Can anyone spot from the screenshots, what I have done wrong and how do I correct it?

If more information is needed, please tell me..


Reviewing your output it looks as if Apache is running under the user account 'www-data". However your files/directories are owned by 'martin:martin'.

sudo chown -R www-data:www-data /var/www/
sudo chmod -R 755 /var/www/

The above chown (change owner) command will make the directory owner 'www-data' which will match the service owner for Apache. The second command sets the correct permissions for the public_html directory.

If the above does not work for you include the following.

A clear description of how far you got in the tutorials along with exactly where you are stuck in the process.

  • OS, Apache, Wordpress versions
  • Include httpd.conf
  • Include apache log
| improve this answer | |
  • Thank you.. I think the www-data user was made in desperation when I tried all possible fixes i could find on forums.. But I can now upload images and installed the wordpress on the other domain.. – Xenosis Oct 18 '17 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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