1.
vi /etc/sysconfig/network-scripts/ifcfg-ens33 //ip 설정
DNS1=192.168.10.10 //DNS1 ip 를 본인 아이피로 변경
service network restart //데몬 실행
cat /etc/resolv.conf -> 설정한 dns와 ip 가 일치하는지 확인
yum install bind* -y dns해야하니까 관련 명령어 다운
vi /etc/named.conf dns옵션 바꾸기
listen-on port 53 { any; }; 53포트 연결 누구나
allow-quety { any; }; 질문 누구나
dnssec-enable no; dns허가 no
dnssec-validation no; dns확인 no
vi /etc/named.rfc1912.zones 존파일 타입이라던가 파일 정의
주영역
zone "sevas10.com" IN { //sevas10.com 설정
type master; //주영역으로 설정
file "sevas10.zone" //dns 파일설정
allow-update { none; } //업데이트 안해여
};
zone "korea10.com" IN { //sevas10.com 설정
type master; //주영역으로 설정
file "korea10.zone" //dns 파일설정
allow-update { none; } //업데이트 안해여
};
cd /var/named //dns ip 넣을 파일 만들어야지
cp named.empty sevas10.zone //기존파일 복사해서 sevas10.zone dns ip 넣을 파일을 만든다
vi /sevas10.com //ns.sevas10.com = @
$TTL 3H
@ IN SOA @ root.sevas.10.com. (
IN NS @
IN A 192.168.10.10
ns IN A IP //등등 입력
chmod 660 sevas10.zone
chmod 660 korea10.zone
chown .named sevas10.zone
chown .named korea10.zone
firewall-cmd --permanent --add-port 53/udp //udp
firewall-cmd --permanent --add-port 80/tcp //tcp
firewall-cmd --permanent --add-service ftp //ftp 해야하니까
firewall-cmd --reload //적용
firewall-cmd --list-all //확인
service named restart //적용 데몬실행
2.
yum install httpd* -y
yum install vsftpd* -y
yum install net-tools -y
systemctl enable named
systemctl enable httpd
systemctl enavle vsftpd
vi /etc/httpd/conf/httpd.conf
Listen 192.168.10.10:8080 // 추가 8080포트로만 192.168.10.10열수있게
ServerName www.sevas10.com:80 : 변경 서버이름
<Directory />
AllowOverride none
#Require all denied //주석처리 모든요구거부 하지 않게
</Directory>
DocumentRoot "/export/sdb/home/main/html" // 변경 인덱스 열 디렉토리
<IfModule dir_module>
DirectoryIndex index.sevas index.html //변경 인덱스파일 이름
service httpd restart //데몬실행
cd /etc/httpd/conf.d
vi vir.host.conf
<Directory /export/sdb/home/main/admin>
AllowOverride AuthConfig
</Directory>
<VirtualHost 192.168.10.10:8080>
ServerAdmin root@sevas.com //존파일
DocumentRoot /export/sdb/home/main/admin //인덱스 디렉토리
SeverName ad.sevas10.com
ErrorLog logs/ad.sevas10.com-error_log //에러 로그
TransferLog logs/ad.sevas10.com-access_log //엑세스 로그
</VirtualHost>
service httpd restart
firewall-cmd --permanent --add-port 8080/tcp
firewall-cmd --reload
netstat -lntup
3.
cmd에서
telnet 192.168.10.10 80
a enter
4.
4-1Directory listing
vi /etc/httpd/conf/httpd.conf
ServerName www.sevas10.com:80 변경
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "/home/sevas/html">
# Options Indexes FollowSymLinks
Options
AllowOverride None
Require all granted
</Directory>
DocumentRoot "/var/www/html"
cd /home
useradd sevas
passwd sevas
chmod 705 ~sevas
chown
cd sevas
mkdir html
cd html
touch 1 2 3
4-2 banner grabbing
yum install php* -y
yum install php* --skip-broken
vi /etc/httpd/conf.d
ServerSignature off
ServerTokens Prod
첫번째줄 에 추가
5 키
yum install openssl mod_ssl
mkdir -p /cert/key
cd /cert/key
***** 알아둘점 ****
cert => 인증서
csr => 인증서 신청서
key => 암호화
1. 키생성
openssl genrsa -out sevas.key 2048
2. 신청서작성
openssl req -new -key sevas.key > sevas.csr
Country Name [xx] : 어디나라? KR
state or province name : 지역 Seoul
locality Name : 도시 Gangnam
organization Name : WebSecure
organizational Unit Name : sevas
common Name(hostname) : sevas10.com
email address : root@sevas10.com
3. 최종인증서생성
openssl x509 -req -days 365 -in sevas.csr -signkey sevas.key -out sevas.crt
[확인]
openssl x509 -text -in sevas.crt -noout
sevas.key sevas.csr sevas.crt 잘확인할것
=========================================================================
=====================================================
vi /etc/httpd/conf.d/ssl.conf
# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. A new
# certificate can be generated using the genkey(1) command.
#SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateFile /cert/key/sevas.crt <<<<<<요부분
# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
#SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
SSLCertificateKeyFile /cert/key/sevas.key <<<<<<<<요부분
**데몬시작전 hostname 확인해서 바꿔준다 **
hostnamectl set-hostname sevas10.com
재로그인뒤 hostname 확인
service httpd restart
방화벽 설정
firewall-cmd --permanent --add-port 443/tcp
firewall-cmd --reload
'수업' 카테고리의 다른 글
시험준비 crontab (0) | 2023.08.24 |
---|---|
시험준비 (0) | 2023.08.16 |
실습 DNS FTP (0) | 2023.08.11 |
DNS (0) | 2023.08.07 |
fdisk (0) | 2023.08.07 |