๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Back-end/Server

[Linux] Apache Web Server ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ• *์˜ค๋ผํด ์—ฐ๋™ 2ํƒ„*

728x90
๋ฐ˜์‘ํ˜•

๐ŸŸก Linux์— Apache Web Server ์„ค์น˜ํ•˜๊ธฐ

โœ… Apache Web Server ๋ž€?

์•„ํŒŒ์น˜ ์†Œํ”„ํŠธ์›จ์–ด ์žฌ๋‹จ์—์„œ ๊ด€๋ฆฌํ•˜๋Š” ์˜คํ”ˆ์†Œ์Šค ์›น ์„œ๋ฒ„๋กœ์„œ, ๋ฆฌ๋ˆ…์Šค๋ฅผ OS๋กœ ํ•˜์—ฌ ๊ฐ€์žฅ ๋งŽ์ด ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋‹ค. ์›น ์„œ๋ฒ„ ๊ตฌ๋™์„ ์œ„ํ•œ APM ์ค‘ A ๋ถ€๋ถ„์— ํ•ด๋‹นํ•˜๋Š” ๊ฒƒ์ด๋‹ค.

 

APM ๊ตฌ๋™ ์›๋ฆฌ

 

 

 

โœ… Apache Web Server ์„ค์น˜ํ•˜๊ธฐ

์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ๋‹ค์šด๋กœ๋“œ
yum install -y httpd

 

์„ค์น˜ ์™„๋ฃŒ

 

=> ์œ„ ๋ฐฉ๋ฒ•์œผ๋กœ ์ž˜ ๋˜์ง€ ์•Š๋Š”๋‹ค๋ฉด,

https://ansan-survivor.tistory.com/120

์ฐธ๊ณ ํ•˜๊ธฐ!!!

 

 

ํŒจํ‚ค์ง€ ์„ค์น˜ ํ™•์ธ
rpm -qa | grep httpd

httpd -v

 

=> ์ œ๋Œ€๋กœ ์„ค์น˜๊ฐ€ ๋˜์–ด์žˆ๋Š”์ง€ ํ™•์ธ ์™„๋ฃŒ

 

 

์„œ๋น„์Šค ์žฌ์‹œ์ž‘
systemctl start httpd	# ์„œ๋น„์Šค ์‹œ์ž‘
systemctl enable httpd	# ์„œ๋น„์Šค ๋ถ€ํŒ…๋  ๋•Œ๋งˆ๋‹ค ์‹คํ–‰

 

 

๋ฐฉํ™”๋ฒฝ ์„ค์ •
# ์„œ๋น„์Šค ์ถ”๊ฐ€
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-port=80/tcp	# 80๋ฒˆ ํฌํŠธ ์ถ”๊ฐ€(http๊ฐ€ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ํฌํŠธ)
firewall-cmd --reload	# ์ ์šฉ

์„ฑ๊ณต์ ์œผ๋กœ ์ ์šฉ

 

 

์„œ๋น„์Šค์™€ ํฌํŠธ ์ƒํƒœ ํ™•์ธ
netstat -ntlp | grep httpd

์ •์ƒ!

 

 

httpd.conf ํŒŒ์ผ ์„ค์ • ๋ณ€๊ฒฝ
cd /etc/httpd/conf

=> ์œ„ ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•˜๊ธฐ

vi httpd.conf

=> ์œ„ ํŒŒ์ผ ์ค‘ ServerName ๋ถ€๋ถ„์„ ์ฃผ์„ ํ•ด์ œํ•˜๊ธฐ or ์ง์ ‘ ์ž…๋ ฅ

 

localhost ๋ฐ ์ž์‹ ์˜ IP ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ๊ธฐ

 

↓↓↓ ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…๐Ÿ’จ๐Ÿ’จ๐Ÿ’จ

๋”๋ณด๊ธฐ

https://ye5ni.tistory.com/162

=> ์œ„ ๊ณผ์ •์„ ์ง„ํ–‰ํ•˜๊ฒŒ ๋œ ์ด์œ ! Trouble Shooting ๐Ÿ™Œ

 

 

localhost ๋˜๋Š” ๋ณธ์ธ ํ˜ธ์ŠคํŠธ IP๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ™•์ธ

์œ„์™€ ๊ฐ™์€ ํ™”๋ฉด์ด ๋œฌ๋‹ค๋ฉด ์ •์ƒ์ ์œผ๋กœ ์ถœ๋ ฅ๋œ ๊ฒƒ!

 

 

↓↓↓ ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…๐Ÿ’จ๐Ÿ’จ๐Ÿ’จ

๋”๋ณด๊ธฐ

๋ชจ๋“  ์„ค์ •์ด ๋‹ค ์™„๋ฒฝํ•˜๊ฒŒ ๋˜์–ด์žˆ์Œ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ  localhost ๋ฐ ํ˜ธ์ŠคํŠธ IP ์ฃผ์†Œ๋กœ ์ ‘์†์ด ๋˜์ง€ ์•Š์•˜๋‹ค...

ํ•œ์ฐธ์„ ์‚ฝ์งˆํ•œ ๋์— NAT๋ฅผ ์ด์šฉํ•œ ๊ฐ€์ƒ ์„œ๋ฒ„๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ์ƒํ™ฉ์—์„œ ๋†“์นœ ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๊นจ๋‹ฌ์•˜๋‹ค...! ๐Ÿ˜‚

https://ye5ni.tistory.com/163

=> ์—๋Ÿฌ ํ•ด๊ฒฐ ๊ณผ์ •!!! Trouble Shooting ๐Ÿ™Œ

 

 

ํ•˜์ง€๋งŒ, ์œ„ ํ™”๋ฉด์€ default ํŽ˜์ด์ง€์ผ ๋•Œ ์ด๋ ‡๊ฒŒ ๋‚˜์˜จ๋‹ค. ๋‚˜์˜ ์›น ์‚ฌ์ดํŠธ๋ฅผ ๋งŒ๋“ค์—ˆ์œผ๋‹ˆ ์•„๋ฌด ๊ธ€์ž๋ผ๋„ ๋„์›Œ๋ณด์ž.

 

 

 

 

๋‚˜๋งŒ์˜ ์›น ํŽ˜์ด์ง€ ๋งŒ๋“ค์–ด๋ณด๊ธฐ
/var/www/html

=> ์œ„ ๊ฒฝ๋กœ๋กœ ์ด๋™

vi index.html

=> ์œ„ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด index.html ํŒŒ์ผ์„ ์ƒ์„ฑ

<html>
<body>

TestPage
Success!!!

</body>
</html>

=> ๊ทธ ์•ˆ์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋‚ด์šฉ์„ ์ž…๋ ฅ (๊ฐ„๋‹จํ•œ ์›น ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” html ์ฝ”๋“œ์ด๋‹ค)

 

 

์œ„์™€ ๊ฐ™์€ ํŽ˜์ด์ง€๊ฐ€ ๋‚˜์˜ค๋ฉด ์„ฑ๊ณต!!!

 

 

 

 

 

๐Ÿ“– Oracle ์—ฐ๋™ ์‹œ๋ฆฌ์ฆˆ ๐Ÿ“–

1. https://ye5ni.tistory.com/154
2. https://ye5ni.tistory.com/164
3. https://ye5ni.tistory.com/165
4. https://ye5ni.tistory.com/174

 

 

 

 

 

 

728x90
๋ฐ˜์‘ํ˜•