In previous blogs, we learned how to set up WSL, PHP, a WordPress database, and configured a new host in Apache. All these apps and configurations are necessary to continue with this blog, which is about setting up the latest version of WordPress.
Target location
Check if the target folder exists: /var/www
. If the folder doesn’t exist, create it. When you create the target folder, you will also need the appropriate permissions. Note that a subfolder called wordpress
will be created.
sudo mkdir -p /var/www
sudo chown demouser: /var/www
curl https://wordpress.org/latest.tar.gz | sudo -u demouser tar zx -C /var/www
Configure WordPress
sudo nano /var/www/wordpress/wp-config.php
- define(‘DB_NAME’, ‘wpdb’);
- define(‘DB_USER’, ‘demouser’);
- define(‘DB_PASSWORD’, ‘password’);
- define(‘DB_HOST’, ‘localhost’);
- define(‘DB_CHARSET’, ‘utf8’);
- $table_prefix = ‘wp_’;
Update the unique phrases, https://api.wordpress.org/secret-key/1.1/salt/
Start WordPress installation
The only thing left is to configure Apache, then start your browser and open your website. The WordPress installation wizard will guide you through the installation process. If everything goes well, your website should be up and running within minutes.