Wordpress Install

Wordpress Installation and Configuration Guide.
Prerequisites
- Create a sudo user on your server
- Install a LAMP stack
- Secure your site with SSL (can be done after)
Create a MySQL Database and User for WordPress
Log in to a MySQL administrative account (root):
Create wordpress database:
Create exclusive user for this database:
Flush the privileges so that the current instance of MySQL knows about the recent changes:
Exit the MySQL shell:
Installing Additional PHP Extensions
Install some of the most popular PHP extensions for use with WordPress:
Adjusting Apaches Configuration to Allow for .htaccess Overrides and Rewrites
Enabling .htaccess Overrides
Create a configuration file in /etc/apache2/sites-available/
directory, that will allow .htacess
files
in /var/www/wordpress
(it will be the root directory of our wordpress installation):
And add the following, changing the fields with yourdomain.com
and www.yourdomain.com
:
The Directory
tag allows .htacess
files and the VirtualHost
tag,
creates a virtual host to be able to host multiple domains from a single server.
When you are finished, save and close the file.
Enabling the Rewrite Module
Next, we can enable mod_rewrite
so that we can utilize the WordPress permalink feature
Enabling the file
Disabling the default site
Enabling the Changes
Make sure we don’t have syntax errors:
If the output has a AH00558
message ignore it.
We only care about the SYNTAX OK message.
Restart Apache
Downloading WordPress
Download latest version:
Extract the compressed file:
Cd in the extracted directory:
Create a dummy .htaccess
file:
Copy over the sample configuration file to the filename that WordPress actually reads:
Create the following directory so as to not have permission issues later:
Cd out of the wordpress folder:
Copy the entire contents of the directory into our document root:
Configuring the WordPress Directory
Adjusting the Ownership and Permissions
Give ownership of all the files to the www-data
user and group (the user apache runs as):
We run two find commands to set the correct permissions on the WordPress directories and files:
Setting up the WordPress Configuration File
For the initial configuration, it requires the WordPress salt to be generated. This can be done using:
It will give a different output every time and will contain a list of salt values.
The output of the above command needs to be copied and added to the wp-config.php
file.
Open wp-config.php
:
Replace all the dummy values with the ones from the previous command.
Below are the dummy values from wp-config.php
to be replaced:
The wp-config.php file contains some Database configuration at the top.
Replace the DB_NAME
, DB_USER
, DB_PASSWORD
with values you have created for WordPress:
Also, you can add the file system method at the very bottom of the others:
Now the server configuration is complete! We can complete the installation through the web interface.
In your web browser, navigate to your servers domain name or public IP address: