Question

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

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

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.

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

I'm using CentOS 5 with Plesk 10.0.1

Thanks.

Was it helpful?

Solution 2

I will assume that you are using some variables like:

Domain: gartz.com.br 
Username: gartz

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

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

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

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

Now you have this: /var/www/vhosts/gartz.com.br/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

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

It will show something like this:

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

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

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

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.

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

OTHER TIPS

I used the Plesk panel to add a ssh user access to the disired domain, like:

{SSH_USER} = my domain ssh username

SO in my $HOME I have created a folder called $HOME/git and give it permissions, then create a alias user called {SSH_USER}.git that use the same UID/GID from user {SSH_USER}.

/var/www/vhosts/<domain>/# mkdir git

If you are logged as ROOT change the permission to your {SSH_USER}:psacln

# chown -R {SSH_USER}:psacln ./git

Now using your root account create a new user called {SSH_USER}.git where the home folder is the git folder that you already created.

Find your uid and gid:

# id
uid=10004({SSH_USER}) gid=2524(psacln) groups=2524(psacln)

Now create your new user:

# sudo adduser {SSH_USER}.git -d /var/www/vhosts/<domain>/git -g 2524 -u 10004

Login as {SSH_USER}.git

# su - {SSH_USER}.git

Install your gitolite. Everything will works.

When you try to login a domain git you need to type:

git clone {SSH_USER}.git@<domain>:<repo_name>

You can do this for any domain in your server, having a single gitolite administration for the domains.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top