Git Commands Cheat Sheet

No Git command cheat sheet would be complete without a section on the Git vocabulary, so we’ve included one to help you get to grips with how Git works and how the commands are run on various entities. In fact, let’s begin there:

Git Commands Cheat Sheet – Vocabulary

#

Git Command

What it Does

1 Bare Repository Repository that doesn’t have a working directory.
2 Branch An active area of development in Git. The newest commit displays the end of the branch.
3 Blame Refers to the most recent alteration to every line in the file. Shows Author, Revision, and Time.
4 Checkout This is talking about the process whereby a particular commit is chosen from the repository and the condition of the file associated with it and the directory tree are reproduced in the working directory.
5 Commit Record of a moment in Git history containing details of a changeset.
6 Diff The difference in changes between saved changes or two Commits.
7 Detached Head The state in which a specific commit is checked out rather than a branch.
8 Fetch Retrieves the most recent changes in the branch and the local or remote repositories.
9 Fork When you Fork the repository, you can add Commits and add Pull Requests.
10 Hash A unique SHA1 code for each Commit
11 Head The name of the Commit at the end of a Branch
12 Index A group of files that hold state information.
13 Merge Includes changes from named commits (from when their histories split from the current branch) into the current branch.
14 Master Git’s default development Branch
15 Origin This is the default Upstream Repository
16 Pull Request Suggests changes into the Master Branch
17 Push Pushes new changes once they’ve been committed
18 Repository A group of Commits, Branches and Tags to identify Commits.
19 Working Tree The directory of files that you are currently working on

Git Commands Cheat Sheet – Configuration

#

Git Command

Description

1 git config –global user.name Sets the username to be used for every action
2 git config –global user.email Sets the email to be used for every action.
3 git config –global alias. Generates a shortcut for the Git command.
4 git config –system core.editor Sets the text editor for all command actions.
5 git config –global –edit Opens global configuration file in the text editor to enable manual editing.
6 git config –global color.ui auto Turns on colour for command line outputs as a visual aid.

Git Cheat Sheet – Set Up a Git Repository

#

Git Command

Description

1 git init Initializes an empty Git repository in the current project.
2 git clone (Repo URL) Clones the repository from GitHub to the project folder.
3 git clone (Repo URL) (Folder) Clones the repository to a specific folder.
4 git remote add origin

https://github.com/username/(repo_name).git

Creates a remote repository that points to your current GitHub repository.
5 git remote Displays the name of remote repositories.
6 git remote -v Displays the name and URL of remote repositories.
7 git remote rm (remote repo name) Gets rid of a remote repository.
8 git remote set-url origin (git URL) Changes a repository URL.
9 git fetch Obtains the most recent changes from the origin but doesn’t merge them.
10 git pull Obtains the most recent changes from the origin and merges them.

Git Cheat Sheet – Local File Changes

#

Git Command

Description

1 git add (file name) Adds current file changes to staging.
2 git add . Adds changes for the whole directory to staging but without deleting files.
3 git add -A Adds every new, modified, and deleted file to staging.
4 git rm (file_name) Stops tracking a file and gets rid it.
5 git rm –cached (file_name) Stops tracking the current file.
6 git mv (file_name) (new_file_name) Alters the filename and gets it ready for Commit.
7 git checkout <deleted file name> Undeletes a file and gets it ready for Commit
8 git status Displays the status of modified files.
9 git ls-files –other –ignored –exclude-standard Displays a list of each ignored file.
10 git diff Displays staged changes in the working directory and index.
11 git diff –staged Displays differences in files between the most recent version and staging.
12 git diff (file_name) Displays changes between a single file and the most recent Commit.

Git Commands Cheat Sheet – Declare Commits

#

Git Command

Description

