在 cPanel 服务器上安装 git
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18518279/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing git on a cPanel server
提问by Ali Samii
I need to install git on cPanel but I am finding a lot of information indicating that this is not a simple process.
我需要在 cPanel 上安装 git,但我发现很多信息表明这不是一个简单的过程。
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.
我在 CentOS 发行版上有一个 cPanel/WHM 实例,我正在尝试在不破坏 cPanel 的情况下安装 git。我找到的信息说,由于 Perl 依赖关系,安装 git 可能会破坏 cPanel。
This page on cPanel's forums advises against installing git:
cPanel 论坛上的这个页面建议不要安装 git:
http://forums.cpanel.net/f391/installing-git-294411.html
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:
但是,cPanel Features 下的这个页面说已经为 git 发布了一个 RMP:
http://features.cpanel.net/responses/possibility-to-install-git-on-cpanel-server-without-breaking-it
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:
我请求 cPanel 的支持,并得到了以下回复:
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.
我们实际上不建议安装 GIT,除非您对它的安装非常有经验,因为它有可能破坏 perl。
我们确实在安装过程中分发 git RPM 是为了方便,但是,它没有设置或支持 - 它只是为了方便而添加的,需要手动安装更多的包和配置。
我们为 git 提供的 RPM 将二进制文件安装到 /usr/local/cpanel/3rdparty/bin,因此您需要从这里运行它。它不是完整的工具集,因此系统管理员需要安装除此之外的任何东西。
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?
有没有人有关于如何最好地在 cPanel 上安装 git 的建议,以便所有 cPanel 用户帐户都能够使用 git,确保安装不会破坏 Perl,以及 cPanel 根据声明提供的 RPM 中缺少什么在上面引用的最后一段中?
回答by TheCyberXP
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.
我发现了同样的问题,但我发现从 WHM/Cpanel 版本 11.36+ 中,系统默认安装了 Git,并且对所有帐户都可用。
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
您只需创建一个 Git 帐户(确保添加远程 ssh 访问),然后在您的 .bashrc 中添加这个别名
alias git="/usr/local/cpanel/3rdparty/bin/git"
alias git="/usr/local/cpanel/3rdparty/bin/git"
then if you type git
in the user's shell, it should just work automagically ;)
那么如果你git
在用户的 shell 中输入,它应该会自动工作;)
Cheers
干杯
回答by Carlos Troncoso
cPanel disables Perl updates to protect its own binaries, which are git dependencies.
cPanel 禁用 Perl 更新以保护它自己的二进制文件,它们是 git 依赖项。
Just run yum with the following lines.
只需使用以下几行运行 yum。
sudo yum install git --disableexcludes=main --skip-broken
回答by Rees McIvor
Remember if you are updating the bashrc file to reload this so you dont have to restart your SSH session by using:
请记住,如果您要更新 bashrc 文件以重新加载它,则不必使用以下命令重新启动 SSH 会话:
source ~/.bashrc