Skip to content

Instantly share code, notes, and snippets.

@carlware
Last active August 29, 2015 13:57
Show Gist options
  • Save carlware/9425619 to your computer and use it in GitHub Desktop.
Save carlware/9425619 to your computer and use it in GitHub Desktop.
aptitude update
aptitude upgrade
aptitude dist-upgrade
aptitude autoclean
aptitude install vim
aptitude install sudo
aptitude install curl
aptitude install ufw
passwd # change password
adduser # example demoUSer
visudo # grant privileges
# demo ALL=(ALL:ALL) ALL
# this means that user can execute
# all aplications under folder sbin
scp ~/.ssh/id_rsa.pub [email protected]: # copy the public under private server
mv id_rsa.pub ~demo/.ssh/authorized_keys # if demo does not exist create it!
chown -R demo:demo ~demo/.ssh
chmod 700 ~demo/.ssh
chmod 600 ~demo/.ssh/authorized_keys
nano /etc/ssh/sshd_config # configure ssh options
# Port 30000 <--- change to a port of your choosing
# this port is that is specified in the connection
# example ssh [email protected] -p 30000
# Protocol 2
# PermitRootLogin no
# PasswordAuthentication no
# UseDNS no
# AllowUsers demo
/etc/init.d/ssh reload # service ssh reload
ufw allow 30000 # the port we set for SSH earlier
ufw allow 80 # to allow HTTP traffic
ufw allow 443 # to allow HTTPS traffic
ufw enable
# ufw disable
# ufw status
# iptables -L
# Configure server: basic packages
sudo aptitude install build-essential python-dev
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
sudo rm distribute*
sudo easy_install pip
sudo pip install virtualenv virtualenvwrapper
sudo pip install -U setuptools
vim /etc/bash.bashrc # Add at the end
# source /usr/local/bin/virtualenvwrapper.sh
source /etc/bash.bashrc
sudo aptitude install libjpeg8-dev
sudo apt-get install libfreetype6-dev zlib1g-dev
sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/
sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so /usr/lib/
sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/
# Configure server: MySQL and postgreSQL
sudo aptitude install mysql-server libmysqlclient-dev
sudo aptitude install postgresql libpq-dev
sudo aptitude install memcached libmemcached-dev # Memcache increase queries performance
sudo aptitude install rabbitmq-server # RabbitMQ
sudo aptitude install supervisor # Supervisord
sudo aptitude install nginx # nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment