Step | Command | Description |
1 | ~$ ssh root@host-url | Using your client computer, establish a terminal session on your server host using root account. Use your server host’s network address for “host-url”. |
2 | ~# adduser wp-ops | Add the “wp-ops” user id for WordPress administration. |
3 | ~# usermod wp-ops -aG sudo | Add the “wp-ops” user id to the sudo group. |
4 | ~# exit | Terminate terminal session. |
5 | ~$ ssh wp-ops@host-url | Establish a terminal session on your server host using “wp-ops”. |
6 | ~$ sudo apt update | Update your system’s repository listing. |
7 | ~$ sudo apt upgrade | Update your system’s software. |
8 | ~$ sudo apt install apache2 | Install the Apache2 package. |
9 | ~$ sudo chown -R www-data:www-data /var/www/html/ | Change ownership of the Apache2 root directory (recursively) to the Apache2 service’s user-id and group. (www-data) |
10 | ~$ sudo usermod -aG www-data wp-ops | Add the “wp-ops” user id to the Apache2 “www-data” group. |
11 | OPTION 1: ~$ sudo nano /etc/apache2/mods-enabled/dir.conf OPTION 2: ~$ sudo rm /var/www/html/* | OPTION 1: Using “nano” or another text editor, change the second line of this file from this: DirectoryIndex index.html index.cgi index.pl index.php index.xhtml inde$ To this: DirectoryIndex index.php index.cgi index.pl index.index index.xhtml inde$ Option 2: remove all files from the Apache2 root directory. |
12 | ~$ sudo systemctl reload apache2 | Restart Apache2 so the changes to the configuration file will take effect. |
13 | ~$ sudo systemctl status apache2 | Verify Apache2 is running. Press “q” to exit the display. |
14 | ~$ sudo apt install php | Install the PHP package. |
15 | ~$ sudo apt install libapache2-mod-php | Install the package with the libapache2-mod-php extension. Note: PHP extensions may be installed due to dependencies in pervious packages. This causes no problems. |
16 | ~$ sudo apt install php-curl | Install the package with the php-curl extension. |
17 | ~$ sudo apt install php-cli | Install the package with the php-cli extension. |
18 | ~$ sudo apt install php-mysql | Install the package with the php-mysql extension. |
19 | ~$ php -v | Verify PHP is running and it’s version number. |
20 | ~$ sudo apt install mysql-server | Install the MySQL package. |
21 | ~$ sudo mysql_secure_installation | Run the MySQL installation script and respond to prompts as necessary. |
22 | ~$ sudo MySQL mysql> create database wp_database; mysql> exit | Create a database for WordPress. My example uses “wp_database” as the database name. Use any name you choose. |
23 | ||
24 | ||
25 | ||
26 |