debian_common

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
debian_common [2020/08/31 04:39] โ€“ [Install & upgrade Nginx] Jรบne Parkdebian_common [2024/04/18 07:49] โ€“ [Major LTS upgrade] Jรบne Park
Line 19: Line 19:
     * [[:cell_epiaux|Jรบne's Primus โ”€ EPiAUX 5X]]     * [[:cell_epiaux|Jรบne's Primus โ”€ EPiAUX 5X]]
     * [[:cell_epihex|Jรบne's Extentus โ”€ EPiHEX 6]]     * [[:cell_epihex|Jรบne's Extentus โ”€ EPiHEX 6]]
 +    * [[:cell_epimer|Jรบne's Maximus โ”€ EPiMER 5P]]
     * [[:cell_epinex|Jรบne's Secondus โ”€ EPiNEX 5]]     * [[:cell_epinex|Jรบne's Secondus โ”€ EPiNEX 5]]
     * [[:cell_epitab|Jรบne's Laminus - EPiTAB 7]]     * [[:cell_epitab|Jรบne's Laminus - EPiTAB 7]]
Line 31: Line 32:
 ===== Initial steps =====  ===== Initial steps ===== 
  
 +==== Watchlist for backup ==== 
 +
 +<code bash> 
 +/etc/nginx/sites-available/
 +/var/www/*
 +/etc/transmission-daemon/  
 +/opt/scripts/ 
 +</code>
 +
 +**update-motd** 
 +<code bash>
 +/etc/update-motd.d/
 +</code>
 +
 +**crontab** 
 +<code bash> 
 +sudo crontab -l 
 +sudo -u www-data crontab -l 
 +crontab -l 
 +</code>
 +
 +**MariaDB** ''per DATABASE''
 +=== Backup MariaDB DATABASE === 
 +
 +<code bash> 
 +/usr/bin/mysqldump --single-transaction -h localhost -u root -p[database_passwd] [database_name] > /..(path)../.backup/[database_name]-sqlbkp_`date +"%Y%m%d"`.bak
 +</code> 
 +
 +---- 
 +
 +=== Backup using rsync command === 
 +
 +== Backup Nginx configuration files == 
 +<code bash> 
 +sudo rsync -avh --progress /etc/nginx/sites-available/ /home/meson/.backup/nginx/nginx_config_`date +"%Y%m"`/ 
 +</code> 
 +
 +== Backup HTML source files == 
 +<code bash> 
 +sudo rsync -avh --progress /var/www/ /home/meson/.backup/html/html_backup_`date +"%Y%m"`/
 +</code> 
 +
 +----
 +=== Remote backup for webpages === 
 +Rsync with ''[TARGET]'' using rsync from ''[SOURCE]''  
 +<code bash> 
 +sudo -u www-data rsync -azP --exclude '.ssh' -e 'ssh -p [port_number]' --rsync-path="sudo rsync" /var/www/ [user]@[TARGET]:"/[TARGET PATH]../../"
 +</code> 
 +Put ''[SOURCE]'' public key in ''[TARGET]'' user's ''authorized_keys'' 
 +
 +----
 +==== Configure log files ==== 
 +
 +Edit ''/etc/nginx/nginx.conf'' 
 +<code nginx> 
 +        access_log /var/log/nginx/_access.log;
 +        error_log /var/log/nginx/_error.log;
 +</code> 
 +
 +----
 +==== Purge log files ==== 
 +
 +== Cleaning compressed log files == 
 +<code bash> 
 +sudo find /var/log -name '*.gz' -exec rm {} \;
 +</code> 
 +
 +----
 +
 +==== Set hostnames ==== 
 +
 +<code bash> 
 +sudo hostname HOSTiD 
 +sudo hostnamectl HOSTiD 
 +</code> 
 +
 +Edit ''/etc/hostname'' with full domain name 
 +
 +<code bash> 
 +hostid.mydomain.com
 +</code> 
 +
 +----
 ==== Enable SSH ====  ==== Enable SSH ==== 
  
Line 53: Line 137:
 Append ''public keys'' for SSH client.  Append ''public keys'' for SSH client. 
  
-=== Enable colorful terminal === +---ย 
 +ย 
 +=== SSH Key to ED25519 === ย 
 +ย 
 +<code bash> ย 
 +ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "john@example.com"ย 
 +</code>ย 
 +ย 
 +  * ''-o'': Save the private-key using the new OpenSSH formatย 
 +  * ''-a'': KDF (Key Derivation Function) rounds. Higher numbers result in slower passphrase verification, increasing the resistance to brute-force password cracking should the private-key be stolen.ย 
 +  * ''-C'': An option to specify a commentย 
 +ย 
 +---ย 
 +ย 
 +==== Enable colorful terminal ==== 
  
 Comment out **''force_color_prompt=yes''** in ''~/.bashrc'' Comment out **''force_color_prompt=yes''** in ''~/.bashrc''
Line 62: Line 160:
 </code> </code>
    
 +=== Time stamp prompt === 
 +
 +Edit ''~/.bashrc'' and change ''PS1'' line 
 +
 +<code bash> 
 +if [ "$color_prompt" = yes ]; then
 +    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;33m\]\D{%T}\[\033[00m\] \[\033[01;37m\]\w\$\[\033[00m\] '
 +else
 +    PS1='${debian_chroot:+($debian_chroot)}\u@\h: \D{%T} \w\$ '
 +fi
 +</code> 
 +
 +Save and load ''.bashrc'' 
 +
 +<code bash> 
 +source ~/.bashrc 
 +</code> 
 +
  
 ---- ----
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
 +</code>
 +
 +----
 +
 === 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 584: Line 722:
  
 MariaDB debug packages will now show up when searching for 'mariadb' with apt and are distinguished by the `-dbgsym` suffix. Debug packages are generally only needed during development and usually should not be installed unless you know that you need them. MariaDB debug packages will now show up when searching for 'mariadb' with apt and are distinguished by the `-dbgsym` suffix. Debug packages are generally only needed during development and usually should not be installed unless you know that you need them.
 +
 +----
 ==== Basic commands 101 ====  ==== Basic commands 101 ==== 
  
  • debian_common
  • Last modified: 2024/04/18 08:58
  • by Jรบne Park