1 git commit -m “(message)” Saves changes along with a custom message.
2 git commit -am “(message)” Adds all changes to staging and saves them with a custom message.
3 git checkout Switches to the provided Commit.
4 git show Outputs content changes and metadata for a particular Commit.
5 git reset –hard Rolls back all history and changes for a specific Commit.
6 git reset –hard Head Rolls back all local changes in the working directory.
7 git log Displays change history.
8 git log -p Displays the full page for each Commit.
9 git log -oneline Displays a list of Commits and a simple message.
10 git log –follow (file_name) Shows the history of the present file.
11 git blame (file_name) Displays all changes and the user’s name.
12 git stash Does an Interim save of all tracked files that have been modified.
13 git stash pop Restores files that were stashed most recently.
14 git stash list Displays all stash changesets.
15 git stash apply Applies the most recent stashed contents.
16 git stash drop Gets rid of the most recently stashed files
17 git stash apply (stash id) Re-applies content of a particular stash by ID.
18 git stash drop (stash_id) Drops particular stash content by ID.
19 git push Pushes changes to the Origin.
16 git push origin (branch_name) Pushes branch to the Origin.
17 Git push -f origin (branch_name) Force pushes the changes to the Origin.
18 git tag (tag_name) Specifies a tag for a version.
19 git push Pushes changes to the Origin.

Git Commands Cheat Sheet – Branching

#

Git Command

Description

1 git branch Displays a list of every branch.
2 git branch Makes a new branch.
3 git branch -m Changes the name of a branch.
4 git branch -a Lists both local and remote branches.
5 git checkout -b Creates a branch and switches to it.
6 git checkout Changes to a particular branch.
7 git checkout -b origin/ Puts a remote branch from the origin in the local directory.
8 git branch -d Deletes the specified branch.
9 git merge Merges the current branch with the master (first checkout to master)
10 git rebase Integrates changes from one branch into another by rewriting the commit history to produce a linear succession of commits.
11 git rebase Rebases the current branch onto the base, which can be a Commit ID or a branch name.
12 git fetch remote Fetches the specified branch from the repository.
13 git diff .. Shows the differences between two branches.
14 git pull –rebase Fetches the remote copy of the current branch and rebases it into the local copy.
15 git push –all Pushes all the local branches to the specified remote repository.

Plesk and Git Support

Plesk lets you integrate with Git, because for most web developers it’s their go-to code management system. Git makes it easy to handle initial publishing and subsequent updates by deploying your website from repositories to a public directory.

Here’s how to get started with Git:

  1. Install the Git extension in Plesk.
  2. Create a domain in Plesk with a service plan that lets you give management permission to Git.

There are two types of repositories that you can add in Plesk, and you’ll choose the one that best fits your use case:

  1. Keep it local with a repository on your own machine. In this scenario, you send the changes to Plesk from your local repository, and then Plesk deploys the changes to your website.
  2. Use Git hosting remotely. You might want to do it this way if you’re already using a remote repository in BitBucket (bitbucket.org) or GitHub (github.com). You forward your changes to the remote repository, then Plesk gets them from it and deploys them to your website.

When you’ve got Git repositories enabled in your domain, you’ll be able to see a list of the ones that have been created on its page. For each one you’ll see the name, the current branch and the deployment path. The Deploy button (look it for it near the repository name) lets you deploy the files from a repository (if it’s been set up for manual deployment) and the Pull Updates button lets you get the changes from the remote repository.

Conclusion

It’s much easier to work on a complex project when you have a list of Git commands in front of you, so we hope that this Git command cheat sheet proves to be useful.

Guide on Website Management

Effective website management doesn’t demand a comprehensive understanding of web development. The two areas are very different.

A website is like a car: even the best models created by leading designers can’t run without a little maintenance here and there. Great websites may look sleek, polished, and perform to the highest standards — but only because of the experts working hard behind the scenes. And websites can break down or crash without regular maintenance to keep them in good condition, too.

However, the management of a website isn’t always as simple as it should be. Instead, it can be a complex process with many rungs on the ladder to success. In this post, we’ll explore effective web management in detail and cover the tools you need for the best results

1. Backup your site’s data

Do you back up your data from your computer’s hard drive on a regular basis? You need to do the same with your website.

The primary reason is because of potential issues such as cybersecurity breaches, network glitches, or hardware failures. You’ll be able to access your backup and get your site running again with minimal disruption.

Here are the main benefits of backing up your site and data for good web management:

