Installation
Chapter 08 – Installation
We are now at the half way point. At this stage, all the preparation for building your website has been completed. You should now have the following:
- Domain Name
- Hosting Account
- Database
- FTP Client
- Wordpress Software
At this time, we will suspend the “What is [..]“, “Why you need [..]“, and “How to [..]” format of the book.
The second half of this book contains a series of instructions for installing, configuring and maintaining your new website.
[private]
Uploading Wordpress
The first step to installing Wordpress is to upload the software to your hosting account. Depending upon the speed of your internet connection, this can take anywhere from a minute to fifteen minutes.
1. Open your FTP client and establish a connection to your hosting account.
2. Within the left (local) pane of your FTP client, navigate to the folder on your computers hard disk that contains the unzipped Wordpress software files. If you have not yet unzipped the file you downloaded from Wordpress.org, do that via your local file manager, and then navigate to that folder in your FTP client.
3. Within the right (remote) pane of your FTP client, navigate to the folder on your web hosting account that corresponds to the domain on which you wish to install Wordpress. If this is the very first domain on your hosting account, then the folder will likely just be “/www”. If you wish to install Wordpress on an Add-on Domain, then the folder will likely be “/www/domain.com”.
4. Select the files from the left pane and drag them over to the right pane. The left pane should show three folders – wp_admin, wp_content and wp_includes – and about 20 files. The right pane should be mostly empty, although it may show a cgi-bin (or _vti-bin) folder, or a single index or home file. Select all the files on the left side and “drag-and-drop” them into the right pane. This “uploads” a copy of the files from your computer to your web hosting account – the original files will remain on your computer. Make sure you don’t drop the files above a folder, or the files will be uploaded into that folder, not into the folder you are viewing.
When the process is complete, you will see a matching copy of each file from your local computer has been uploaded into your hosting account.
Wordpress Configuration File
Go to the folder on your computer in which you have unzipped Wordpress. You will notice that there is a file called wp-config-sample.php in that folder. This is a sample file that contains several programming variables required for Wordpress to run correctly.
1. Open this file in a text editor. If you open it in a word processor, ensure that when you save it, the file remains a simple text file, and doesn’t get converted into a word processor “document”.
2. Refer to the database you created in Chapter 5. You will need the database name, user name and password:
i. Replace putyourdbnamehere with your database name. For example:
define('DB_NAME', 'putyourdbnamehere');
becomes:
define('DB_NAME', 'prefix_dbasename');
ii. Replace usernamehere with your user name. For example:
define('DB_USER', 'usernamehere');
becomes:
define('DB_USER', 'prefix_uname');
iii. Replace yourpassword here with your password. For example:
define('DB_PASSWORD', 'yourpasswordhere');
becomes:
define('DB_PASSWORD', 'prefix_pword');
iv. Finally, the host name of your web host’s database server. In most cases, this will not need to changed from its default localhost setting. Refer to the email from your web host for specifics, but if you have signed up to any of the hosting companies we recommend, this will not need to be altered.
v. Go to the following URL to receive unique authentication keys.
https://api.wordpress.org/secret-key/1.1/
Take the code on the resulting page and replace the following lines:
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
vi. We now need to create a “table prefix”:
$table_prefix = 'wp_';
Wordpress builds a number of tables in your database, and should you install Wordpress several times (once for each website you build, for example) you will need separate tables for each installation. To prevent each installation overwriting information from a previously installed version of Wordpress, you need to create a table prefix.
To give you an example, Wordpress creates a table called posts which contains each web page you create. With a table prefix equal to the default value above, the table that would actually get created upon installation would be wp_posts. The next time you install Wordpress, you would need to chose a different table prefix to as not to overwrite the tables created during this installation. An easy rule of thumb is to have the table prefix reflect the initials of your website name. For example, for IncomePassport.com, we might choose a table prefix of “ip_”.
vii. Finally, when you save this file, it needs to be renamed to wp-config.php. Also, you need to ensure it remains a plain text file; do not save it as a Word document, Rich Text File or any other format.
Once your wp-config.php file has been created, you need to upload it into the same folder as the rest of the Wordpress files. You should see it next to the wp-config-sample.php file when you view the remote files.
Installing Wordpress
Once you’ve created your wp-config.php file and uploaded it, open your website in a browser. This will initiate the Wordpress installation. If you have correctly created the wp-config.php file, all that will be required is to enter the name of your website and your email address – Wordpress does the rest!
Here’s a little secret: if you go to your website after uploading the Wordpress files but without creating a wp-config.php file, Wordpress will create the file for you by asking you questions about your database. However, the automatically generated file does not create unique authentication keys. This is not critical for the running or the security of your website. By making you step through this manually, we are just making you more aware of how Wordpress works.
One Click Installation
If you have signed up to Blue Host, our highly recommended web hosting partner, you have the option to use their “one click” installation. This script installs Wordpress for you, without you having to upload the files or even create a database. Once again, in this book we make you step through the process manually so you can get a handle on how everything works together, but in future, whenever you set up a new domain, you can use this feature to install Wordpress with literally one click:
1. In the Software / Services section, click on “Simple Scripts”.
2. The resulting page will display a Scripts List. Under the Blogs section, click on “Wordpress”.
3. The resulting page will display Installation Options. Under the Install on an Existing Server section, click the “Install” button.
4. On this page, you get to choose your installation preferences. Most of the entries you can leave as the details. In Step 1, you can choose what version of Wordpress you want to install and where you want to install it. Ensure the latest stable version is selected (it should be by default) and then select the domain on which you wish to install Wordpress. In Step 2, you can enter the name of your blog, and the username and password to manage the blog. If you haven’t already created a database, you can leave “Automatically create a new database” selected; otherwise, uncheck the box and enter the details of the database you created from Chapter 5. Finally, in Step 3, you simply agree to the terms of use for this open source software and click “Complete”.
Whether you manually uploaded the files or used the one click installation, the end result will be you have Wordpress installed on your new domain. Congratulations – you’ve just installed your very first website!
