Recently, I had a friend ask about moving an HTML site into a WordPress framework. I’ve been an advocate of WordPress as a robust and user-friendly CMS (Content Management System) for a long time.
Whilst using WordPress to update site content is a simple process, the initial setup can be challenging for those without a development background. This post aims to assist the non-technical user with the initial setup of such a site.
WordPress runs off a database. You need to create a database to run a WP site and then connect the WordPress framework to it. This is easier than it seems so don’t give up right away!
The steps we’ll cover include:
1 – Create a database and a user with access to that database – the hard part.
2 – Download WordPress and edit the WP-Config file to connect the database to the framework (relax, I’ll talk you through it).
3 – Upload the WordPress framework to your hosting account (server).
4 – Run the WordPress ‘Famous 5 minute’ install.
Before you start, you will need the FTP details and the CPanel details of your hosting environment. You should have an email from your hosting provider supplying these. If you do not have them – get them now, before you begin. Got everything? Ok, let’s get started.
STEP 1: Create a Database on your hosting platform (server).
Requirements: CPanel access to your hosting environment, or equivalent. Note: This tutorial assumes the use of CPanel to access databases. Some hosting providers such as Mediatemple are moving toward a user interface that makes this step quite simple. Furthermore, many hosting platforms have customised WordPress setup options.
Explanation: When you sign up for web hosting you should receive an email that contains CPanel access logins – a web address (URL) where you log on using a username and a password.
You will need to complete a two step process here: create the database and then create a user with access to that database. Make sure you take note of the database name, username and password once you have created these.
- Log in to your CPanel.
- Find the Databases panel and create a new database by clicking on the “MySQL© Database Wizard” (see image 1.1).
- On the next screen (image 1.2) enter the name of your database to create it. Ensure you take note of the name of the Database. It should use a format similar to “yourdomain_dbname”.
- The next screen (image 1.3) will prompt you to setup a user. I recommend using the password generator, where available. Fill out all the fields, keeping note of the username and password, and click “Create User”.
- This step is essential. The next screen you see (illustrated in image 1.4) will allow the created user to access the database you created in the previous step. The user must have access to the database so WordPress can update it. Select ALL PRIVILEGES and then click “Next Step”
There you go – the database and user are setup. That’s the hard part done!
Just a side-note: WordPress will setup all the tables required within the database automatically – you do not need to. The ‘Famous 5 Minute Install’ (Step 4) will take care of this.
STEP 2: Edit the WP-Config file to connect to the database.
Requirements: The WordPress framework – download the latest version and use it. It is always best to start with a clean version. Have the database name, username and password accessible (these were setup in step 1).
Explanation: When WordPress is uploaded to your hosting environment the config (configuration) file will connect WordPress to the database you set up in the previous step of this tutorial .
- Download the WordPress framework and unzip the zip file to your desktop.
- In the WordPress folder on your desktop there is a file called wp-config-sample.php. Open this file in a text file editor such as Coda, Notepad or Text Wrangler. Any plain text editor will suffice but do not use Microsoft Word. Microsoft products tend to add hidden characters to your files that you do not want.
- On or around line 21 you will see the section in image 2.1.
- Edit the highlighted text of each of the first four ‘define’ sections. The lines should look like the list below when using the example database name, username, and password mentioned previously in this tutorial (image 1.3). NOTE: This is just an example. You will need to enter your own database name, username, password and host. You may need to get the name of the host (no. 4) from your service provider – use ‘localhost’ if you do not have any other hostname. View a list of the DB_HOST definitions for the major hosting providers here.
- Define(‘DB_NAME’, ‘madison_databasename’);
- Define(‘DB_USER’, ‘madison_newuser’);
- Define(‘DB_PASSWORD’, ‘CBK[ISF7NMU’);
- Define(‘DB_HOST’, ‘localhost’);
- Next, you will need change the ‘Authentication Unique Keys and Salts’ section. Generate the lines to replace the existing section using the link below. Click the link, copy the lines on the new page and then paste them into the last section highlighted in image 2.1.
- Save this file as “config.php” being careful to remove ‘-sample’ from the file name.
STEP 3: Upload the WordPress system to your hosting account (server)
Requirements : FTP access – this will include: server name, username and password.
Explanation: The FTP details are supplied in the email you receive when you purchase a hosting package. It is best to use a FTP client program such as Transmit for uploading files to your server. Filezilla is an FTP client that can be downloaded for free but is not as user-friendly as Transmit.
- Connect to your server using an ftp client (eg. Filezilla). Enter your connections details as per image 3.1. and select Quickconnect.
- Enter the Server (image 3.1 – 1)
- Enter the Username (image 3.1 – 2)
- Enter the Password (image 3.1 – 3)
If the connection is successful you will see the directory listing of your hosting space in the windows on the right hand side.
- Select all the files from the WordPress folder and drag them to your ‘root’ directory (image 3.1 – 4). The ‘Root’ directory is where your website files need to be. Some hosting providers will have a folder called ‘HTML’ or ‘public’ put the files in here if this option is available. There are a lot of files – this may take a couple of minutes. Coffee? Almond milk if you must.
Once the files are uploaded the WordPress framework is now on your server. Step 3 complete… we’re almost there.
STEP 4: Run the WordPress ‘Famous 5 minute’ install.
Requirements: Steps 1 – 3 of this tutorial.
Explanation: The database and user have been created (step 1), WordPress has been installed (Step 2) and the database has been connected to the WordPress framework (Step 3). Now, we let WordPress setup the tables required to run the website.
- Type your URL into the browser and add “/wp-admin/install.php” to it. Eg. http://www.yoursite.com/wp-admin/install.php. Select the language and then click ‘continue’.
- Fill out the Site Title, Username and Email fields. Make sure you record these. Whilst they are all editable at a later date it is worth noting that this username/password combination is used to access the back end of your site. Therefore, they are very important. These differ from the Ftp and CPanel passwords. It’s best to make a Evernote note or something similar to record all your username/password combinations.
- Leave the “Allow search engines to index this site” ticked.
- Click “install WordPress” and then wait for the success message.
You now have a working WordPress installation on your server. Using the WordPress username and password you can log in to the back end of your site and start curating quality content.
WordPress comes with some standard templates installed but to make your site look professional it is best to install a different template. Whether that is a custom built design or a template. As always, if you require assistance with the design or development of your site feel free to contact us.