如何在Plesk上为单个域配置gitolite [英] How to configure gitolite for a single domain on Plesk

查看:229
本文介绍了如何在Plesk上为单个域配置gitolite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在plesk面板单一域配置gitolite。

How to configure the gitolite on a plesk panel single domain.

当我使用由plesk创建的/ bin / bash用户时,主文件夹变成/ var / www / vhosts / {user} /

When I use a /bin/bash user created by plesk, the home folder becomes /var/www/vhosts/{user}/

然后在安装gitolite后,用户仍然不使用$ HOME / bin /文件夹来查找gitolite二进制文件,系统二进制,所以总是当我尝试克隆gitolite-admin来一个空目录。

Then after install gitolite there, the user still not using the $HOME/bin/ folder to find the gitolite binary, and uses the system binary, so always when I try to clone the gitolite-admin come's a empty directory.

如何配置plesk ssh域用户使用$ HOME / bin文件夹

How to configure the plesk ssh domain user to use the $HOME/bin folder to access the gitolite repo and it binaries?

我使用CentOS 5和Plesk 10.0.1

I'm using CentOS 5 with Plesk 10.0.1

谢谢。

推荐答案

我假设您使用的是一些变数:

I will assume that you are using some variables like:

Domain: gartz.com.br 
Username: gartz

进入您的plesk面板并添加SSH / bin / bash访问您无法安装gitolite存储库的用户

Go in your plesk panel and add SSH /bin/bash access to the user that you wan't to install gitolite repositorie.

现在SSH登录您的服务器作为 root 权限。

Now SSH login your server as root privileges. And type su - gartz you are now in your user bash.

输入 pwd su - gartz / code>它会显示您的 $ {HOME} 如: /var/www/vhosts/gartz.com.br /

Type pwd it will show your ${HOME} like: /var/www/vhosts/gartz.com.br/

回到超级用户并添加权限给用户可以写自己的主文件夹并添加一个git文件夹:

go back to super user and add privileges to user can write your own home folder and add a git folder:

$ chown gartz:psacln /var/www/vhosts/gartz.com.br/
$ su - gartz
$ mkdir git

现在你有: /var/www/vhosts/gartz.com。 br / git

将您的gitolite下载到git文件夹,然后添加一个用户只能访问您的git存储库,或preffix git: adduser gartz.git

Download your gitolite to the git folder, then add a user with will have access to your git repositories only, like using suffix or preffix git: adduser gartz.git

编辑您的passwd文件到您的git用户具有相同的id正常用户和更改的家到正确的git文件夹。 (您将再次需要root权限)

Edit your passwd file to your git user have the same ids from the normal user and change the home to the correct git folder. (you will need root privileges again)

$ cat /etc/passwd | grep gartz

它会显示如下:

gartz:x:10004:2524::/var/www/vhosts/gartz.com.br:/bin/bash

现在编辑您的其他用户 gartz.git ,如下所示:

Now edit your other user gartz.git to be like this:

gartz.git:x:10004:2524::/var/www/vhosts/gartz.com.br/git:/bin/bash

使用authorized_keys为您的rsa密钥添加 .ssh 文件夹。然后使用您的帐户登录您的shell,如 gartz.git 现在安装您的gitolite。

Add .ssh folder with authorized_keys for your rsa key. Then login your shell using your account like gartz.git install your gitolite now.

$ git clone git://github.com/sitaramc/gitolite
$ cd gitolite/src
$ ./gl-easy-install -q gitolite gitserver sitaram

转到您自己的计算机并克隆您的gitolite-admin:

Go to your own computer and clone your gitolite-admin:

$ git clone gartz.git@gartz.com.br:gitolite-admin

更改您的配置文件,添加您的密钥和资源库,提交和推送。

Change your config file, add your keys and repos, commit and push.

您可以为任何您想要的域。有关安装git的详情,请 http://progit.org/book/ch4-8.html

You can do this for any domain you want. For more info installing git http://progit.org/book/ch4-8.html

这篇关于如何在Plesk上为单个域配置gitolite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