Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases &...

21
By Ryan Stevenson Guidebook #1 – Website Hosting cPanel

Transcript of Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases &...

Page 1: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

By Ryan Stevenson

Guidebook #1 – Website Hosting cPanel

Page 2: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Table of Contents

1. Access cPanel

2. Email Accounts

3. MySQL Databases & phpMyAdmin

4. Website Backups & File Manager

5. FTP

6. Subdomains & Addon Domains

7. Install WordPress with QuickInstall

8. Manual WordPress Installation

9. Cron Jobs

Page 3: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Access cPanel

On most servers, you can simply add /cpanel on the end of your domain name to reach the cPanel.

For a website, example.com, this address would reach the cPanel:

http://example.com/cpanel

Another option is to add :2082 to the end of your domain name. 2082 is the default port number used for cPanel.

http://example.com:2082

When you visit the cPanel on your domain, you will need to login using your hosting account username and password.

After you are logged in, you will see numerous sections of icons on the right-hand side of the page. In this guide, the most important of these sections and icons are discussed.

Page 4: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Email Accounts

In the Mail section, the main icon you will use is the first icon, Email Accounts.

From here, you will be able to create new email accounts, get settings from your accounts to access them in email programs (like Outlook, Windows Live Mail, etc), and even access them directly through your cPanel.

On the Email Accounts page, you can easily create a new email account by simply providing the desired email and domain name and your password. Then, just click the Create Account button.

Once you have created an email account, it will show up in a list below the box where it was created. If you click on the More link, it displays two additional links: Access Webmail and Configure Email Client.

If you click on Access Webmail, you can actually access this email account directly through your cPanel. You'll be prompted to select a web program to use and will also have to provide the login information for the email account.

Page 5: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Since the web programs for accessing your email are fairly limited and also annoying to use if you have more than one website, you can access your email through desktop based software email clients like Outlook or Windows Live Mail (this is recommended if the email is used or needs to be checked on a regular basis).

If you click on Configure Email Client, it will present you with a variety of options you can use to connect to this email account through other software. For certain software, automatic configuration files are available to download to easily install the email account.

For other email clients like Windows Live Mail, for example, just look for the Secure SSL section of settings. Just take note of the Incoming Server and Outgoing Server information (address and port numbers). Simply provide this information in your email client.

IMAP and POP3You may notice in the Incoming Server settings that two different port numbers are provided – one for IMAP and the other for POP3. You actually do not need both of these numbers, but you will need to decide which one to use. These are actually methods used to connect to an email account and can change your experience using your accounts depending on your choice.

With an email client, you are actually typically downloading the emails from your server.

IMAP synchronizes with the server mail account. This means that when you open/delete an email in your email client, it will be marked as read in both the email client and on the server. If you access your email from more than one computer, it is very important to use this setting, although I typically recommend it anyways (if you get a new computer, you would end up downloading every single email again with them marked as unread and be a bit lost).

Page 6: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

With POP3, you simply download the emails from the server and all are marked as unread in your email client initially. This setting isn't supported by some email clients, like Windows Mail in Windows 8.

Troubleshooting TipIf you have any problems accessing your email account using these settings, it could be a problem with the username. First, try using the entire username as provided in the information box with the domain name included – some people will leave off the domain name and not realize what is going wrong. If that does not work, try replacing the @ symbol in the username with a + symbol in your email client. I have found that some servers and/or email clients won't work with the @ symbol properly but will using a + symbol.

Page 7: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

MySQL Databases & phpMyAdmin

In the Databases section, MySQL Databases and phpMyAdmin are the most commonly used icons.

MySQL DatabasesOn this page, you can create and manage your databases and database users. This is the backbone of the database system – if you delete a database from this page, it will completely wipe it out forever with any information that was in it.

The steps below describe how to create a new database for use.

Look for Create New Database and then give then database a name. Click the Create Database button when finished.

Once the database is created, you'll be shown a message. Click on the Go Back button – there is more to be done before the database can be used.

You should now see the database listed on the page. You may notice that Users in the database is blank. This needs to be corrected to be able to use the databse.

Look for MySQL Users on the same page. You will first need to create a user to go with this database (always create a new user to go with each new database for security reasons). It is OK to give the database user the same name as the database and can also make it easier for you to remember when it

Page 8: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

comes time to use these settings elsewhere, like in website scripts. After you provide the information, just click Create User.

When the user is created, you'll be shown the username and password – be sure to click on the Go Back button again to perform one last task to be able to use the database.

The last thing that needs to be done is to add the user to the database. Below where you created the user, look for Add User to Database.

Select the User and the Database you created, and then click the Add button.

When you add the user to the database, you will be asked to select privileges for the user. For most purposes, you will simply want click on the All Privileges checkbox to select everything, and then click on the Make Changes button.

Page 9: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Once the privileges are set, the database is ready for use. You could connect to it using the settings you just created through a website script. If you manually install some website software, like WordPress for example, it will ask you for database information.