Eliminate data loss

If website data is deleted by accident, either by yourself or a colleague, you could lose lots of hard work and face the risk of downtime. But with a backup, accidents won’t lead to such severe fallout.

Reduce revenue loss

When your website generates revenue through sales, every second of downtime can impact your profits. But regular backups can keep costly downtime to a bare minimum.

Cut lost time during a website renovation

You’ll have a lot of stored data if your website has been live for a number of years, such as images, product pages, content, and more. All this should be backed up when you’re renovating or even rebuilding your site.

Otherwise, years of hard work can go to waste and you’ll need to start building the website again from scratch.

You can take advantage of many website backup solutions, though you’ll need to research your options before you choose. Don’t worry, though — we’ve provided a few suggestions to help you save time:

Backing up your data with Plesk

With Plesk hosting platform you already have built-in backup solution which is capable to back up the entire server or/and individual websites, schedule these backups, perform them in full and incremental way and store backups locally and remotely.

For those who are addicted to WordPress, Plesk offers WordPress Toolkit – a single management interface that lets you simplify all management routines. With WordPress Toolkit you can clone a WordPress site, including all website files, database and settings, without the need for any third-party plugins

2. Stay on top of landing page performance

Landing pages are crucial if you utilize paid ads (e.g. PPC). These are the first pages visitors will reach when they click on an ad on a search engine results page or social media network, and they have to perform at their best to make a positive first impression.

However, landing pages can be affected by a number of common issues:

  • Heavy traffic may cause slowdown
  • Newcomers might struggle to understand what you’re actually offering
  • Your web server could be experiencing a glitch
  • You may be trying to sell products which are out of stock

Regardless of the problem, you’ll be able to spot it sooner rather than later if you check your landing pages regularly. Some of the best landing page tools include:

  • VWO Landing Page Analyzer: This creates a comprehensive report covering key parameters including focusing on the goal, relevance, persuasiveness, and more
  • UnBounce: This provides you with a free report on strategies with the potential to optimize your landing page conversions

3. Preparing for downtime and managing it right

Downtime refers to the length of time that your website is unavailable to visitors. Around half of all downtime is caused by equipment malfunctions, such as overheating processors or a power cut. While reliable hardware offers good protection, your website could still become inaccessible because of equipment malfunctions.

Common risks include:

Hosting issues

All websites are hosted on servers belonging to ISPs. The price these businesses charge can be high, but it’s a valuable investment to keep your site online 24/7.

A lot of ISPs claim to deliver uptime of 99.99 percent. This may seem amazing, but a couple of brief sums suggest otherwise. 0.01 percent of 24 hours is 8.64 seconds, and if you multiply this by seven, you get 60.48.

Across one month, this amounts to just over four minutes, and in a year, it’s around 52 minutes. That’s not a huge amount, but it could still cost you a few sales, especially if you experience significant downtime during a busy period.

We’re not trying to tell you that your website will be down for that period of time every day — you may not experience any downtime at all in any given month. But even if it’s down for a couple of hours one day and operating fine the rest of the year, you could still lose out due to hosting issues.

Keep that in mind when considering your website management strategy.

Attacks from cyber criminals

Cyber attacks are a common threat in the digital age, and two particular types pose a real risk:

DDoS attacks: During a Distributed Denial of Service attack, a hacker will keep your server flooded with requests. A server only has the ability to respond to a set number of requests, and if the incoming amount goes beyond this, your website server may crash.

Dangerous bots: Many hackers create bots with the ability to pick up on weaknesses in networks and vulnerable websites. They exploit any flaws they spot and bring websites down with ruthless efficiency.

So, we know a few reasons why downtime may occur. But how can you prepare for it?

Determine if your site IS down

Your website might appear to be down, but that may not be the case. You can use isitdownrightnow.com and similar sites to check.

Get in touch with your hosting service

You can reach out to your hosting provider to find out if they have a problem causing your website issues. But take a look at your email first, as the provider may let you know if they plan to put the server out of action temporarily ahead of time.

Identify if the issue is on your end

