I've recently set up wordpress, and I've been running through a couple problems that I think are related somehow. First: I couldn't change my permalinks, the classic 404 error that I've been reading tons of articles about without any giving a solution to my case. Second: I can't upload any media data as it says it can't be moved to wp-content/uploads, another classic. I'm going to post here my apache2.config and my 000-default.config so maybe someone can give me a hand to solve this. You'll notice that I've already set AllowOverwrite to All. https://pastebin.com/9J2g8L8y - Apache2.conf https://pastebin.com/Bp5pPZqp - 000-default.conf

  • You need to edit the permissions of the folder in order to be able to write to them Jun 30, 2017 at 19:11
  • Hi mate, thanks for this. Could you be a bit more specific? Jun 30, 2017 at 19:25
  • You need to give the www-data user write access to the folder. Jun 30, 2017 at 20:29
  • I'll check this out Jun 30, 2017 at 21:05

1 Answer 1


Under the assumption that your WordPress installation is in /var/www/html. Change this and other mentions of it to fit your setup.

Permalinks 404

You've set the AllowOverride All for /var/www, but your DocumentRoot is /var/www/html

Edit your /etc/apache2/apache2.conf, and add the following block into the file at about line 175

<Directory /var/www/html/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

Unable to Upload

From your command line, type sudo chown -R www-data:www-data /var/www/html

From your command line, type sudo chmod -R 777 /var/www/html/wp-content/uploads

  • This solved the problem, but denied me permissions to write on the wordpress folder, do you know how I can make both the www-data and myself the owners of the folder? Jul 1, 2017 at 14:33
  • 1
    Ok I applied your secondly given command to usr/share/wordpress after creating a local group with two accounts, www-data and myself, and giving this group control over the folder. That settled everything. Jul 1, 2017 at 14:59

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.