TWD 25 WordPress Day 2 1
Day 1 Review Describe the difference between a static website, a dynamic website, and a content management system. Describe the layers of a CMS like WordPress. Compare basic aspects of the most used content management systems. 2
Day 1 Review (cont’d) Install a WordPress website on a local server. Configure and customize a WordPress website using the Twenty Twenty WordPress theme. Add content to a WordPress website. 3
Morning Objectives Install a WordPress website on a live server. Define the three primary reasons for using HTTPS. Migrate a WordPress website from a local server to a live server. 4
Installing WordPress on a Live Server 5
Local Server versus Live Server A local server is only on your computer and no one else can access it. A live server is “on the internet” so it can be accessed from any device. Now we are going to work on a live server... 6
Live Server Features Installing WordPress on a live server will generally involve… • cPanel (or something similar) • FTP • phpMyAdmin 7
Installing WordPress - Steps (live server) 1. Download and extract the core files from WordPress.org. 2. Login to your Portfolio Site's cPanel to: a. Create a database b. Create a username/password. c. Add the user to the database. 8
Installing WordPress - Steps (live server) 3. Rename wp-config-sample.php to wp-config.php and add the database name, username, and password to connect the files and database. 4. Upload the whole WordPress installation folder to your Portfolio via FTP (FileZilla). 5. Open the site in a browser to begin the installation process. 9
Installing WordPress - Video (live server) Download the video tutorial showing how to install WordPress on a live/remote server from the Program Files FTP server. 10-WordPress-Development / Video-Tutorials 10
Step 1 - Download WordPress Download & extract the core files from WordPress.org. 11
Step 2 - Login to cPanel cPanel is the Control Panel on many hosting servers. cPanel is your portfolio site’s online dashboard. cPanel access (replace “USERNAME”): https:// USERNAME .bcitwebdeveloper.ca/cpanel Your password will be your BCIT ID. 12
Databases in Hosted Environments On a live/remote server, phpMyAdmin has no option to create or drop databases. Creating and deleting databases is done from MySQL Databases in cPanel. 13
Step 2a - Create a Database Name your database and click Create Database. Note: Your database will begin with a prefix created by the server, you are only typing the end of the name. 14
Step 2b - Create a User / Password Create a user for this specific database. Use the password generator then copy/paste the password somewhere temporarily. Note: Your username will begin with a prefix created by the server, you are only typing the end of the name. 15
Database Users Database Users ≠ WordPress Users Do NOT use your personal passwords for Database Users because anyone with access to your files can read it when you paste it into wp-config.php . Always use the Password Generator when setting passwords for Database Users. 16
Database Users Local Live/Remote MAMP - root / root Database users are created by you WAMP - root / ‘’ for specific databases. 17
Step 2c - Add User to Database Select the Username you created and the Database you created and click Add. On the next screen, check All Privileges, then click Make Changes. 18
Step 2 - Confirm Check under the Current Databases section. Verify that the Database User you created appears next to the Database name you created. 19
Step 3 - Edit wp-config.php In the newly extracted “wordpress” folder, rename wp-config-sample.php to wp-config.php. Add info from cPanel… ...don’t forget the prefix for the database name and user name. 20
Step 3 - Edit wp-config.php If you lost the password you can regenerate it in cPanel. Note: The hostname will almost always stay localhost even on a live/remote server. 21
Hosted Environment - Logging In Most hosting companies provide phpMyAdmin by logging into cPanel as a non-super user. Though it's on a remote server, it still gives the server name as localhost because MySQL and this phpMyAdmin are local to each other. 22
Hosted Environment - Defaults A server running MySQL version 5.5.3 or higher should have the server connection collation set to utf8mb4_unicode_ci . If earlier, it should be set to utf8_general_ci or utf8_unicode_ci . 23
Step 4 - Upload the Folder Rename the extracted wordpress folder and then upload the folder to your portfolio server with your FTP application (FileZilla). 24
Step 5 - Install in the Browser Open the site in a browser to begin the installation process. Access live site: https:// USERNAME .bcitwebdeveloper.ca/ FOLDER 25
Step 5 - Install in the Browser Select the language, then fill in the details. Note: If you are asked to input database details, then you have not created the wp-config.php file. 26
Login to WordPress Admin Add /wp-admin to the end of any WordPress site URL to access the admin dashboard. Tutorial: https://www.linkedin.com/learning/wordpress-5-essential-training-site-administration/admin-panel 27
Installing WordPress - Tips Always download and extract a new core file pack from wordpress.org. The database name/user/password is NOT the same as your WordPress site username and password. Do NOT use 'admin' as a WordPress username. Use longer and safe passwords. 28
Hosted Environment - Upload Sizes Check with your host to determine their default values for uploading files. Example: SiteGround sets it to 128MB but you can increase it by editing the php.ini file. http://php.net/manual/en/ini.core.php 29
Securing Sites with HTTPS 30
Securing Sites with HTTPS Every website you upload to a server should be using HTTP S instead of the unencrypted HTTP. Let’s look at why this is needed and how to do this... 31
HTTP HTTP is not encrypted and is able to be read and manipulated by a third-party. For example: • Intercepting a form submission on a website. • Injecting malware or advertisements on a website. 32
HTTPS HTTPS adds another step before transmitting data: the handshake. The handshake verifies that the server and browser are both who they claim to be through the use of TLS/SSL Protocols and Certificates. Then data is transmitted in an encrypted connection. 33
Why You Need HTTPS Security - Encryption of data between the server and the browser. SEO - Google uses HTTPS as a ranking factor. Performance - Every major browser requires HTTPS to use HTTP/2. 34
Let’s Encrypt Let’s Encrypt launched in December 2015. It’s a service that generates free and auto-renewing TLS/SSL Certificates. Many hosting providers use Let’s Encrypt: https://community.letsencrypt.org/t/web-hosting-who-support-lets-encrypt/6920 35
Create the Certificate 1. Login to cPanel on your server. 2. Switch your cPanel theme to x3 . 3. Scroll to the Security section and click on Let’s Encrypt . 36
Create the Certificate 4. Select your domain. 5. Choose an SSL Type. 6. Click Install . 7. Wait for the certificate to install. 37
Force HTTPS 1. Edit the .htaccess file from your WordPress directory. 2. Add the following code to the top of the .htaccess file and upload the file: Note: Copy code from https://wp.bcitwebdeveloper.ca/instructor/force-https/ 38
Always Use HTTPS Every website you make going forward should be served over HTTPS and forced to only use HTTPS. If a hosting provider doesn’t offer free TLS/SSL Certificates… find a different hosting provider. 39
Migrating WordPress Websites 40
Migration Types New Server, New Domain Example: localhost/website to website.com Example: website.com to new-website.com New Server, Same Domain You switch hosting services but URLs remain the same Same Server & Domain, New Folder Example: Rename folder Example: Move site from a subfolder to the root 41
New Server, New Domain This is a full migration. For example... Local server to remote server: localhost/website to website.com Remote server to a different remote server: website.com to new-website.com 42
Local Server to Remote Server Let’s migrate the Vancouver site from our localhost server to our live server. Note: If you haven’t finished the tasks from yesterday you can still do them after the migration so please follow along. 43
WP Migrate DB Pro We will use the paid WordPress plugin WP Migrate DB Pro provided in the Program Files FTP. Please download all three zipped folders now. 44
WP Migrate DB Pro WP Migrate DB Pro allows us to connect WordPress websites so we can Push and Pull databases and files between both WordPress websites. We will treat our localhost site like a staging or development site, and our remote site like a production or live site. 45
Migrating WordPress - Steps 1. Install the three WP Migrate DB Pro plugins and enter the license key on both WordPress websites. 2. On the remote site… a. Copy the Connection Info. b. Toggle on Push. 46
Recommend
More recommend