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