This page was linked from Building a WordPress website from scratch
If you don’t have a WordPress friendly online website or a local web developer environment setup you may want to go back a step.
Advertisement:
Downloading WordPress
- Goto https://wordpress.org/download/ and click download.
- Extract the files (if on Windows, Mac OS X does this automatically).
Where do you want your blog to live
WordPress can be installed..
- at the top of a website (e.g http://www.seanwes.com)
- into a sub folder http://www.yourdomain.com/blog
- into a sub domain http://simon.fearby.com
- or a sub folder on a sub domain (e.g http://simon.fearby.com/blog/ )
- or on your your local pc into an Apache (XAMPP installation).
- You can install multiple WordPress instances on the save domain or sub domain (they just need to be in different folders and connect to different databases)
If you are installing WordPress online make sure you have a working domain or sub domain, can access the files (via FTP) and have a reliable internet connection.
If you just created a website or sub domain you may need to wait a day or so for the replication of the name across the host servers or internet.
Creating a Database and Database Users online on a CPanel host
This section will guide you through creating database, username etc on a CPanel host (online server)
- Login to your online CPanel host (e.g http://www.yourdomiain.com/cpanel )
- Click MySQL Databases
- Under the Create a New Database heading next to New Database: Enter a database name (e.g “wordpressdatabase” ) – Obfuscate the name bit to put off hackers if you wish.
- – Note:Before you click Create Database check to see if you have text in front of the database name text field (e.g “server_”), if you do the will be prefixed to your database name.
- Click Create Database, Write down the database name that as created and click go back.
- On the same page under the MySQL Users – Add a new user heading type the name of the database username (e.g “blogusr“) – Obfuscate the name bit to put off hackers if you wish.
- – Note:Before you click Create a User check to see if you have text in front of the username text field (e.g “server_”), if you do the will be prefixed to your database username.
- Use the Generate Password button to generate an 18 character password (click advanced options and change the length to 18). Sample database username password “cvS+J}#.+CTXD^%{!q“
- – Note: Write down the Password (you will never see this again).
- Not we can assign the user to the database and grant permissions. On the same page under the MySQL Users – Add a User to a Database heading select the user and database that you just created and click Add.
- User the Manage User Privileges screen tick the ALL PRIVILEGES checkbox and press Make Changes.
- Congratulations you have now created a MySQL database, user and assigned the user to the database.
- Your database is now ready to use and write all of the details down (you will need them
Creating a Database and Database Users locally with XAMPP
- Make sure your XAMPP Apache and MySQL services are running in the XAMPP Control Panel
- Open http://localhost/phpmyadmin
- Click the Databases tab
- In the database name textbox enter your database name (e.g “w3bsit3_database“). Try and scramble the database to prevent hackers who will try and guess it.
- Change the Collation to “utf8-general-ci“
- Click Create
- Click the Home icon just under the phpMyAdmin graphic at the top of the left hand frame.
- Click the Users tab in the right hand frame.
- Click Add user
- In the username textbook enter a username (e.g “bl0gdbu5er“) – Scramble the username too.
- Change the host to “localhost“
- Set and confirm a password (make it as long as possible and use and many characters and special symbols as you can). Goto https://grc.com/password if you want a secure password. A good example of a strong password is “tb:<`q4M_c*>T\{}a{j3!{\bRTS-Yf>wbF/Cx+q9`}C\cy}hY?JyJESaTZXsvi%”.
- Click Check All user the global privileges section.
- Click Go
- Congratulations you have now created a MySQL database, user and assigned the user to the database.
- Your database is now ready to use and write all of the details down (you will need them).
Updating WordPress Config
- Go to the folder where your WordPress was saved to and rename the file “wp-config-sample.php” to “wp-config.php”.
- Open the file “wp-config.php”, these are the values we need to update
- Paste in your database name into the DB_NAME name field. e.g “define(‘DB_NAME’, ‘server_wordpressdatabase‘);
- Paste in your database username into the DB_USER name field. e.g “define(‘DB_USER’, ‘server_blogusr‘);
- Paste in your database password into the DB_PASSWORD name field. e.g “define(‘DB_PASSWORD’, ‘cvS+J}#.+CTXD^%{!q’);
- Now the most important part, we need to obtain some encryption keys from https://api.wordpress.org/secret-key/1.1/salt/.
- Goto https://api.wordpress.org/secret-key/1.1/salt/ and copy and paste the page contents to the clipboard.
- Now go back to the “wp-config.php” page and scroll down to where you can see “define(‘AUTH_KEY’, ‘put your unique phrase here’);“
- Delete the 8 lines with “..put your unique phrase here..” in them and paste over the contents from https://api.wordpress.org/secret-key/1.1/salt/
- Your config file should look something like this.
- You are now ready to upload or copy WordPress. Write down your databasename, username, password and WordPress salts.
Copy or Upload WordPress to your web servers htdocs folder
- Not is the time to decide if you want WordPress to live at the top of the site or in a sub folder. Create any folders that you need to now.
- If you re just installing WordPress on your local PC copy the WordPress fils to your XAMPP htdocs folder (and or into the desired sub folder).
- If you are uploading the files to a CPanel host online. I recommend you use the https://filezilla-project.org FTP software to upload files to your CPanel server. TIP: Set your Maximum simultaneous transfers/uploads/downloads to 1 and set a download limit of 100kb and upload limit of 50kb if your site locks your out for uploading too fast (Most hosts do this to prevent hackers hitting the server too hard).
- WordPress is made up of many small files so please be patient uploading to a CPanel.
Installing WordPress
If you have created the database and user and edited the config properly you re not ready to install and configure WordPress.
- If you are running WordPress locally open your web browser and navigate to http://localhost or of you re using CPanel navigate tho your domain where you up-loaded WordPress to (e.g http://www.yourdomain.com ).
- If all is ok you will see a WordPress setup wizard asking you to set the default language.
- Enter your Blog Title (you can change this later).
- Enter a Super User/Admin username (this username will be used as a back door back int he site so don’t make it your name and don’t pick a normal admin name like “admin”, “su” etc as hackers may guess it). Add a few random chars at the end of the username to stop hackers.
- Choose a very strong password, I’d strongly suggest you use a password form https://www.grc.com/passwords.htm (changing some characters if you wish).
- Write the username and password down as you won’t be able to get this again.
- Login to the site with the new username and password.
- Now lets take a backup of the site just incase we stuff up anytime after this.
User Accounts
WordPress is a popular platform, and hackers like popular platforms because they know where the login pages are if there are any exploits available in those platforms.
We can mitigate the damage from hackers by using strong salts (configured during setup, disabling/renaming the admin account, installing security plugins or renaming the login page but the most effective way to protect your site is to update plugins frequently, use a strong and unique passwords (don’t use the same password on different sites).
Personally you should be checking to see if any of your accounts have been compromised with sites like https://haveibeenpwned.com and consider using password managers like http://www.1password.com to generate and manager unique passwords for your sites.
If you do create extra logins for others to access your site don’t give away too much access and consider installing plugins to tighten what access people get.
First Backup
Before you do anything on your site our need to make a backup (critical step before applying a theme with sample data). It is a good idea to make frequent backups of all of your data (not just your WordPress site). WordPress is quite robust but things may go wrong, you may get hacked, the host may go bankrupt or have an unrecoverable server crash, you may screw something up or want to roll back your site to an earlier version.
Here are the three golden rules of backup:
- Backup to three different places.
- At least two of the backup locations need to be on different media.
- One of the locations needs to be offsite.
Offsite Backup
Choose a few of the following offset backup options.
- Apple Time Machine
- Manual File Copy (copy files to a removable drive frequently).
- http://www.crashplan.com/ – Automatic local machine backup for windows and Mac.
- http://www.backblaze.com/ – Automatic local machine backup for windows and Mac.
- Gmail – zip up the files and email them offsite.
- Dropbox
- OneDrive etc
How to backup your local XAMPP WordPress
Database Backup
You can easily backup your database my logging into your http://localhost/PHPMyAdmin/ utility.
- Open your http://localhost/PHPMyAdmin/ program.
- Select your database (expand the treeview node).
- Click Operations
- In the Copy Database section enter a database copy name (e.g “blogdb_feb152015“) and click Go. This will create a hot backup on your server.
- Now click the Export tab.
- Select Custom – display all options.
- Scroll to the bottom (most options are advanced options, best to leave them alone unless you need them).
- Click Go, this will export all of your MySQL database tables and records and save it to a text file that can recreate your whole database. Save the file in a backup folder with today’s date and short description.
- Note: This has not backed up your media files just the data (post titles, body (minus media files), themes and plugins.
- Next: Backing up the files.
File Backup
Don’t backup the files unless you have backed up the database first (see above). Backing up the physical files of your wordpress site is easy.
- Browse to the htdocs folder of your XAMPP installation and zip it up.
- Add the date, time and short description to the end of the filename and store it next to the backup of your database files.
- Zip up the database and files and copy them offsite.
How to backup your local CPanel instance of WordPress
Database Backup
Backing up your CPanel instance of WordPresa is much like backing up a local XAMPP instance but first you need to login to your CPanel and click phpMyAdmin.
- Login to your http://www.yourdomain.com/CPanel/
- Select your database (expand the treeview node).
- Click Operations
- In the Copy Database section enter a database copy name (e.g “blogdb_feb152015“) and click Go. This will create a hot backup on your server.
- Now click the Export tab.
- Select Custom – display all options.
- Scroll to the bottom (most options are advanced options, best to leave them alone unless you need them).
- Click b, this will export all of your MySQL database tables and records and save it to a text file that can recreate your whole database. Save the file in a local backup folder with today’s date and short description.
- Note: This has not backed up your media files just the data (post titles, body (minus media files), themes and plugins.
- Next: Backing up the files.
File Backup
Don’t backup the files unless you have backed up the database first (see above). Backing up the physical files of your wordpress site is easy.
- Login to you online hosts FTP site with an FTP program.
- Browse to the htdocs folder of your XAMPP installation and copy it to a local folder on your local PC (this will take a while to download).
- Add the date, time and short description to the end of the filename and store it next to the backup of your database files.
- Zip up the database and files and copy them offsite.
Go back to Building a WordPress website from scratch
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]