Using Plesk panel to manage my website

Creating the webspace

Click on “add a new domain” (even if it’s a subdomain you can click on add a new domain, it doesn’t really matter) :

screen-shot-2016-12-08-at-16-52-10

 

Add your domain name or subdomain in the appropriate field:

screen-shot-2016-12-08-at-16-57-30

Choose “create a new webspace”. That’s the option I always choose even if it’s a subdomain of a domain that you have already added to your Plesk panel. I find this option better for managing each webspace (the folder in which you have the files of your website) separately.

IP Address: You shouldn’t have something to choose here. The default IP address of your server should be displayed. Note that if your hosting provider provides you with several IP adresses (several “Internet addresses” for your server) you can choose one from the list here.

Username: That’s the name of the virtual user who will own the webspace of your website. In server administration a user is a virtual user who will have some specific rights on the files of your website. It’s not a physical user like you and me. So enter a username here, it’s not about you, it’s just a username.

Password: Enter the password for this user. You may use this couple user/password later to access your server under specific conditions. So try to store this password in a safe place.

Click OK to save.

Et voilà! The webspace for your website is now set.

Creating the database

Click on “Databases”:

screen-shot-2016-12-08-at-17-08-41

Then click on “Add Database”.

Then choose a name for your database, you can remove the “admin_” prefix or leave it, it’s up to you:

screen-shot-2016-12-08-at-17-13-11

Related Sites: You can choose the webspace you have just created.

Leave the option “create a database user” checked, and create the user of your database. Like the user of your webspace, it’s a virtual user which has some rights on your database. So enter a username and a password, and click OK to save.

Your database and database user are created and associated.

The files of the CMS

To install WordPress, first download it from https://wordpress.org/

Then go to your Plesk panel, click on the File Manager of your webspace:

screen-shot-2016-12-08-at-17-42-46

Enter the folder “httpdocs” (that’s the main folder of your website):

screen-shot-2016-12-08-at-17-58-03

Click on “Upload” in the top menu and upload the archive of WordPress that you have just downloaded.

Then select this archive in your file manager, and from the top menu click on “Extract files”.

You may have a “wordpress” folder created with all the files in it.

Enter this “wordpress” folder with a double click.

Select all the files and folders which are listed.

Click on “Move” from the top menu and choose “httpdocs” as the destination folder:

screen-shot-2016-12-08-at-18-02-26

So all the files and folders are going to be moved one level up at the root of the “httpdocs” folder.

You’re almost done now. Your files are ready, your database is ready, you can now install.

To install, just enter the chosen domain name for your webspace in your browser.

You should start with the WordPress installation. Just follow the steps.

Troubleshooting:

There may be a big number of issues due to a big number of reasons! The first one may be that your server configuration doesn’t meet the requirements of WordPress. But the servers are nowadays largely compatible with WordPress requirements.

So due to the large number of reasons, Google is your best friend! Or not, in this case choose another search engine 😉 and copy and paste the error displayed on your browser when you try to reach your website or when you have an error. You may not be the only person in the world with this issue and you might find a solution on the web.

A classical issue concerns your domain name. You may have entered a domain name when creating your webspace whereas this domain name is not yet associated to your server. This is often the case when you buy your domain name and your server separately, or from two separated providers. So what’s happening here? You enter your domain name in your browser, your browser asks the Internet to display the files related to this domain name, the Internet looks for the computer (server) on which there are the files for this domain name, and (several options):

  • fails to retrieve the server (the DNS settings are not set)
  • shows the wrong files (your domain is associated to another server on which there are some default files for your domain)
  • shows another website than it should be: you don’t have yet bought this domain and it’s already owned by someone. Don’t forget to buy a domain name before trying to use it!

A quick solution is to go to your domain name panel, the panel of the provider from whom you have bought your domain name. Then go to the DNS settings, and, in case 1 reset the DNS settings to default (be sure you are not using your domain name or a subdomain already for another website), in case 2, the quickest solution is to create a “A record” from the DNS zone management of your panel, and point this record to the IP address of your server (remember you already have this IP address when you have created the webspace on your Plesk panel). This way your domain name will be associated to your server.

Wait a little bit until these new DNS settings are transferred (it may take up to 24h/48h) and retry afterwards in your browser. If it keeps not showing the installation of WordPress you may have some cache in your browser. Try with another browser or with the “incognito” mode of your browser.

The PHP settings

