Last active
August 29, 2015 14:27
-
-
Save zianwar/d0837605da3133140791 to your computer and use it in GitHub Desktop.
Ubunutu server configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ========= SETTING UP A UNIX USER =========== | |
: <<'end_comment' | |
# Create a new unix user | |
adduser zianwar | |
# Add user to sudo group | |
gpasswd -a zianwar sudo | |
# Generate ssh key pair | |
ssh-keygen -t rsa -b 4096 -C “[email protected]” | |
# Start the ssh-agent in the background | |
eval "$(ssh-agent -s)" | |
# Add the generated SSH | |
ssh-add ~/.ssh/id_rsa | |
# Disable root login for security purposes | |
# by changing PermitRootLogin to no | |
sudo nano /etc/ssh/sshd_config | |
# Restart SSH service | |
sudo service ssh restart | |
end_comment | |
#=========================================== | |
sudo apt-get update | |
sudo apt-get install -y wget make tree curl git software-properties-common | |
sudo add-apt-repository -y ppa:nginx/stable | |
sudo apt-get update | |
sudo apt-get install -y nginx | |
sudo add-apt-repository -y ppa:ondrej/php5-5.6 | |
sudo apt-get update | |
sudo apt-get install -y php5-fpm php5-cli php5-mysql php5-curl php5-mcrypt php5-gd | |
sudo apt-get update | |
sudo apt-get install -y mysql-5.6 | |
# Pause to add ssh to github then continue | |
read -n1 -rsp $'Add your SSH to Github then press any key to continue...\n' | |
# Set up nano syntax highlight | |
cd ~ && git clone https://github.com/nanorc/nanorc.git | |
cd nanorc && make install | |
cd ~ && rm -rf nanorc | |
echo "include ~/.nano/syntax/html.nanorc | |
include ~/.nano/syntax/css.nanorc | |
include ~/.nano/syntax/php.nanorc | |
include ~/.nano/syntax/ALL.nanorc" >> ~/.nanorc | |
# Install bash-it | |
git clone --depth=1 https://github.com/Zianwar/bash-it.git ~/.bash_it | |
~/.bash_it/install.sh | |
source ~/.bashrc | |
# Install composer | |
cd ~ && curl -sS https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/composer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment