How to set up a VPS

From Wiki
Revision as of 18:33, 25 October 2024 by Scott (talk | contribs)
Jump to navigation Jump to search
  • Log in as root via ssh
  • add line to /etc/hosts
  • dpkg-reconfigure tzdata
  • create user account, add to sudoers:
useradd --create-home --shell /bin/bash myuser
usermod -aG sudo myuser
  • apt install emacs-nox nmap ntp postfix mailutils logwatch unzip zip
  • update ssh to listen on a different port by editing /lib/systemd/system/ssh.socket, then restart ssh.

and (carefully) to deny root access

  • set up firewall
  • set up backups
  • apt-get install nginx mysql-server supervisor
  • install docker-compose: http://docs.docker.com/compose/install/
  • fix mysql, create mysql databases and app accounts
  • schedule nightly database snapshots
  • set up sites in /etc/nginx/sites-available and activate in /etc/nginx/sites-enabled
  • set up apps in /etc/supervisor/conf.d

after setting up DNS name

  • update hostname in /etc/hosts, /etc/hostname, run "hostname -F /etc/hostname"
  • configure postfix
  • make sure you receive nightly log messages