Any employees in your business who take responsibility for your website maintenance and/or development might be to blame for issues. For example, they could have taken an element out, made a problematic update on a plugin, or done any number of other things that disrupt your website performance.

Explore activities in the site’s backend to spot any adjustments that came before the issues, and once you know the reason, try to understand why it led to such a negative outcome. This will help you stop it happening again.

Finding a prevention is better than working on a cure after the fact in good management of a website. Take these steps to save your website from experiencing downtime.

Hire separate businesses to host your website and domain name

The domain name is your website address, such as facebook.com. It’s recommended to host your website files with one company and your domain name with another. Why? Because if your website goes down for any reason, the other host should have it up regardless.

Consider a hosting company offering monthly plans

Numerous hosting companies provide customers with competitive yearly plans, but a monthly deal should be available too. This is ideal to try the service and see how it measures up.

Make sure you assess your site’s hosting performance through tools such as Pingdom. If it’s all working well for you, you might want to change to the annual plan to make a long-term saving.

Back up your website on a regular basis

Your most recent website backup should be hosted by another company, to make sure your prospective and existing customers can access your site even when the main version is unavailable. This applies to all websites you may have, as part of responsible multiple website management.

4. Optimizing your database

Your website will have a database if it’s a subscription-based domain (such as a blog) or a store where products are updated regularly. This database features all the information you add to your site.

For good website management, you need to remember that each database brings responsibilities — including good database optimization.

Here are the benefits of optimized databases:

  • Take up less space
  • Encourage your site to load more quickly
  • Boost the security protecting your website data

You can approach this in various ways, but the quickest and simplest is to optimize your database with specialized solutions. You may want to consider:

5. Evaluate load times

Page load times are critical to effective web management. You need every page to load as quickly as possible to satisfy users. But over time, your website will have more and more content and a heavier database. This causes your site to send more requests to the server, and can increase the loading times.

Plenty of factors can lead your site to slow down, including:

Excessive plugins

Having an excessive number of plugins will lead to excessive lines of code in your site’s back-end, putting extra strain on your website’s server. That causes page load times to increase.

Image-heavy visuals

Most ecommerce websites are packed with images, resulting in extra HTTP requests for your server and longer load times.

Performance of your site server

Shared servers can be particularly problematic, as they host multiple sites and manage HTTP requests to various pathways. Servers that perform poorly will be unable to keep traffic to all of the sites running as smoothly as users expect. Load times will slow down as a result.

Heavy traffic

As a business-owner, you invest considerable funds in marketing to bring traffic to your site, but as your traffic volume increases, your server needs to process an incredible amount of requests.

As slow page loading can boost your site’s bounce rates, your traffic and conversion rates can suffer down the line. But checking on your page load speeds will help you stay up to date on potential issues. Try PageSpeed Insights or GTMetrix to run tests on your site’s speed.

Once you’ve done this, scour the test report generated by your chosen tool carefully to pinpoint issues increasing your load times. This will give you the insights you need to tackle the problem yourself or hire an expert.

6. Assessing website forms for potential risks

You may have subscription forms on your website, along with checkout forms and search bars. Hackers can leverage these via a technique known as SQL injection, which provides them with unwelcome access to your database. You should check the forms on your site regularly to ensure your visitors’ data remains safe from hackers.

You can use various tools to assess your site’s forms for vulnerabilities, including ScanMyServer and Acunetix.

7. Taking out elements that can be considered redundant

Websites generally don’t need all of the elements loaded with them, and some can actually cause it to slow down unnecessarily. These may include changes to content and spam comments.

Such redundant elements load along with critical ones when users visit your website. That’s why you need to practice good management of your website and clean it regularly — take advantage of such tools as WP Optimize or Autoptimize.

8. Evaluate the performance of your website on different devices and browsers

Your website’s device and browser compatibility was likely tested after it was developed. However, various updates may have changed its performance since — plugins you’ve installed, content you’ve uploaded, new lines of code you’ve input, etc. can all make a difference.

If one or more of these adjustments fails to sync with certain devices or browsers, your website may not function as it should. That can lead to a poor visitor experience, rob you of conversions, and disrupt revenue generation.

