Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
debian_common [2020/07/28 08:38] โ [Basic commands 101] Jรบne Park | debian_common [2024/04/18 07:49] โ [Major LTS upgrade] Jรบne Park | ||
---|---|---|---|
Line 19: | Line 19: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
+ | * [[: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 31: | Line 32: | ||
===== Initial steps ===== | ===== Initial steps ===== | ||
+ | ==== Watchlist for backup ==== | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | /var/www/* | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | **update-motd** | ||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | **crontab** | ||
+ | <code bash> | ||
+ | sudo crontab -l | ||
+ | sudo -u www-data crontab -l | ||
+ | crontab -l | ||
+ | </ | ||
+ | |||
+ | **MariaDB** '' | ||
+ | === Backup MariaDB DATABASE === | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Backup using rsync command === | ||
+ | |||
+ | == Backup Nginx configuration files == | ||
+ | <code bash> | ||
+ | sudo rsync -avh --progress / | ||
+ | </ | ||
+ | |||
+ | == Backup HTML source files == | ||
+ | <code bash> | ||
+ | sudo rsync -avh --progress /var/www/ / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | === Remote backup for webpages === | ||
+ | Rsync with '' | ||
+ | <code bash> | ||
+ | sudo -u www-data rsync -azP --exclude ' | ||
+ | </ | ||
+ | Put '' | ||
+ | |||
+ | ---- | ||
+ | ==== Configure log files ==== | ||
+ | |||
+ | Edit ''/ | ||
+ | <code nginx> | ||
+ | access_log / | ||
+ | error_log / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | ==== Purge log files ==== | ||
+ | |||
+ | == Cleaning compressed log files == | ||
+ | <code bash> | ||
+ | sudo find /var/log -name ' | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Set hostnames ==== | ||
+ | |||
+ | <code bash> | ||
+ | sudo hostname HOSTiD | ||
+ | sudo hostnamectl HOSTiD | ||
+ | </ | ||
+ | |||
+ | Edit ''/ | ||
+ | |||
+ | <code bash> | ||
+ | hostid.mydomain.com | ||
+ | </ | ||
+ | |||
+ | ---- | ||
==== Enable SSH ==== | ==== Enable SSH ==== | ||
Line 53: | Line 137: | ||
Append '' | Append '' | ||
- | === Enable colorful terminal === | + | ---ย |
+ | ย | ||
+ | === SSH Key to ED25519 === ย | ||
+ | ย | ||
+ | <code bash> ย | ||
+ | ssh-keygen -o -a 100 -t ed25519 -f ~/ | ||
+ | </ | ||
+ | ย | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | ย | ||
+ | ---ย | ||
+ | ย | ||
+ | ==== Enable colorful terminal | ||
Comment out **'' | Comment out **'' | ||
Line 62: | Line 160: | ||
</ | </ | ||
+ | === Time stamp prompt === | ||
+ | |||
+ | Edit '' | ||
+ | |||
+ | <code bash> | ||
+ | if [ " | ||
+ | PS1=' | ||
+ | else | ||
+ | PS1=' | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | Save and load '' | ||
+ | |||
+ | <code bash> | ||
+ | source ~/ | ||
+ | </ | ||
+ | |||
---- | ---- | ||
Line 172: | Line 288: | ||
---- | ---- | ||
+ | === NO-IP with ddclient === | ||
+ | |||
+ | <code ini> | ||
+ | protocol=dyndns2 | ||
+ | server=dynupdate.no-ip.com | ||
+ | login=your_login_id | ||
+ | password=your_password | ||
+ | your_domain.com | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
=== Google Domains with API === | === Google Domains with API === | ||
Line 392: | Line 520: | ||
---- | ---- | ||
+ | |||
+ | |||
+ | |||
+ | ===== Install Services ===== | ||
+ | |||
+ | ==== Nextcloudโข ==== | ||
+ | |||
+ | [[os_nextcloud|Nextcloud 101]] --- Nextcloud user's Guides | ||
+ | |||
+ | ---- | ||
===== Upgrade & Maintenance ===== | ===== Upgrade & Maintenance ===== | ||
Line 540: | Line 678: | ||
sudo apt install nginx | sudo apt install nginx | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Upgrade mariadb ==== | ||
+ | |||
+ | <button type=" | ||
+ | |||
+ | Select '' | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-get install software-properties-common | ||
+ | sudo apt-key adv --fetch-keys ' | ||
+ | sudo add-apt-repository 'deb [arch=amd64, | ||
+ | </ | ||
+ | |||
+ | Once the key is imported and the repository added you can install MariaDB 10.5 from the MariaDB repository with: | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt update | ||
+ | sudo apt install mariadb-server | ||
+ | </ | ||
+ | |||
+ | Check service is working correctly and installed version. | ||
+ | |||
+ | <code bash> | ||
+ | sudo mysql -uroot -p | ||
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | < | ||
+ | # MariaDB 10.5 repository list - created 2020-08-31 04:34 UTC | ||
+ | # http:// | ||
+ | deb [arch=amd64] https:// | ||
+ | deb-src https:// | ||
+ | </ | ||
+ | |||
+ | If you need debug packages, add the debug component to your sources.list with: | ||
+ | |||
+ | <code bash> | ||
+ | sudo add-apt-repository 'deb [arch=amd64, | ||
+ | </ | ||
+ | |||
+ | MariaDB debug packages will now show up when searching for ' | ||
---- | ---- |