This howto will outline how to install Apache httpd, MariaDB and multiple WordPress -stable and -development instances on your Centos (or other) Linux desktop so you can work anywhere, regardless of internet connection or not. These instructions can be easily adapted to any Linux system if you have enough specific knowledge of how your distro is setup.

    Note: these links may change in the future, if they become dead, please report it.

  1. Download WordPress -stable branch zip archive, do not use Yum to install WordPress.
  2. Root or sudo access to the Centos system

Doing the Work

Basic description of what will be done and what is expected.

  1. Edit /etc/hosts as root:
  2. Create web directories as root:
  3. cd /var/www/; mkdir -p local_dev wordpress1 wordpress2

  4. Install httpd, MariaDB and PHP and configure them as root:
  5. yum install httpd mariadb-server mariadb-bench php56u

    For instructions on setting up MariaDB go here.
    Add these lines to a new conf file located in: /etc/httpd/conf.d/localhost.conf

  6. Add Maria database container as root:
  7. mysql -p

  8. Download WordPress into the Documentroot and configure wp-config.php as root:
  9. cd /var/www/local_dev;
    wget https://wordpress.org/latest.zip; unzip latest.zip;
    cd wordpress
    mv wp-config-sample.php wp-config.php
    vi wp-config.php
    mv * ../
    cd ../; rm -rf wordpress

    Get a new set generated here: https://api.wordpress.org/secret-key/1.1/salt/

  10. As root, make sure MariaDB and httpd are started and and your web directories are all owned by the user/group your web server runs as (Warning: DO NOT DO THIS ON PRODUCTION SERVERS), in our case “apache”.

    Next, the commands below will affect everything under: /var/www/local_dev

  11. chown -Rf apache:apache /var/www/local_dev
    find /var/www/local_dev -type f -exec chmod 644 {} \;
    find /var/www/local_dev -type d -exec chmod 755 {} \;

  12. Restart httpd and MariaDB
  13. Next, open a web browser and go to http://local_dev

    You should be presented with the default WordPress install page.

    You can repeat this for as many isolated instances as you want on your laptop or desktop Linux workstation.

    Troubleshooting & Supplementary Information

    How to Test

    Explanation troubleshooting basics and expectations.

  14. Check the running status of mariadb and httpd:
  15. Check the VirtualHosts config in httpd:
  16. Check the /etc/hosts file:
  17. Common problems and fixes

    Describe common problems here, include links to known common problems if on another site

    Disclaimer

    We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #wordpress or #centoshelp on irc.freenode.net

Last Modified: 5 Dec, 2015 at 20:30:53