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
1 Answer
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
</Directory>
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
-
1Ok 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
www-data
user write access to the folder.