Skip to content

Instantly share code, notes, and snippets.

@NoMan2000
Forked from phedoreanu/apache ssh keys
Last active August 29, 2015 14:27
Show Gist options
  • Save NoMan2000/b16265c7399c3a3e1ba2 to your computer and use it in GitHub Desktop.
Save NoMan2000/b16265c7399c3a3e1ba2 to your computer and use it in GitHub Desktop.
Setting up automatic php git pulls
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R ubuntu:www-data /var/www/.ssh
# one problem here is I do not know who the exec command is executing as.
sudo -u ubuntu ssh-keygen (empty passphrase)
sudo -u ubuntu ssh -T [email protected]
# this adds git to the recognized list of /var/www/.ssh/known_hosts
# paste public key into repo manager
cd (git repo)
sudo -u apache git pull origin branch
sudo chown ubuntu:www-data /var/lib/apache2/fastcgi -R
sudo chown ubuntu:www-data /var/lock/apache2
sudo chown ubuntu:www-data -R /var/log/apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment