Типовые настройки сервера на debian

Стартовые

# apt-get -y install ssh sudo make automake
# apt-get -y install wget git-core curl build-essential openssl libssl-dev
# apt-get -y install python-software-properties

# apt-get -y install ntp
# /etc/init.d/ntp start

# echo GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet" > /etc/default/grub
# reboot

Установка Apache2

# apt-get -y install apache2

Установка NodeJS

# curl -sL https://deb.nodesource.com/setup | bash -
# apt-get -y install nodejs

Установка LAMP

# apt-get -y install apache2 mysql-server php5 php-pear php5-mysql
# service apache2 restart
# mysql_secure_installation

Remove anonymous users? [Y/n] y                                            
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Установка PostgreSQL

# apt-get -y install libpq-dev python-dev
# apt-get -y install postgresql
# sudo -u postgres psql

postgres=# CREATE USER "username" WITH PASSWORD 'password';
postgres=# CREATE DATABASE "mydb" WITH OWNER "username";
postgres=# \quit

Установка Redis

# apt-get -y install redis-server

Установка и настройка Ultimate FireWall

# apt-get -y install ufw

# ufw disable

# ufw default deny incoming
# ufw default allow outgoing

# ufw allow ssh
# ufw allow 22/tcp
# ufw allow 22/udp
# ufw allow 2222/tcp
# ufw allow 2222/udp
# ufw allow http
# ufw allow https
# ufw allow 53/udp
# ufw allow 53/tcp

# ufw enable