http://st.kr index.html을 수정한다.
st.kr > /var/www/html > root
index.html
< a href="web1.st.kr">web1.st.kr
< a href="web2.st.kr">web2.st.kr
< a href="word.st.kr">word.st.kr
< a href="dvwa.st.kr">dvwa.st.kr
< a href="ci4.st.kr">ci4.st.kr
< a href="lms.st.kr">lms.st.kr
< a href="shop.st.kr">shop.st.kr
< a href="sir.st.kr">sir.st.kr
nat설정
dns확인 :168.126.63.1
netdata 설치
sudo apt -y install netdata
nano /etc/netdata/netdata.conf
bind socket to IP = 0.0.0.0으로 수정
sudo systemctl restart netdata
netstat -ant | grep 19999
virtualbox 포트포워딩 19999 열어주기
192.168.0.214:19999/ 접속
awstats 설치
nano /etc/awstats/awstats.conf
LogFile="/var/log/apache2/access.log" > st.kr 로그이므로 나중에 변경
LogFormat=1
SiteDomain="st.kr"
HostAliases="locatlhost 127.0.0.1 REGEX[^.*www\.st\.kr$]"
nano /etc/apache2/conf-available/awstats.conf
Alias /awstatsicon /usr/shae/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.214/cgi-bin/awstats.pl
그외 설치
sudo apt -y install sysstat
sudo apt -y install prometheus prometheus-node-exporter
apt update
sudo apt -y install aide
용량 확보 하기
df -h
저장소 > 연결추가 > 하드디스크
fdisk -l
fdisk /dev/sdf
mkfs.ext4 /dev/sdf1
vgs 로 여유공간 확인
pvcreate /dev/sdf1
wipe it? yes!
vgextend /dev/ubuntu-vg /dev/sdf1
lvextend -L +25G /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv
df -h
백업 지우기
rm -rf *.tar.gz
* : 와일드 카드
tripwire 설치
sudo apt update
sudo apt-get install tripwire
ok > yes > yes > yes >123456/123456/123456/123456 > ok
설치완료
nano /etc/tripwire/twcfg.txt
reportlevel =3
man twadmin
twadmin -m F -c tw.cfg -S site.key twcfg.txt (123456)
nano twpolmake.pl
아래 내용 붙이기
#!/usr/bin/perl
# Tripwire Policy File customize tool
# ----------------------------------------------------------------
# Copyright (C) 2003 Hiroaki Izumi
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# ----------------------------------------------------------------
# Usage:
# perl twpolmake.pl {Pol file}
# ----------------------------------------------------------------
#
$POLFILE=$ARGV[0];
open(POL,"$POLFILE") or die "open error: $POLFILE" ;
my($myhost,$thost) ;
my($sharp,$tpath,$cond) ;
my($INRULE) = 0 ;
while (< POL>) {
chomp;
if (($thost) = /^HOSTNAME\s*=\s*(.*)\s*;/) {
$myhost = `hostname` ; chomp($myhost) ;
if ($thost ne $myhost) {
$_="HOSTNAME=\"$myhost\";" ;
}
}
elsif ( /^{/ ) {
$INRULE=1 ;
}
elsif ( /^}/ ) {
$INRULE=0 ;
}
elsif ($INRULE == 1 and ($sharp,$tpath,$cond) = /^(\s*\#?\s*)(\/\S+)\b(\s+->\s+.+)$/) {
$ret = ($sharp =~ s/\#//g) ;
if ($tpath eq '/sbin/e2fsadm' ) {
$cond =~ s/;\s+(tune2fs.*)$/; \#$1/ ;
}
if (! -s $tpath) {
$_ = "$sharp#$tpath$cond" if ($ret == 0) ;
}
else {
$_ = "$sharp$tpath$cond" ;
}
}
print "$_\n" ;
}
close(POL) ;
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
오류시 ls -l /var/lib/tripwire/ (twd 파일 생성 확인)
파일 생성 문제 아닐경우 tw.cfg 다시 생성
sudo twadmin --create-cfgfile -S /etc/tripwire/site.key /etc/tripwire/twcfg.txt
tripwire -m c -s -c /etc/tripwire/tw.cfg
tripwire -m c -s -c /etc/tripwire/tw.cfg > tw_report.txt
tw_report.txt 확인해보기
참고사이트
https://www.server-world.info/en/note=?os=Ubuntu_18.04&p=tripwire