If you test your website’s compatibility across all devices and internet browsers regularly, you can continue to deliver a quality experience for your visitors. Choose from various tools designed to assess browser compatibility, including Lambda Test, TestComplete, and CrossBrowserTesting.

Want to evaluate your site’s compatibility with devices? Try BrowserStack and Katalon.

9. Paying attention to analytics

Your website’s analytics area carries key details about your visitors’ locations, the number of clicks, traffic channels, traffic volume, search volume, and more. Take the time to check this area frequently to understand how your website performs and gather insights you can use to optimize it. This can enable you to recognize potential performance issues with your landing pages.

While Google Analytics offers comprehensive details on your users’ behavior, this information can be considered number-intensive. Visualization can make data easy to understand, so have your site’s analytics visualized through Domo, Zoho Reports or Infogram for a simpler approach.

10. Effective management of situations related to customer experience

You have to take good care of your customers. Without them, how can you expect to generate the revenue you need?

Your customers keep you in business and deserve a quality website for purchasing products or services. That’s why it’s worth putting time into resolving customer-related issues as cleanly, quickly, and efficiently as you can.

Here’s how:

Create professional responses to reviews

Customer reviews can influence people’s decision to buy from your website. Opinions may start to differ as you make changes to your site, even if they’re intended to improve the experience visitors have. They might write a review to share their frustration and put others off using your site at all.

Alternatively, customers could be so impressed they’re compelled to recommend your site to fellow buyers via positive reviews.

In any case, it’s crucial to respond to reviews regularly. This makes the writer feel recognized and valued, and it can actually help to improve your search engine ranking too. Show customers that you pay attention to their feedback and engage them in a professional manner, even if their review enrages you.

Make maintenance pages on your website unique

Sometimes, it’s hard or even impossible to avoid downtime. Your website will need to be taken offline briefly to make crucial changes.

During your site’s downtime, visitors will be greeted with a dedicated page to inform them the website is under maintenance. But don’t go for a generic design — boost your customer engagement with a creative, valuable maintenance page instead.

For example, keep the text in line with your established brand voice. If your website has a quirky style, your maintenance page should too.

Don’t be afraid to embrace humor, such as a cute graphic that helps to combat the frustration people may feel when they find they can’t actually use your site when they want to. Include links to resources on other websites that customers could find helpful when your site is inaccessible.

One terrific “placeholder” page can be found in Google Chrome: when your internet connection fails, you’ll be presented with a pixelated dinosaur on a gray screen. This is actually a game you can play, and it’s a lot of fun!

11. Proper web management for key site elements

When we talk about “website elements”, we’re referring to everything included on the front end of your site and behind the scenes. Video, images, plugins, text, and all the other crucial components responsible to keep your website performing as it should.

But how do you manage your website elements? You can try the following techniques:

Keep content updated regularly

If you’re satisfied with your website’s performance and feel there’s no real need to adjust your content, you could actually be inhibiting your site’s growth without realizing.

As trends in online content continue to fluctuate frequently, your website can be improved by assessing how well your existing content aligns with said trends. Effective management of a website demands updating content as and when required, to cater to the latest visitor expectations.

That means putting time into research, but that’ll pay off when you drive more traffic, attract new customers, and boost conversions. Still, don’t rush into it: run A/B (or “split”) testing to determine if your new content actually performs better than the material it’s due to replace.

Update plugins to their latest versions

When you have a number of plugins installed on your website, you need to be aware of the latest updates and the changes they make. Plugins are essential for backing up site data, compressing images uploaded, and more.

Updates are released frequently, so stay on top of your plugins to ensure they’re the latest version. They tend to perform more strongly than previous releases, so you can expect your site to function to a higher standard too. Your security will stay up to date, as well, which is vital to defend against cyber attacks.

But updates may cause issues, such as glitches, due to incompatibility problems. If this is the case, another update should be released fairly quickly to minimize the damage.

12. Managing high traffic and related issues

When you run an ecommerce site, there’s a high chance your traffic will spike during busy periods. For example, Black Friday and the run up to Christmas can lead to major increases in traffic volume. But when this happens, you could exceed your server’s capacity limit — causing it to crash.

