Skip to main content

Posts

Showing posts from 2023

Push image to Docker https registry

 Setup remote https registry docker container stop registry docker container rm -v registry ls /var/lib/ cd mkdir certs cd certs openssl req   -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key   -addext "subjectAltName = DNS:myregistry.jankester.com"   -x509 -days 365 -out certs/domain.crt cd .. openssl req   -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key   -addext "subjectAltName = DNS:myregistry.jankester.com"   -x509 -days 365 -out certs/domain.crt ls -ltr ls cd certificate_authority history | grep import ls -ltr ../ ls -ltr ../certs cd docker run -d   --restart=always   --name registry   -v "$(pwd)"/certs:/certs   -e REGISTRY_HTTP_ADDR=0.0.0.0:5443   -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt   -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key   -p 5443:5443   registry:2 docker container ls history | grep allow sudo ufw al...

Certbot https certificate

 Install https certificate for apache sudo apt install certbot python3-certbot-apache cd /etc/apache2/sites-available/ ls sudo cp 000-default.conf jankester-com.conf sudo vi jankester-com.conf sudo a2ensite jankester-com.conf sudo a2dissite 000-default.conf sudo apache2ctl configtest cd /var/www/ ls ls -l sudo mkdir jankester-com sudo mkdir jankester-com/public_html sudo cp html/* jankester-com/public_html/. sudo apache2ctl configtest sudo systemctl restart apache2 sudo ufw status sudo certbot --apache sudo apt-get install certbot python-certbot-apache sudo apt-get install certbot python3-certbot-apache sudo certbot --apache sudo apt install certbot python3-certbot-apache certbot --version sudo apt install snapd sudo snap install --classic certbot /snap/bin/certbot --version sudo /snap/bin/certbot --apache cd jankester-com/public_html/

Install tileserver

Install Postgis  sudo apt-get install -y postgresql postgis sudo apt-get install -y postgresql-contrib postgresql-12-postgis-3 postgresql-12-postgis-3-scripts sudo service postgresql start locale git --version # to verify whether git is already installed sudo apt-get install -y git sudo apt-get install -y postgresql-contrib postgresql-12-postgis-3 postgresql-12-postgis-3-scripts sudo service postgresql start echo $USER locale -c locale createdb gis --encoding="UTF8" --lc-collate="en_US.UTF-8" --lc-ctype="en_US.UTF-8" --template=template0 sudo -u postgres createuser -s $USER createdb gis --encoding="UTF8" --lc-collate="en_US.UTF-8" --lc-ctype="en_US.UTF-8" --template=template0 psql -d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;' psql -d gis -c "create user jan;grant all privileges on database gis to postgres;" psql -d gis -c "grant all privileges on database gis to postgres;" psql -d g...