Skip to content

Instantly share code, notes, and snippets.

@mcomisso
Last active April 11, 2016 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcomisso/1faaf88dd2745d2d8314dbd2baa8478d to your computer and use it in GitHub Desktop.
Save mcomisso/1faaf88dd2745d2d8314dbd2baa8478d to your computer and use it in GitHub Desktop.
Nginx dependencies
#!/bin/bash
# !!!
# chmod +sx this script (sudo + exec)
#
if [ "$(id -u)" != "0" ]; then
echo "Run this script with sudo or as root" 1>&2
exit 1
fi
# Install libraries
apt-get install build-essential libpng-dev libjpeg-dev -y --force-yes
# Install dependencies
apt-get install python-dev python-pip python-virtualenv openssh-server nginx supervisor mysql-server libmysqlclient-dev -y --force-yes
CURRENT_USER=$(who am i | awk '{print $1}')
if [ "$(id -Gn)" != *"www-data"*]; then
echo "Setup user groups"
groupadd nuxie
adduser $CURRENT_USER www-data
adduser www-data $CURRENT_USER
fi
# Print the status
echo "*** Check the following groups for the current user ***"
echo "Groups of" $CURRENT_USER
groups $CURRENT_USER
echo ""
echo "groups of www-data:"
groups www-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment