Install git and drush on Godaddy shared hosting

23
{ Godaddy Setting up for ssh

description

Please note - 2014- This tutorial is outdated and only uploading your ssh key is still relevant. I no longer have a Godaddy account and cannot update this tutorial. If anyone comes across another tutorial with all 3 steps that work, please let me know so I can update this description with the url for others who are looking for help. Thanks! Upload your public ssh key, install git and drush on Godaddy shared hosting.

Transcript of Install git and drush on Godaddy shared hosting

Page 1: Install git and drush on Godaddy shared hosting

{Godaddy

Setting up for ssh

Page 2: Install git and drush on Godaddy shared hosting

Login to godaddy control panel and enable SSH. It may take a few moments to become

active.

Page 3: Install git and drush on Godaddy shared hosting

First make sure php version is 5.3!Find your ssh login * Go to FTP

Users

Page 4: Install git and drush on Godaddy shared hosting

Use primary username for sshssh [email protected]

If you don’t remember your password it can be changed under the setup>actions tab. It is important to know your password!

Page 5: Install git and drush on Godaddy shared hosting

Add your public ssh key on GoDaddy

$ mkdir .ssh

Create .ssh directory in the root of your GoDaddy account

Log in with ssh [email protected] and enter ftp pw

Page 6: Install git and drush on Godaddy shared hosting

Create authorized_keys file

-bash-3.2$ touch .ssh/authorized_keys-bash-3.2$ cd .ssh-bash-3.2$ vi authorized_keys

GoDaddy uses vi or vim to edit files. We will use vi to add our public key to the empty authorized_keys file.

Page 7: Install git and drush on Godaddy shared hosting

Paste in your id_rsa.pub (public key)

• type i (to insert)• paste in your id_rsa.pub (public key)• esc • : wq (colon, write & quit)

Page 8: Install git and drush on Godaddy shared hosting

Your public rsa key was successfully added if you were not prompted for a password

Log out and use your ssh login to test!ssh [email protected]

Page 9: Install git and drush on Godaddy shared hosting

{Godaddy

Installing Git

Page 10: Install git and drush on Godaddy shared hosting

Q: Why not use yum to install git?

A: Most tutorials for installing git on CentOS use yum. Godaddy prevents yum from being used or installed on their shared servers unless you switch to dedicated server (more expensive plan)

* If you figure out a way to use yum on godaddy shared server – please let me know

At the time of this tutorial, GoDaddy shared OS is CentOS release 5.5 (Final). To verify:-bash-3.2$ cat /etc/redhat-release

Page 11: Install git and drush on Godaddy shared hosting

Download the rpm into the git directory from EPEL ( http://fedoraproject.org/wiki/EPEL ) Important because GoDaddy shared servers are CentOS.

-bash-3.2$ mkdir git-bash-3.2$ cd git/

Create git directory

-bash-3.2$ wget http://dl.fedoraproject.org/pub/epel/5/i386/git-1.8.2.1-1.el5.i386.rpm

Page 12: Install git and drush on Godaddy shared hosting

Unpack git with rpm2cpio and cpio

-bash-3.2$ rpm2cpio git-1.8.2.1-1.el5.i386.rpm | cpio -imdv

-bash-3.2$ git --versiongit version 1.8.2.1

Verify your version of git

-bash-3.2$ rm git-1.8.2.1-1.el5.i386.rpm

Clean up and remove the un-needed file

Page 13: Install git and drush on Godaddy shared hosting

-bash-3.2$ echo "export GIT_BIN=${HOME}/gitexport PATH=${GIT_BIN}/usr/bin:${PATH}export GIT_EXEC_PATH=${GIT_BIN}/usr/binexport GIT_TEMPLATE_DIR=${GIT_BIN}/usr/share/git-core/templatesexport GIT_SSL_NO_VERIFY=true" >> ~/.bash_profile

In the root, configure your $path variable. Copy/paste all at once.

Important! Close the terminal and ssh back in

-bash-3.2$ cd ~

Go back to the root of your godaddy site

Page 14: Install git and drush on Godaddy shared hosting

-bash-3.2$ git init

Go to the root of your DRUPAL site. Do not make your git init in the root dir of your GoDaddy acct.

Configure your repo. In this example, I am using bitbucket which is free for individuals.

It is important to note that we can only ssh INTO our GoDaddy account. You must use https to connect to bitbucket & enter bitbucket password.

-bash-3.2$ git remote add origin https://[email protected]/cielo/testsite.git

Page 15: Install git and drush on Godaddy shared hosting

Success!

Please note that you must enter the bitbucket password each time you push/pull from your repo

Page 16: Install git and drush on Godaddy shared hosting

{Godaddy

Installing Drush

Page 17: Install git and drush on Godaddy shared hosting

ssh into the root directory of your GoDaddy acct.

-bash-3.2$ wget http://ftp.drupal.org/files/projects/drush-7.x-5.8.tar.gz

Note –The most current version can be cloned via git from https://github.com/drush-ops/drush.

ssh [email protected]

At this time, drush 5.8 works best on Godaddy.

Page 18: Install git and drush on Godaddy shared hosting

-bash-3.2$ tar -pzxf drush-7.x-5.8.tar.gz

Extract the file

Clean up and remove un-needed file

-bash-3.2$ rm drush-7.x-5.8.tar.gz

Page 19: Install git and drush on Godaddy shared hosting

-bash-3.2$ ls -a

View hidden files to see if .bash_profile has already been created. This file will be there if you have already installed git.

-bash-3.2$ vi .bash_profile

GoDaddy uses vi or vim to edit files. We will use vi to edit .bash_profile.

Page 20: Install git and drush on Godaddy shared hosting

Type in i (to insert) and paste in the following. If you previously installed git, skip a line and paste under.

• Type in i (for insert)• Paste in the following:

export COLUMNSalias drush='/usr/local/php5/bin/php ~/drush/drush.php'alias php='/usr/local/php5/bin/php‘

• esc• : wq (colon, write & quit)

Page 21: Install git and drush on Godaddy shared hosting

Update your session

-bash-3.2$ source .bash_profile

Close the terminal and ssh back in.

Page 22: Install git and drush on Godaddy shared hosting

Verify that drush is installed

-bash-3.2$ drush status

Success!

Page 23: Install git and drush on Godaddy shared hosting

As of September 2013, you must use an older versionof drush on godaddy. Godaddy support states they willeventually update command line to PHP version to 5.3.3+

Until then…your client must purchase a vps (private server) or dedicated server