89.24 WordPress Basic Setup


WordPress uses MySQL to store its data, including users. First connect to the database engine.

sudo mysql -u root

Next create the required databases users. Replace <secret> with a strong password:

CREATE USER 'wordpress'@'localhost' IDENTIFIED BY '<secret>';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';

Then be sure to restart the database server:

wajig restart mysql

Configure the database information for WordPress to connect to it:

sudo editor /etc/wordpress/config-localhost.php
');define('DB_HOST', 'localhost');define('DB_COLLATE', 'utf8_general_ci');define('WP_CONTENT_DIR', '/usr/share/wordpress/wp-content');?>

Probably best to protect the file against just anyone reading it:

sudo chmod go= /etc/wordpress/config-localhost.php

Now try it out either by visiting https://myhub.australiaeast.cloudapp.azure.com/blog or locally:

$ firefox localhost/blog

Provide the required site information:

Site Title: Kayon Institute
Username:   kayon
Password:   <new password>
Email:      kayon@togaware.com

Click the Install WordPress button
Click the Log In button

To allow wordpress to upgrade itself:

sudo chown -R www-data:www-data /usr/share/wordpress

sudo find /usr/share/wordpress/ -type d -exec chmod 750 {} \;
sudo find /usr/share/wordpress/ -type f -exec chmod 640 {} \;

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0