Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
debian_common [2020/07/26 17:44] โ [Basic commands 101] Jรบne Park | debian_common [2024/03/19 11:30] โ [Watchlist for backup] Jรบne Park | ||
---|---|---|---|
Line 19: | Line 19: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
+ | * [[: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 30: | Line 31: | ||
---- | ---- | ||
===== 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 ' | ||
+ | </ | ||
+ | |||
+ | ---- | ||
==== Enable SSH ==== | ==== Enable SSH ==== | ||
Line 53: | Line 123: | ||
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 146: | ||
</ | </ | ||
+ | === Time stamp prompt === | ||
+ | |||
+ | Edit '' | ||
+ | |||
+ | <code bash> | ||
+ | if [ " | ||
+ | PS1=' | ||
+ | else | ||
+ | PS1=' | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | Save and load '' | ||
+ | |||
+ | <code bash> | ||
+ | source ~/ | ||
+ | </ | ||
+ | |||
---- | ---- | ||
Line 172: | Line 274: | ||
---- | ---- | ||
+ | === 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 540: | Line 654: | ||
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 ' | ||
---- | ---- | ||
Line 662: | Line 820: | ||
---- | ---- | ||
- | === tree === | ||
- | | ||
- | tree | ||
- | | ||
- | The tree is a tiny, cross-platform command-line program used to recursively list or display the content of a directory in a tree-like format. | ||
- | |||
- | ---- | ||