apt update
apt upgrade
curl -sSL https://install.pi-hole.net | bash
pihole -up
curl -L https://install.pivpn.io | bash
apt install nginx
ufw status
ufw allow 'Nginx Full'
ufw delete allow 'Nginx HTTP'
apt install php-fpm php-cli php-curl php-mysql php-curl php-gd php-mbstring php-pear
apt install mysql-server
mysql -u root
CREATE DATABASE database;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
wget https://download.nextcloud.com/server/installer/setup-nextcloud.php
apt install certbot python3-certbot-nginx
certbot --nginx
certbot --nginx -d example.com -d www.example.com
nano /etc/ssh/ssh_config
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
nano /etc/nginx/sites-available/example.com
server {
listen 80;
server_name _;
location / {
include proxy_params;
proxy_pass http://127.0.0.1:5000;
}
location /static/ {
alias /static/;
expires 30d;
}
location /socket.io {
include proxy_params;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:5000/socket.io;
}
}
nginx -t
systemctl reload nginx
ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
chown -R www-data:www-data /var/www/html/example.com
nano /etc/systemd/system/flask.service
[Unit] Description=uWSGI instance to serve flask-app After=network.target [Service] User=user Group=www-data WorkingDirectory=/home/user/flask-app Environment="PATH=/home/user/flask-app/.venv/bin" ExecStart=python3 /home/user/flask-app/wsgi.py [Install] WantedBy=multi-user.target
systemctl start flask
systemctl enable flask
systemctl status flask