|⇐ Back||Page||Next ⇒|
Now that all the prerequisites are in place, we can finally install and configure WordPress!
- Change to the root of the user’s home directory, using the following command:
- Download the latest release of WordPress:
- Extract all the source files from the WordPress gzip archive, and then remove the downloaded archive:
tar xzvf latest.tar.gz && sudo rm latest.tar.gz
- Move all the source files from the wordpress directory to the root of the web server, and then remove the wordpress directory:
sudo mv wordpress/* /var/www/html/ && rm -rf wordpress
- To make sure all the WordPress source files are readable by Nginx, run the following command:
sudo chown -R www-data:www-data /var/www/html
- Use your web browser to visit your Raspberry Pi’s address, and assuming all has gone well, you will see the WordPress Locale page:
- Select your chosen locale, and click Continue. The Welcome to WordPress page will be displayed.
- Click Let’s go! The WordPress database connection details page will be displayed.
- Enter the details of the MySQL database that was setup earlier in this article. The example details were:
Database Name wordpress User Name wordpress Password Password1 Database Host localhost:/var/run/mysqld/mysqld.sock Table Prefix wp_
Make sure to enter the Database Host correctly so that the database connection between WordPress and MySQL will use Unix sockets, and completely bypass the need for any TCP-based network connections. Do not change the default Table Prefix unless you have a good reason.
- Click Submit. The All right sunshine! page will be displayed.
- Click Run the install. The Welcome to the famous five-minute WordPress installation process! page will be displayed.
Enter the details for your initial WordPress site setup.
- Click Install WordPress. The WordPress has been installed page will be displayed.
- Click Log in. The WordPress Log in page will be displayed.
Before logging in, we need to make a couple of final configuration changes.
- Use the nano editor to modify the WordPress configuration file:
sudo nano /var/www/html/wp-config.php
- Find the existing DB_COLLATE entry and amend the line so that it reads as follows:
/** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', 'utf8mb4_general_ci');
This fixes a bug in multisite creation that existed in version 4.2.2.
- Directly below the DB_COLLATE entry, add the following FS_METHOD line:
This line enables direct download of plugins and updates rather than using FTP, which is known to be problematic under certain circumstances.
- Just above the comment That’s all, stop editing! Happy blogging, add the following WP_ALLOW_MULTISITE line:
/* Multisite */ define('WP_ALLOW_MULTISITE', true); /* That's all, stop editing! Happy blogging. */
This line enables Multisite setup.
- Save and exit nano.
- Log in to WordPress!
You have successfully installed and configured WordPress! Now time to start customising your server with themes and plugins, and build that blogging site! 🙂
|⇐ Back||Page||Next ⇒|