Install git and drush on Godaddy shared hosting
-
Upload
c13l0 -
Category
Technology
-
view
3.645 -
download
1
description
Transcript of Install git and drush on Godaddy shared hosting
{Godaddy
Setting up for ssh
Login to godaddy control panel and enable SSH. It may take a few moments to become
active.
First make sure php version is 5.3!Find your ssh login * Go to FTP
Users
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!
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
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.
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)
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]
{Godaddy
Installing Git
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
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
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
-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
-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
Success!
Please note that you must enter the bitbucket password each time you push/pull from your repo
{Godaddy
Installing Drush
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.
At this time, drush 5.8 works best on Godaddy.
-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
-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.
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)
Update your session
-bash-3.2$ source .bash_profile
Close the terminal and ssh back in.
Verify that drush is installed
-bash-3.2$ drush status
Success!
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