That could cost you much-needed traffic and eventual conversions. To avoid this problem, try to find a hosting company offering scalable services to ensure you can accommodate more visitors than usual.

Another important component of website management is running high-traffic tests to find out how strongly it can perform in challenging conditions. By checking reports from high-traffic tests, you can identify issues in the structure of the code or your plugins.

You can use these tests with Pingdom and LoadNinja

13. Efficient management of website security

Good security is fundamental for any website today. Hackers have more sophisticated tools at their disposal, enabling them to attack networks of any size, disrupting businesses, hospitals, government operations, and almost anything else.

One of the best ways to safeguard your site is to bring in an expert to review it, identify potential gaps, and recommend preventative actions. Individuals qualified to do this typically have years of experience and outstanding technical skills.

However, even if you choose to follow this recommendation, you can take other steps to boost your website’s security further. Try these:

Password management

A major element of good website management is implementing quality passwords to minimize the risk of security breaches. Even if you set up complex passwords for accessing your website’s backend, these may still be stolen. Hackers continue to find new ways to crack defenses, so effective password management is vital to ensure solid security.

Consider the following:

  • Implement a tool designed to generate passwords, such as LastPass or RoboForm, which can create complex passwords and keep them stored safely for you
  • Don’t use one password for more than one website or application — if it’s stolen, every account it’s connected to could be at risk
  • Alternate your passwords regularly, ideally at least once per week, to ensure any stolen passwords won’t be valid for too long
  • Employ two-factor authentication on your website as an extra security layer

Further steps to improve your website security

To ensure your site’s security further, try these:

  • Renew your site’s SSL certificate as and when required, to prevent your website from being spoofed
  • Contact your hosting company on a regular basis to keep up to date on their current security measures and request recommendations; change to a dedicated server if that’s possible
  • Keep access to your website’s backend out of the hands of people who don’t genuinely need it or have left your business
  • Work with a security expert and ask them to install quality software designed to trace attackers’ IP address, so you can block them to prevent further issues
  • Undertake security testing on your site on a regular basis, such as IndusFace or NetSparker, or you could hire website management services to handle this on your behalf

Security Management under Plesk

Plesk hosting platform has enhanced level of security right from the box. Recently, Plesk launched Advisor, which unifies the best possible security practices and performance tune-up of the server and hosted websites.
Read more about best Plesk Security practices

Summary

We’ve covered a wealth of best practices for effective web management in this guide. To help with future reference or when you’re consulting with providers of website management services, we’ll run through them again below:

Standard maintenance

  1. Backup of your site and its data
  2. Optimize your database for best performance
  3. Check your landing pages
  4. Prepare for downtime and know how to manage it
  5. Check the load times of your website
  6. Take redundant elements out of the site
  7. Check for signs of vulnerabilities in forms on your site
  8. Review your analytics to find valuable insights
  9. Check the performance of your website across all devices and browsers (e.g. Google Chrome)

Effective management of situations related to customer experience

  1. Be responsive to user comments and reviews
  2. Make sure to keep “under maintenance” pages on your site distinctive and engaging

Proper web management for key site elements

  1. Keep your content updated
  2. Keep individual plugins updated regularly

Efficient management of website security

  1. Manage your passwords effectively
  2. Take all further steps required to boost your site’s security

Managing high traffic and related issues

  1. Run tests on your site to assess its ability to cope with high traffic volume

So, by now, you should have gained some valuable insights into website management. While this can take more time than you have to spare, your website will perform at its best in the long run. However, there’s a simple way to get around this: hire a specialist in process automation. They will know how to create codes to complete key processes when required.

This does incur a little more expense, but you’ll have more time to focus on your business and what actually goes onto your website.

Conclusion

For effective website management, you’ll need to keep embracing the latest procedures as you add more and more innovative elements to your site. As a result, the individual(s) responsible for managing your website have to evolve along with it.

Remember: your website is critical for interacting with your customer base, engaging your audience, generating leads, and processing sales. If you can keep your website maintained to a high standard, it will provide the results you need for longer and prevent you from experiencing major disruptions.

 