phpMyAdmin

When you want to create, edit, view, export or delete information from your database manually, phpMyAdmin is the easiest way to do it.

When you visit phpMyAdmin through your cPanel, you will see a listing of the available databases on the left-hand side of the page. Just click on the database name that you created to work with it.

Information is stored in the database using tables for organization. Each table has a set number of columns, each of which will contain a specific piece of information. As information is added to the database, new rows are created and each row will have information for each column.

The steps below describe how to create a new database table.

Give the new table you want to create a Name and also specify a Number of columns to use. For this tutorial, I will actually be using three columns and not two, as pictured below.

Page 10: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Next, you will need to provide the information for each column for the database table.

For most purposes, you will not need to fill out everything here. The most important aspects are discussed below.

ColumnThis is the name of the column and should be unique. There are some names that are not allowed to be used here, so try to give your names a prefix of some sort, even if it just a single letter, to avoid this potential problem.

TypeThis controls what type of information is allowed to be stored in this column. INT and VARCHAR are two of the most commonly used types. INT is for whole numbers (up to 2,147,483,647) and VARCHAR is for text (up to 255 characters long). Decimal is for decimal numbers, BIGINT is for larger whole numbers, and TEXT/BLOB are for text larger than 255 characters.

Length / ValuesIf you are using certain types, like INT or VARCHAR, you need to provide a maximum length in characters for the column data. For INT, 10 is the max you can use and 255 is the max for VARCHAR. Some types, like TEXT and BLOB do not need anything here.

DefaultIf you want a column to have a default value for all rows, just select As Defined in the drop-down box and then enter the default value in the text box below it.

IndexThis defines whether a column is indexed or not, which allows for faster searching when used properly. In general, when you create your table, do not use this unless the column will be marked as AUTO_INCREMENT. In that case, select PRIMARY here as the Index.

After you create a table, if you want row values for specific columns to be unique among other columns, simply add a UNIQUE index to the column. If you plan to use a column to search for information in this database table (through a web script, for example), add an INDEX index to the column.

You can define more than one column as UNIQUE and/or INDEX columns, but PRIMARY should

Page 11: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

only be used once per table and must be set for one column in each table.

AUTO_INCREMENTThis is used with the PRIMARY Index and an INT Type column. For each new row created in the table, this column with count up in numbers automatically. This is an easy way to give id numbers to rows in database tables, and the id numbers can then be used in web scripts for easy identification of database rows.

Page 12: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Website Backups & File Manager

In the Files section in cPanel, you can easily backup and restore your website through the Backups icon or upload/edit/delete files from your site using File Manager.

BackupsIf you visit the Backups page, there are a variety of options available for you.

The Full Backup option at the top will backup your entire website hosting account including files, email accounts, and databases. However, it is very important to remember that these Full Backups cannot be restored through your cPanel – they can only be restored through the server administration, which most people do not have access to using shared hosting accounts (VPS and Dedicated servers have access to this – WHM).

Since most people use shared hosting accounts, you will want to use Partial Backups so that you can actually restore these backups if the need arises.

Download a Home Directory Backup to backup the files and email accounts. Download a MySQL Database Backup to backup database tables and information.

Either of these two partial backup types can be restored through this same page.

Page 13: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

File Manager

The File Manager is basically FTP access to a site but through cPanel, which allows you to upload new files, change existing files, or even delete them entirely.

In the File Manager, you will see a list of folders down the left-hand side of the page. Look for the folder called public_html. Everything within this folder can be accessed through your public website.

If you are using multiple domains on the same hosting account, you will likely also notice the domain name folders in the public_html folder. These domain name folders act as public_html folders for those specific domains, so everything within each folder contains the public files for that domain name.

Most of the actions that can be performed on files are available through the icons at the top of the page. You can easily create new files, new folders, copy/move/download/delete/edit files, and even upload new files/folders to your site here. If you want to perform one of these actions on a specific file or folder on the site, simply select it in the window and then click the button.

One particular thing worth mentioning in a bit more detail is the Change Permissions icon. Permissions can be set for any file or folder on a site. Some website scripts that require manual installation will direct you to change the permissions on a file or folder (also called CHMOD sometimes, which is a PHP command that is used to change permissions). In most cases, a script might direct you to set a folder to 755 or 777 to allow scripts to write files to that folder.

If you need to change permissions, simply select the desired checkboxes to achieve the desired permission numbers. Permissions of 644 are commonly used to limit the access of particular files on your site, like configuration files. However, unless an installation guide has specifically told you to change permissions, then you will likely not want to mess with them.

Page 14: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains
Page 15: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

FTP

FTP works is a very similar manner to the File Manager, except that you will need to use dedicated software to connect to FTP.

Personally, I use Cute FTP, which you can try free for a month, but there are also freeware FTP programs out there, which may be good enough for those that do not use FTP very often (I use it daily).

