Set Up GIT in a Godaddy Shared Hosting Account
What Operating System is used to host your website?The first thing you will need to do is to login to your Godaddy account via SSH. If you don't have SSH access to your Godaddy Account yet, just call them and ask for it. They have an excellent technical support service over the phone. Now, you need to get the version of the server that is hosting your website. It will be most likely a CentOS Linux server. To check this out you will need to do the following in your SSH terminal window:
[firstname.lastname@example.org ~]$ cat /etc/*-release CentOS release 5.5 (Final)To find out if this version of CentOS is a 64bit or a 32bit operating system, you do the following:
[email@example.com ~]$ uname -m i686The i686 means that this is a 32bit operating system.
Getting the Rigth Version of CentOSNow you need to create a CentOS virtual machine. The virtual machine has to be of the same version as the one in your Share Hosting account. CentOS 5.5 is an older version. To get an older version of CentOS you can go to the following URL:
http://vault.centos.org/I saw all over the Internet that you only needed to run a Live CD to be able to generate the files that you needed. I tried several times to do this just with the Live CD but I would always get into an error message that I could never get around of. Following is the error message that I was getting:
IOError: [Errno 30] Read-only file systemI finally decided to get the full Binaries and do a full installation. The full ISO DVD can only be downloaded via Torrent. I have Bitcomet but you can use any Torrent client to download this CD image.
Creating a Virtual MachineYou will ned to have VirtualBox installed in your computer to create a Virtual Machine. Luckily, VirtualBox is free so, once you have it up and running in your computer, you will be able to continue. You will need to do the following to create your CentOS 5.5 Virtual Machine:
- More memory than the minimum which is 512MB. At list 2GB.
- Storage: A dynamically Allocated Storage device with 8GB should be more than enough.
- After creation change the following settings:
- Network: Attached to = "Bridged Adapter".
- Choose a virtual CD/DVD disk file... = Mount CentOS DVD ISO Image.
- CD/DVD Drive = From "IDE Secondary Master" to "IDE Primary Master".
Installing GIT in your Virtual MachineWhen you are done with the installation of CentOS, log into it, open a terminal window, and type the following:
[root@localhost ~]# yum -y install gcc gcc-c++ make expat-devel gettext-devel curl-devel openssl-devel zlib-devel bzip2Now, you can Google for the latest version of GIT Source Code. The latest version of GIT as of this writing is GIT 188.8.131.52. Execute the following on your terminal to download this version of GIT:
[root@localhost ~]# wget http://git-core.googlecode.com/files/git-184.108.40.206.tar.gzNow, to decompress the file that has just been downloaded you do the following:
[root@localhost ~]# tar -xzf git-220.127.116.11.tar.gzNow, you need to enter into the new folder and execute the following two commands
[root@localhost ~]# cd git-18.104.22.168 [root@localhost git-22.214.171.124]# make [root@localhost git-126.96.36.199]# make installNow that the folders have been created, we need to compress them before we can upload them to the Godaddy server.
[root@localhost git-188.8.131.52]# cd .. [root@localhost ~]# tar cvfj bin.tar.bz2 bin [root@localhost ~]# tar cvfj lib.tar.bz2 lib [root@localhost ~]# tar cvfj libexec.tar.bz2 libexec [root@localhost ~]# tar cvfj share.tar.bz2 shareTo upload thes files to your Shared Hosting Account, you need to do the following:
[root@localhost ~]# scp bin.tar.bz2 firstname.lastname@example.org: [root@localhost ~]# scp lib.tar.bz2 email@example.com: [root@localhost ~]# scp libexec.tar.bz2 firstname.lastname@example.org: [root@localhost ~]# scp share.tar.bz2 email@example.com:If you are creating these files for a 64bit Server, you also need to do the following:
[root@localhost ~]# tar cvfj lib64.tar.bz2 lib64 [root@localhost ~]# scp lib64.tar.bz2 firstname.lastname@example.org:
Installing GIT in your Shared Hosting AccountNow is time to go back to your Godaddy Shared Hosting account via SSH and decompress the files that you just uploaded. To decompress the uploaded files you need to do the following:
[email@example.com ~]$ tar -xvjf lib.tar.bz2 [firstname.lastname@example.org ~]$ tar -xvjf libexec.tar.bz2 [email@example.com ~]$ tar -xvjf bin.tar.bz2 [firstname.lastname@example.org ~]$ tar -xvjf share.tar.bz2Again, if you are trying to do this on a 64bit server, you will also need to do the following:
[email@example.com ~]$ tar -xvjf lib64.tar.bz2Finally, on your GoDaddy account's root folder, create a ".profile" file with "VI":
[firstname.lastname@example.org ~]$ vi .profileTo start entering content into the ".profile" file in "VI", you will first need to enter into "Insert" mode by pressing the i key. If you already have some content in your ".profile" file, add the following to the end of the file:
export PATH="$PATH:~/bin" export LD_LIBRARY_PATH=~/lib export GIT_EXEC_PATH=~/libexec/git-core export GIT_TEMPLATE_DIR=~/share/git-core/templatesIf you are working on a 64bit machine, you will have to type the following instead:
export PATH="$PATH:~/bin" export LD_LIBRARY_PATH="~/lib:~/lib64" export GIT_EXEC_PATH=~/libexec/git-core export GIT_TEMPLATE_DIR=~/share/git-core/templatesTo save and close the VI editor you will need to press the Esc key and type the following:
:wqNow you need to press the Enter key to save and exit. Now, before testing your GIT installation, you will need to log out and log back into your Godaddy Account via SSH.