You may find working with a provider of website management services brings you the best results, particularly if you’re worried about handling multiple website management yourself.

All About PostgreSQL Remote Access Under Plesk

Once you have installed the PostgreSQL database server, you may notice that the remote access mode is unavailable. This is a default setting implemented for effective security. But you might prefer to enable PostgreSQL remote access to the PostgreSQL database server so you can use it remotely from different locations, such as your house or workplace. So, how do you do it? Read on to find out all the key information on Plesk PostgreSQL remote access.

Plesk: What it is and how it works

Plesk and PostgreSQL go together beautifully. You may have heard of Plesk: it’s one of the U.S.’s and Europe’s biggest paid hosting platforms. Different editions are available, and Plesk is designed to support Windows as well as various editions of Linux. These include CentOS, Debian, Ubuntu, Cloud Linux and RedHat.

Database servers are required for Plesk, for the storage of its databases as well as those utilized by its various elements (such as the webmail service). Databases developed by hosting clients’ sites and APS apps (e.g. WordPress) are necessary too.

Plesk can support most of the popular database engines. The list of compatible options includes MySQL and, of course, PostgreSQL. It’s shipped with relevant tools for effective database management, and Plesk is able to work with database servers located on the same server or a remote machine.

We’ll take a closer look at connecting Plesk and PostgreSQL below.

PostgreSQL: What it is and how it works

This database system both utilizes and extends the SQL language. To do this, it leverages an object-relational model that stands apart from others. PostgreSQL is capable of handling highly-demanding workloads, designed to keep data stored safely and affording outstanding scalability. PostgreSQL was created at the University of California at Berkeley, as part of its POSTGRES initiative in the mid-1980s. In the decades since, PostgreSQL has undergone considerable work and adjustment — the core has expanded consistently through rigorous ongoing development.

The open source PostgreSQL community is incredibly committed, which makes this database system one of the best. It enjoys a reputation for ongoing data integrity and extensibility, as well as its strong out-of-the-box functionality. As a result, PostgreSQL can be run on the majority of the biggest operating systems in the world.

Another key facet of PostgreSQL is that it complies with ACID requirements, and has done so for almost two decades. Many solid add-ons can be used with PostgreSQL, too, such as POSTGIS. You can use this extension to utilize geospatial data for your database.

With all this in mind, it’s no surprise that PostgreSQL is regarded as one of the open source community’s biggest relational databases. It’s the primary option for a vast range of companies, individuals and organizations.

Last but not least, PostgreSQL is simple to set up and get running. All you need to do is pick the app you’d prefer to make and rely on PostgreSQL to safeguard your data in a strong database.

Using a Plesk server to configure remote PostgreSQL access

PostgreSQL is set to “localhost” by default — you’ll be refused entry if you attempt to connect to the server from outside the machine.

So, to enable access to PostgreSQL server remotely:

Step 1: Connect to PostgreSQL through SSH

Step 2: Execute the right command to get the location of postgresql.conf file (such as /var/lib/pgsql/data/postgresql.conf): psql -U postgres -c ‘SHOW config_file’

Step 3: Open postgresql.conf file and put this line at the end: listen_addresses = ‘*’

Step 4: Get the location of pg_hba.conf file:

grep pg_hba.conf /var/lib/pgsql/data/postgresql.conf

/var/lib/pgsql/data/pg_hba.conf

where /var/lib/pgsql/data/postgresql.conf is the file resulting from the second step

Step 5: Put this at the end of /var/lib/pgsql/data/pg_hba.conf file: host samerole all 203.0.113.2/32 md5

Some important points:

Connection is allowed from this remote IP: 203.0.113.2/32. If you’re aiming to enable connection from any IP, make sure to specify 0.0.0.0/0 .

The authentication method is md5. This demands that clients provide a double-md5-hashed password for secure authentication.

The user “john.doe” from database example1 can only access that database.

For different methods of authentication, check PostgreSQL documentation.

To put the changes into effect, restart PostgreSQL server through: Plesk > Tools & Settings > Services