์ƒˆ์†Œ์‹

์ธ๊ธฐ ๊ฒ€์ƒ‰์–ด

๐Ÿ’ป Linux

CentOS7 Digest,Basic ์•”ํ˜ธํ™”

  • -
๋ฐ˜์‘ํ˜•

๐Ÿ’ก ํฌํŠธ ์Šค์บ๋‹ netstat -natlp | grep httpd

๐Ÿ’ก ํ•œ๊ฐ€์ง€ ํฌํŠธ ์Šค์บ๋‹ lsof -i tcp:80 #http 443 #https

๐Ÿ’ก ๋ฒ„์ „ ํ™•์ธ httpd -v

 

# ์•„ํŒŒ์น˜ ์„œ๋ฒ„ ์ˆ˜์ •
vim /etc/httpd/conf/httpd.conf
> Order allow, deny
	>Allow from all
	>deny from 192.168.120. # ํ•ด๋‹น ip ๋ฒคํ•˜๊ธฐ

vim index.html

# window ๋ฐฉํ™”๋ฒฝ
firewall.cpl > ๊ณ ๊ธ‰ ์„ค์ • > ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ > ๊ฐ€์ƒ WEB > ํ”„๋กœํ† ์ฝœ ๋ฐ ํฌํŠธ > ๋กœ์ปฌ ํฌํŠธ 10080, 10081๋กœ ์„ค์ •

# ํฌํŠธ ์„ค์ •
Virtual Network Editor - NAT Settings - Host port 10080/10081 IP 192.168.111.100/200 machine port 80

# ํฌํŠธ ์„ค์ •
Edit - virtual network edit - vmnet8 NAT Setting - 192.168.111.200:80

<http://192.168.0.40:10081/wordpress/>
# Digest md5 ์ €์žฅ ์•”ํ˜ธ
# ์„ค์ • ํŒŒ์ผ ์ƒ์„ฑ
vim /etc/httpd/conf.d/auth_digest.conf

> <Directory /var/www/html/digest>
AuthType Digest
AuthName "Digest Private Area"
AuthUserFile /etc/httpd/.htdigest
Require valid-user
Order deny,allow
Deny from all
Allow from 192.168.0. 192.168.111.

</Directory>

# ๋น„๋ฐ€๋ฒˆํ˜ธ ๋งŒ๋“ค๋ฉด์„œ ํŒŒ์ผ๊นŒ์ง€ ์ƒ์„ฑ
htdigest -c /etc/httpd/.htdigest "Digest Private Area" benmin
htdigest /etc/httpd/.htdigest "Digest Private Area" jain

mkdir digest
cp index.html digest/index.html
cd digest/
vim index.html

cat /etc/httpd/.htdigest # ๊ณ„์ •๊ณผ ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ

<http://192.1168.111.100/digest/>
# Basic ์ €์žฅ ์•”ํ˜ธ
# ์„ค์ • ํŒŒ์ผ ์ƒ์„ฑ
vim /etc/httpd/conf.d/auth_basic.conf

> <Directory /var/www/html/basic>
AuthType Basic
AuthName "Basic Authentication Test"
AuthUserFile /etc/httpd/.htpasswd
Require user benmin jain
Require valid-user
Order deny,allow
Deny from all
Allow from 192.168.0. 192.168.111.
</Directory>

# ๋น„๋ฐ€๋ฒˆํ˜ธ ๋งŒ๋“ค๋ฉด์„œ ํŒŒ์ผ๊นŒ์ง€ ์ƒ์„ฑ
htpasswd -c /etc/httpd/.htpasswd benmin
htpasswd /etc/httpd/.htpasswd jain

systemctl restart httpd

mkdir basic
cp /var/www/html/index.html index.html

cat /etc/httpd/.htpasswd # ๊ณ„์ •๊ณผ ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ

<http://192.168.111.100/basic/>
๋ฐ˜์‘ํ˜•

'๐Ÿ’ป Linux' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

CentOS7 HTTPS ๋ณด์•ˆ  (0) 2022.04.20
CentOS7 python,tomcat ์›น ๊ตฌ์ถ•  (0) 2022.04.20
CentOS7 , Ubuntu Bridge ์„ค์ •  (0) 2022.04.20
CentOS7 ์›น ์„œ๋ฒ„ ์„ค์น˜ ๋ฐ ํ™œ์„ฑํ™”  (0) 2022.04.20
CentOS7 RAID  (0) 2022.04.15
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.