FTP is recommended to use if you have a large number of files to upload or if you want to upload a single file that has a large filesize. It has a more reliable connection for uploads like this.

To connect to a site in a FTP program, you simply need to provide your cPanel login information for that site. The Host that you specify for the site is your domain name with ftp. added to the beginning.

You can see below that I have set the host as ftp.downcomforterguide.com.

Page 16: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Subdomains & Addon Domains

The Domains section of icons in cPanel allows you to create or manage Subdomains and Addon Domains.

A Subdomain is used to add a prefix to your domain name that then acts like it is a separate website. For example, a site called example.com with a subdomain called demo could be accessed like this:

http://demo.example.com/

Addon Domains are used when you want to use more than one domain name on a single web hosting account. Technically, an Addon Domain is actually using a Subdomain to store the contents of the additional domain names, but then it redirects the Addon Domain to point to the Subdomain so it appears as though the domain is on it's own hosting account.

When you want to add more than one domain to shared hosting account, simply visit the Addon Domains icon to add it to your account.

Just provide the domain name and account login information for this new domain to create it. Once you create it, cPanel and FTP for the site can be accessed either using the main account information for the primary domain on the hosting account or using this new account information for this specific domain.

Page 17: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Install WordPress with QuickInstall

Under Software/Services, the QuickInstall icon provides you a wide variety of free software that you can easily install on your site.

QuickInstall is the fastest and easiest way to install WordPress on a new site. After visiting the QuickInstall page, just look for the WordPress link in the top-left menu links.

When you click on WordPress, it will present a Continue button that needs to be clicked to proceed.

Once you click on that Continue button, you are asked for additional information to complete the WordPress installation. Simply select the domain name where you want to install WordPress and enter your email and desired login information for the site.

Once you provide this information and click Install Now, everything will be done for you to get WordPress setup. You will then be presented with a link to your live site, where you can login using the

Page 18: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

provided account information to begin work on the site.

Page 19: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Manual WordPress Installation

If QuickInstall is not available in your cPanel (some hosting accounts do not offer it), you can always choose to install WordPress manually on a site. This can be a confusing process for those that have never done it before, but many of the confusing aspects of the installation process have already been covered by this cPanel guidebook (like creating a database manually).

To start, you will need to download WordPress from http://wordpress.org/

Follow these steps to install WordPress:

#1. Decompress (unzip) the WordPress package you downloaded to your local computer.

#2. Create a database through cPanel to use for the WP site. Then create a database user and add it to that database will all privileges.

#3. Upload all of the files and folders from the decompressed WP package to your website through FTP. You will want to upload these files to the directory where you want WordPress to run (in the public_html or the addon domain directory for most sites).

#4. Run the WordPress installation script and provide the information for the database and user you created. Type in your domain name followed by /wp-admin/install.php to access this script. If your domain was example.com, you would reach that script with this address: http://example.com/wp-admin/install.php

If you need additional help installing WordPress, you can take a look at their installation guide here:http://codex.wordpress.org/Installing_WordPress

Page 20: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Cron Jobs

In the Advanced section of icons, the Cron jobs link allows you to automate website script tasks. This is quite possibly one of the most misunderstood and yet most powerful features of cPanel.

WordPress is a great example of cron jobs. WordPress has a cron job system that will automate specific tasks on a website (like future scheduled posts, for example).

If you have ever used WordPress before and noticed that some of those automated features didn't work as expected (especially the timing of the automatic updates), it was because of the cron job.

When WordPress has a visitor to the site, it will look to see if the cron job needs to be called, but if your site doesn't receive daily traffic, then the cron job may not get called at all!

You can correct this by simply adding a real cron job entry in your cPanel for the WordPress cron job.

The first thing you need to know is the location of the Home Directory of your site. In cPanel, towards the bottom of the left-hand column, you can find some information for your hosting account that includes the Home Directory (as shown below).

Take note of this Home Directory because you will need it to create the cron job.

Now, click on the Cron Jobs link to get started. You will want to use the Add New Cron Job section at the top of that page.

You can specify the timing of the cron job here. For the WordPress cron job, you will want it to run once an hour – this can be selected from the Common Settings drop-down box.

Once you select that setting, the only other thing you need to do is provide the command for the cron job.

For the WordPress cron job, we want to run a PHP file once an hour. To do this, simply use the php command followed by the full directory path to the file that you want to run.

Page 21: Guidebook #1 – Website Hosting cPanel · 1. Access cPanel 2. Email Accounts 3. MySQL Databases & phpMyAdmin 4. Website Backups & File Manager 5. FTP 6. Subdomains & Addon Domains

Below, you can see the cron job that I created, which shows the full path to the WordPress cron job for this site. Notice the Home Directory at the beginning of the path, followed by public_html. After that, I have also used the directory for an addon domain on this account, downcomforterguide.com. Finally, I have specified the cron job file wp-cron.php. That file is located in the home directory of any WordPress site – you just need to figure out the full directory path to get to it to add it as a cron job.