38일차
서버 모니터링 시스템 설치
sudo apt -y install netdata
sudo apt -y install sysstat
sudo apt -y install prometheus prometheus-node-exporter
sudo apt -y install aide
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-3+ubuntu22.04_all.deb
dpkg -i zabbix-release_6.0-3+ubuntu22.04_all.deb
apt update
apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent2 php-mysql php-gd php-bcmath php-net-socket
sudo nano /etc/netdata/netdata.conf
bind socket to IP = 0.0.0.0
sudo systemctl restart netdata
netstat -ant | grep 19999
192.168.0.204:19999
디스크 용량 늘리는 방법
물리적인 디스크를 추가해주고
fdisk -l
fdisk /dev/sdc
n
p
enter
enter
enter
w
mkfs.ext4 /dev/sdc1
vgs 로 여유공간 확인
pvcreate /dev/sdc1
vgextend /dev/ubuntu-vg /dev/sdc1
lvextend -L +50G /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv
df -h
sudo apt -y install awstats
nano /etc/awstats/awstats.conf
# line 126 : set [1] if httpd log format is [combined]
# for [common], set [4]
LogFormat=1
# line 157 : set hostname
SiteDomain="st.kr"
# line 172 : set domains or IP addresses you'd like to exclude on reports
HostAliases="localhost 127.0.0.1 REGEX[^.*www\.srv\.world$]"
nano /etc/apache2/conf-available/awstats.conf
# create new
Alias /awstats-icon/ /usr/share/awstats/icon/
Alias /awstatsclasses/ /usr/share/java/awstats/
<Directory /usr/share/awstats>
Options FollowSymLinks
AllowOverride None
# access permission for your local network
Require ip 127.0.0.1 0.0.0.0/24
</Directory>
a2enconf awstats
a2enmod cgid
systemctl restart apache2
/usr/share/awstats/tools/update.sh
/usr/share/awstats/tools/buildstatic.sh
확인방법: 192.168.0.204/cgi-bin/awstats.pl
sudo apt update
sudo apt-get install tripwire
cd /etc/tripwire
nano twcfg.txt
twadmin -m F -c tw.cfg -S site.key twcfg.txt
nano twpolmake.pl
perl twpolmake.pl twpol.txt > twpol.txt.new
twadmin -m P -c tw.cfg -p tw.pol -S site.key twpol.txt.new
tripwire -m i -s -c tw.cfg
tripwire -m c -s -c /etc/tripwire/tw.cfg
tripwire -m i -s -c tw.cfg
ll /var/lib/tripwire/report
tripwire -m u -a -s -c /etc/tripwire/tw.cfg \
-r /var/lib/tripwire/report/dlp.srv.world-20181129-140452.twr
참고사이트
https://www.server-world.info/en/note?os=Ubuntu_18.04&p=tripwire
분석일지를 만들어라