Difference between revisions of "Server Administration"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | === SYSTEM LOGS === | ||
<syntaxhighlight> | <syntaxhighlight> | ||
du -csh /var/log/* | du -csh /var/log/* | ||
Line 17: | Line 18: | ||
nano /etc/nginx/nginx.conf | nano /etc/nginx/nginx.conf | ||
ulimit -n | ulimit -n | ||
+ | |||
+ | # CREATE 4GB SWAP FILE | ||
+ | sudo dd if=/dev/zero of=/swapfile bs=128M count=32 | ||
+ | sudo chmod 600 /swapfile | ||
+ | sudo mkswap /swapfile | ||
+ | sudo swapon /swapfile | ||
+ | sudo swapon -s | ||
+ | sudo vi /etc/fstab | ||
+ | /swapfile swap swap defaults 0 0 | ||
+ | |||
nano /etc/sysctl.conf | nano /etc/sysctl.conf | ||
Line 23: | Line 34: | ||
df -h | df -h | ||
+ | </Syntaxhighlight> | ||
+ | |||
+ | ===EXTEND AWS LINUX FILE SYSTEM=== | ||
+ | <syntaxhighlight> | ||
+ | df -hT | ||
+ | sudo lsblk | ||
+ | sudo growpart /dev/nvme0n1 1 | ||
+ | sudo lsblk | ||
+ | df -hT | ||
+ | sudo xfs_growfs -d / | ||
+ | df -hT | ||
</Syntaxhighlight> | </Syntaxhighlight> |
Latest revision as of 21:56, 1 May 2024
SYSTEM LOGS
du -csh /var/log/*
journalctl --disk-usage
sudo journalctl --vacuum-size=100M
nano /etc/systemd/journald.conf
service systemd-journald restart
SWAPPINESS
nano /etc/sysctl.conf
vm.overcommit_memory=1
vm.swappiness=80
# restart server
grep processor /proc/cpuinfo | wc -l
nano /etc/nginx/nginx.conf
ulimit -n
# CREATE 4GB SWAP FILE
sudo dd if=/dev/zero of=/swapfile bs=128M count=32
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
sudo vi /etc/fstab
/swapfile swap swap defaults 0 0
nano /etc/sysctl.conf
free -h
sudo swapon --all --verbose
df -h
EXTEND AWS LINUX FILE SYSTEM
df -hT
sudo lsblk
sudo growpart /dev/nvme0n1 1
sudo lsblk
df -hT
sudo xfs_growfs -d /
df -hT