linux:webhosting
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:webhosting [2020/11/24 23:09] – created admin | linux:webhosting [2024/02/17 19:03] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Webhosting Commands ====== | ||
+ | |||
< | < | ||
sudo chown -R www-data: | sudo chown -R www-data: | ||
Line 6: | Line 8: | ||
sudo systemctl restart nginx | sudo systemctl restart nginx | ||
</ | </ | ||
+ | |||
+ | ===== htpasswd ===== | ||
+ | |||
+ | Generate Basic Auth Credentials | ||
+ | |||
+ | ==== Installation ==== | ||
+ | < | ||
+ | sudo apt update | ||
+ | sudp apt install htpasswd | ||
+ | </ | ||
+ | |||
+ | ==== Generate Credentials ==== | ||
+ | < | ||
+ | htpasswd -n werner | ||
+ | # on standard output rather than updating a file | ||
+ | htpasswd -c ~/ | ||
+ | htpasswd ~/ | ||
+ | </ | ||
+ | |||
+ | === Traefik === | ||
+ | |||
+ | ** Don't forget to escape dollar signs ($ -> $$) in traefik docker compose files! ** | ||
+ | |||
+ | use this command: | ||
+ | |||
+ | < | ||
+ | echo $(htpasswd -nB werner) | sed -e s/ | ||
+ | </ | ||
+ | |||
+ | in the docker compose file: | ||
+ | < | ||
+ | ... | ||
+ | labels: | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | ... | ||
+ | </ |
linux/webhosting.1606255781.txt.gz · Last modified: 2024/02/17 19:03 (external edit)