Skip to content

Instantly share code, notes, and snippets.

@omgmog
Created October 25, 2013 14:48
Show Gist options
  • Save omgmog/7155850 to your computer and use it in GitHub Desktop.
Save omgmog/7155850 to your computer and use it in GitHub Desktop.
Some commands I use on my Linode VPS to make life easier.
www=/srv/www
conf=/etc/apache2/sites-enabled
alias ra='/etc/init.d/apache2 restart'
alias ownit='chown -R www-data:www-data .'
function makeconf {
primary=${1}
conffile="${conf}/${primary}.conf"
site_path="/srv/www/${primary}"
mkdir -p ${site_path}
echo "<VirtualHost *:80>" >> "${conffile}"
echo " Servername ${primary}" >> "${conffile}"
echo " ServerAlias www.${primary}" >> "${conffile}"
shift
for i; do
cat >> "${conffile}" <<EOL
ServerAlias ${i}
ServerAlias www.${i}
EOL
done
echo " DocumentRoot ${site_path}" >> "${conffile}"
echo "</VirtualHost>" >> "${conffile}"
}
function wordpressitup {
wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
cd wordpress
cp -R * ..
cd ..
rm -r wordpress
echo "Wordpress installed"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment