Forum archive
Solved! Moving WordPress to root folder to make it multi-site compatible
I need to use WordPress in multi-site mode and, from reading the WP documentation, I see that it won't work in a sub-folder so I've moved it from the /var/www/wordpress folder to /var/www.
Since this wasn't straightforward, I thought I'd outline the steps (which I discovered through a lot of searching and trial and error):
1) Delete the index.html file in /var/www.
2) Move the files from the /wordpress folder into /var/www.
3) Edit the Apache virtual hosts for ports 80 and 443 to point to /var/www.
4) Edit the directives in the WordPress config file to point to /var/www.
5) In the wp-options table in the wordpress database, change the siteurl and home fields to your site's IP address. Not sure if this is strictly necessary (or even advisable) but I did it and everything seems to be OK.
6) Log onto the web shell and enter the following command: chown -R www-data: /var/www
This last step changes the ownership of the root directory so that WordPress can write to it.
I hope that helps anyone struggling with this.
PS When you convert to multi-site, you will be asked to create a blogs.dir folder and, possibly, an .htaccess file. Make sure you set the ownership of thess to www-data (just like all the other files and folders in /var/www) so that wordpress can access them.
Thanks for that, hopefully it will help someone else (I'm sure it will). I read your initial post but had nothing useful for you. Only thing I'd suggest is that IMO step 6 would ideally be:
As it then will be owned by www-data user and www-data group. Obviously your way still works, but I think it is better to explicitly set the group as well.
For clarity (others reading this and finding it useful): You can just run that same command again after creating blogs.dir folder and .htaccess (or any other) file(s). The -R switch makes the chown command recursive ie the folder and all of it's contents.