At the time we write this article, the recommended PHP version is 7.0. That doesn’t mean it is not working on an earlier version of PHP but it’s better if your hosting supports the 7.0 version. Indeed the operating system on your server may support several versions of the PHP language. Why are there several versions of a language? Because like everything in computer tech, nothing is frozen and things must adapt to their environment evolution. So programming language evolves as well in order to match its environment, to offer new capabilities and/or be faster. So it’s always something you will benefit from, but your hosting server must also support these evolutions.

From your Plesk panel, click on “PHP Settings”:

screen-shot-2016-12-09-at-18-22-59

Then you may be able to choose a suitable version:

screen-shot-2016-12-09-at-18-24-49

You can also adjust some settings of PHP. Indeed PHP has some settings set with default values, but these values may block you to perform some actions. For example a setting at 2M for “upload_max_filesize” will block any upload of files that weight over 2Mb. When you create your website you may want to upload images which weigh over 2Mb, so you can adjust this setting to a more comfortable value like 16M for example:

screen-shot-2016-12-09-at-18-28-47

Although you have set this item to a suitable value you may still have your files rejected when you try to upload them. If so, do the same with the post_max_size value, this item has the same function than the previous one but the upload is done through another PHP function.

These items, “memory_limit” and “max_execution_time”, can be used if it takes very long to load your website and fails. You may increase their values and test.

So all of these settings may be involved in the functioning of your website/software and the errors you may encounter. You have to know, all the PHP items are not displayed here, these are only the most used ones. We will see in another article how to access all the PHP settings to change them.

Adding a cron job (scheduled task)

What’s a cron job? It’s an automated task. Sometimes you may need something to be launched every day at a specific time, for example. And so you may want to automate this task. That’s the job of the cron job, launching a specific action at a specific date.
Most of the time, the action required by a CMS or any other kind of web application, is to launch a file periodically. This file will contain a code to execute some specific actions. These actions could be, for example, to send a message to all users every morning at 9am, or to restart a game every night at midnight, etc.

So if your web application asks you to create a scheduled task, a cron job, you can do that from the menu “Scheduled tasks” of Plesk:

screen-shot-2016-12-12-at-14-14-27

You may have access to this menu from a shortcut on the right, or you can also access to it from the left menu in “Tools & Settings” > “Tools & Resources” > “Scheduled Tasks”.

Now let’s see how to setup a scheduled task.

Click on “Add task” to create a new task.

screen-shot-2016-12-12-at-14-17-39

Task type and command

Your web application may tell you what kind of task you have to run. Most of the time it is about launching a file in which a code must be executed. This file can be part of a command like:

/var/www/vhosts/yourdomain.com/httpdocs/file-to-launch.php -f >> /var/www/vhosts/yourdomain.com/httpdocs/logs/error_log.php

In this example, the command asks to run a file named “file-to-launch.php” with an argument “-f” and to send the results to a file named error_log.php. This kind of file is used to record the errors that may happen when launching the file “file-to-launch.php”. The argument “-f” allows the server to monitor the files that are changing. Just take the information at the moment, we will see this in more detail during the server knowledge class.

Run

From there you have to choose a frequency to execute the task. It can be every day to every year, or at a specific day of the week, at a specific time, etc.

System user

As we have seen previously the webspace of your website, the space on your server in which you have put the files, is owned by a virtual user that you’ve created when creating your webspace. The best option is to make this command run by the user who owns the webspace, except if the documentation of your web application tells you another thing.

Description

It’s just in case you want a description for this cron job. It can be for example “Task to send a message in my WordPress website”.

Notify

Choose if you want to be notified when this task is launched. Be aware if you choose “Every time” you will receive an email every time the task is launched and so if your task is scheduled to be launched every day you will receive an email every day.

Using a SSL certificate

You may want to use a SSL certificate to make your website accessible only through a secured connection (“https”). To do that you need to set a SSL certificate for your domain. With the latest Plesk versions it is very easy to do so thanks to the “Let’s Encrypt” extension.
From the left menu, go to “Extensions”.
Click on the “Let’s Encrypt” extension.

screen-shot-2016-12-12-at-15-40-29

Choose your domain.
Enter your email if different and check the “www” option (this way your domain will be protected for both www.yourdomain.com and yourdomain.com), and click “Install”.
Here we go! Your website is now protected and can be reached by using a https connection (https://www.yourdomain.com).