Installing GIT Client in Plesk 11.5 | Using GIT in Plesk

Installing GIT Client in Plesk

More and more LinQhost customers are using GIT for version control of their websites. Although the GIT client is not available in a Plesk environment by default, you can add it to the chroot environment of Plesk yourself. This allows you to easily use GIT via the shell for all websites with /bin/bash (chrooted) access.

Alert
Following these steps is at your own risk

Terms and Conditions

To successfully install the GIT client, it is important that you meet the following requirements:You are using Plesk
  1. You use the restricted chroot shell for extra security.
  2. You have downloaded the chroot_update.sh script from Parallels.
  3. You have full root access.
  4. You are working with GIT over HTTP(S). We tested this with BitBucket, but other services should work as well

Install GIT

Follow the steps below to install the GIT client and integrate it into the chroot environment.

1. Install GIT:

yum install git

2. Copy the necessary files to the chroot environment:

mkdir -p /var/www/vhosts/chroot/usr/share/git-core/
cp -ar /usr/share/git-core/templates /var/www/vhosts/chroot/usr/share/git-core/
cp -ar /usr/libexec/git-core /var/www/vhosts/chroot/usr/libexec/
cp -L /usr/lib64/libsoftokn3.so /var/www/vhosts/chroot/lib64/
cp -L /usr/lib64/libnsspem.so /var/www/vhosts/chroot/lib64/
cp -L /usr/lib64/libsqlite3.so.0 /var/www/vhosts/chroot/lib64/
cp -a /etc/resolv.conf /var/www/vhosts/chroot/etc/
cp -r /etc/pki /var/www/vhosts/chroot/etc


3. Add additional files to the chroot environment:

/chroot_update.sh —add /bin/basename./chroot_update.sh —add /bin/sed./chroot_update.sh —add /bin/uname./chroot_update.sh —add /usr/bin/tr./chroot_update.sh —add /usr/bin/git./chroot_update.sh —add /usr/bin/xmlwf./chroot_update.sh —devices /dev/urandom

4. Update the chroot environment for all websites:

./chroot_update.sh —apply all
Using GIT in the chroot environment
Now that you have added the GIT client, you can log into your web hosting package's shell and clone a repository with the following command:

git clone https://<user>:<password>@bitbucket.org/<repo>

If you receive the following error, it likely means that the GIT client cannot verify the GIT server's SSL certificate:

error: while accessing https://<user>:<password>@bitbucket.org/xxxxxx/info/refs fatal: HTTP request failed

You can fix this by first running the following command before invoking GIT:
export GIT_SSL_NO_VERIFY=true

    • Related Articles

    • DKIM: Setting up on Plesk

      Emails sent from your Plesk server(s) are considered reliable when it is equipped with DKIM. We will tell you in this blog: how to enable DKIM on your Plesk server you can set this on the desired Plesk packages you can add the DKIM DNS records to the ...
    • Suppress SSH login notifications

      We regularly see that the so-called deploy services suffer from output that we generate when logging in via SSH (e.g. pre-login/motd). This output has the function to show the user important information, but in the case of automatic processes this is ...
    • Migrate Email via IMAP with ImapSync

      Moving your website to LinQhost is easy, but migrating your email can be a bit more complicated. Fortunately, with ImapSync you can easily transfer your emails to your new mail environment at LinQhost. In this manual we explain step by step how to do ...
    • Limiting the nuisance of Bots, Crawlers and Spiders

      Bots and crawlers help search engines like Google find and rank your website. But too much activity from these bots can slow down your website’s performance. Here, we’ll discuss how to stop unwanted bots and make your website run faster and more ...
    • SSH Tips for Professionals

      SSH is one of the most used tools by us and by most developers. In this blog we share a number of tips that make SSH both more secure and efficient. These tips are not only applicable to our high performance web servers, but also to your own internal ...