How to set up a VPS: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
* Log in as root via ssh | * Log in as root via ssh | ||
* add line to <code>/etc/hosts</code> | * add line to <code>/etc/hosts</code> | ||
* <code>dpkg-reconfigure tzdata</code> | * <code>dpkg-reconfigure tzdata</code> | ||
Line 8: | Line 7: | ||
usermod -aG sudo myuser | usermod -aG sudo myuser | ||
</pre> | </pre> | ||
* <code>apt | * <code>apt install emacs-nox nmap ntp postfix mailutils logwatch unzip zip</code> | ||
* update ssh to listen on a different port | * update ssh to listen on a different port by editing <code>/lib/systemd/system/ssh.socket</code>, then restart ssh. Test it! | ||
* Carefully deny root access | |||
* set up firewall | * set up firewall | ||
* set up backups | * set up backups | ||
* apt | * apt install nginx mysql-server supervisor | ||
* install docker-compose: http://docs.docker.com/compose/install/ | * install docker-compose: http://docs.docker.com/compose/install/ | ||
* fix [[mysql]], create mysql databases and app accounts | * fix [[mysql]], create mysql databases and app accounts | ||
Line 18: | Line 18: | ||
* set up sites in <code>/etc/nginx/sites-available</code> and activate in <code>/etc/nginx/sites-enabled</code> | * set up sites in <code>/etc/nginx/sites-available</code> and activate in <code>/etc/nginx/sites-enabled</code> | ||
* set up apps in <code>/etc/supervisor/conf.d</code> | * set up apps in <code>/etc/supervisor/conf.d</code> | ||
== 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 |
Latest revision as of 18:49, 25 October 2024
- 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. Test it! - Carefully deny root access
- set up firewall
- set up backups
- apt 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