WordPress on OpenWRT

Jump to navigation Jump to search

...first of all to answer the question: "Can WordPress run on OpenWRT?" The answer is a resounding: YES!

But as usual, there's a catch, or rather catches.

  • You'll need a 'beefy' router. At minimum an equivalent to the Linksys WRT1900 series (dual 1.x GHz CPUs) with external storage, etc.
  • And as usual, there are all sorts of OpenWRT things to do.

See this 'Definitive Article' on configuring the above mentioned external storage, Apache, PHP, etc.: Linksys AC Series Router Configuration Tips for OpenWRT - Wiki.TerraBase.info (Basically all the information is here to turn it into a full blown server)

The Catches

Error Attempting to Add or Delete PlugIns, Media, etc.

When attempting to add or delete a plugin, add media, etc. (IE, anything that requires proper directory / file permissions), here's a mind bending error message if things are set correctly: " To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host "

On the surface it seems like a simple file / directory owner /permissions issue. But what if everything is set correctly?

OK, next possibility is the HTTPD / Apache Service / Daemon User / Group doesn't match the above file and directory owner / permissions. But what if it does match?

IE, User and Group are set to Apache:Apache / apache:apache / www-data:www-data, etc, depending on your flavor of Linux. For OpenWRT it's apache:apache (if set up as noted in the above 'Definitive Article'), and all ownership is set to apache:apache, Directories are set to 755 permissions and all Files are set to 644 permissions. Good to go, right? Nope. It still doesn't work.

If the PHP7-FPM Service is set up and running (and it should be), there's one more thing to do;

  • In /etc/php7-fpm.d/www.conf, change / modify the following lines;
    • user = apache (default is user = nobody)
    • group = apache (default isn't set)

...ah, deceptive. Even if Apache / HTTPD is running as "apache", the WordPress WebSite will be running as the PHP7-FPM User. And if it's set to "nobody", the above error will occur.