Skip to content

Instantly share code, notes, and snippets.

@livando
Created September 17, 2013 12:58
Show Gist options
  • Select an option

  • Save livando/6593974 to your computer and use it in GitHub Desktop.

Select an option

Save livando/6593974 to your computer and use it in GitHub Desktop.
#!/bin/bash
###
#
# Ubuntu 12.04 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 12.04 server:
#
# bash -c "$(curl -fsSL https://raw.github.com/gist/4372049)" <mysqlPassword>
#
# Be sure to replace <mysqlPassword> with your intended MySQL Password.
#
# Dependencies:
# - curl
#
# Todo:
# - SSL Configuration
#
###
EXPECTEDARGS=0
if [ $# -ne $EXPECTEDARGS -o "x$0" == "x" -o $0 == "bash" ]; then
echo "Usage:"
echo " Parameter 1: MySQL root password"
exit 1
fi
MYSQLPASS=$0
export DEBIAN_FRONTEND=noninteractive
########################################
## System Updates
########################################
apt-get update -y
apt-get dist-upgrade -y
apt-get install \
curl \
-y
apt-get upgrade -y
########################################
## Tools and Utilities
########################################
apt-get install git-core -y
apt-get install xclip -y
########################################
## MySQL
########################################
apt-get install \
mysql-client \
mysql-server \
-y
mysqladmin -u root password $MYSQLPASS
########################################
## Nginx
########################################
########################################
## Add deployer to sudoers and do other deployer related commands
########################################
adduser deployer sudo
## this is to change the shell for deployer
chsh -s /bin/bash deployer
########################################
## Remove any unwanted packages
########################################
apt-get autoremove -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment