These instructions assume that PHP
, Mysql
/ MariaDB
, and Apache
have already been setup on the Ubuntu 16.04 installation, and instructions for such preparation can be found here: Setting Up Apache 2.4, MariaDB, and PHP 7 with Ubuntu 16.04 on a Digital Ocean VPS.
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
mysql -u root -p -ve "create database test"
mysql -u root -p -ve "create user 'test_user'@'localhost' identified by 'password'"
mysql -u root -p -ve "grant all privileges on test.* to 'test_user'@'localhost'"
mysql -u root -p -ve "flush privileges"
mkdir wordpress && cd wordpress
wp core download
wp core config --dbname=test --dbuser=test_user --dbpass="password"
wp core install --url="localhost/wp" --title="Test" --admin_user="admin" --admin_password="password" --admin_email="user@domain.com"
rm wp-config-sample.php
define('FS_METHOD', 'direct');
to wp-config.php
wp plugin install wordpress-seo --activate
wp theme install thebesttheme --activate
wp theme delete twentyfourteen
wp theme delete twentyfifteen
wp theme delete twentysixteen
sudo mv wordpress/ /var/www/
sudo chown -R ubuntu:www-data /var/www/wordpress/
setgid
bit to cause new files to inherit group of parent directory: sudo find /var/www/wordpress/ -type d -exec chmod g+s {} \;
wp-content
directory: sudo chmod g+w /var/www/wordpress/wp-content
wp-content/themes
directory: sudo chmod -R g+w /var/www/wordpress/wp-content/themes
wp-content/plugins
directory: sudo chmod -R g+w /var/www/wordpress/wp-content/plugins
VirtualHost
: sudo a2ensite wordpress.conf
sudo systemctl restart apache2.service