Installing git on a cPanel server
Asked Answered
I

3

21

I need to install git on cPanel but I am finding a lot of information indicating that this is not a simple process.

I have a cPanel/WHM instance on a CentOS distribution and am trying to install git without breaking cPanel. The information I have found says that installing git can break cPanel because of the Perl dependencies.

This page on cPanel's forums advises against installing git:

http://forums.cpanel.net/f391/installing-git-294411.html

However, this page under the cPanel Features says that an RMP has been released for git:

http://features.cpanel.net/responses/possibility-to-install-git-on-cpanel-server-without-breaking-it

I requested support from cPanel and was given this response:

We actually do not recommend the installation of GIT unless you are very experienced with it's install due to it having the possibility of breaking perl.

We do distribute the git RPM as a convenience during install, however, it's not setup or supported - it's only added as a convenience and requires manual install of further packages and configuration.

The RPM we provide for git installs the binary to /usr/local/cpanel/3rdparty/bin so you will need to run it out of here. It's not the full tool set, so anything outside of this would need to be installed by the systems administrator.

Does anyone have advice on how best to install git on cPanel such that all cPanel user accounts will be able to use git, make sure that the installation doesn't break Perl, and what is missing in the RPM provided by cPanel based on the statement in the last paragraph quoted above?

Incorrigible answered 29/8, 2013 at 18:18 Comment(0)
B
43

I figured out the same problem, but I find out that from the WHM/Cpanel version 11.36+ Git is installed by default in the system and available for all the account.

You have just to create a Git's account (be sure to add remote ssh access) then in your .bashrc you add just this alias

alias git="/usr/local/cpanel/3rdparty/bin/git"

then if you type git in the user's shell, it should just work automagically ;)

Cheers

Boredom answered 30/8, 2013 at 8:19 Comment(3)
Yes, it is installed, you are correct, but rather than add an alias to git in .bashrc, I added a symbolic link as root using ln -s /usr/local/cpanel/3rdparty/bin/git /usr/local/bin/git which makes it available to all user accounts and allows standard use of git through shell scripts and other goodies.Incorrigible
Thanks alisamii, that worked a treat for me and preferred the symbolic link approach.Phosphatize
More info about the package: yum info cpanel-gitArcature
H
3

cPanel disables Perl updates to protect its own binaries, which are git dependencies.

Just run yum with the following lines.

sudo yum install git --disableexcludes=main --skip-broken
Hanger answered 23/12, 2013 at 8:42 Comment(1)
and is there any downside of run this? will this broke perl or cpanel?Poppy
C
1

Remember if you are updating the bashrc file to reload this so you dont have to restart your SSH session by using:

source ~/.bashrc

http://www.codefuel.co.uk/cpanel-git-resolved/

Christiechristin answered 15/10, 2014 at 8:50 Comment(1)
This is not answering the question. If this is relevant to to the accepted one, place a comment or edit the accepted one when you have enough reputationSikhism

© 2022 - 2024 — McMap. All rights reserved.