1. 공인 IP 신청 (KR-1 로 신청)
2. ACG 생성 및 설정
3. Init Script 에서 script 생성
<http.sh>
#! /bin/bash
mkdir /http
yum install -y wget gcc gcc-c++ expat-devel bzip2
cd /http
wget https://downloads.apache.org/apr/apr-1.7.0.tar.bz2
wget https://downloads.apache.org/apr/apr-util-1.6.1.tar.bz2
wget https://downloads.apache.org/httpd/httpd-2.4.54.tar.bz2
wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2 --no-check-certificate
tar xvfj apr-1.7.0.tar.bz2
tar xvfj apr-util-1.6.1.tar.bz2
tar xvfj pcre-8.45.tar.bz2
tar xvfj httpd-2.4.54.tar.bz2
cd apr-1.7.0
./configure --prefix=/http/apr
make && make install
cd ../apr-util-1.6.1
./configure --prefix=/http/aprutil --with-apr=/http/apr
make && make install
cd ../pcre-8.45
./configure --prefix=/http/pcre
make && make install
cd ../httpd-2.4.54
./configure --prefix=/http/apache2 --with-apr=/http/apr --with-apr-util=/http/aprutil --with-pcre=/http/pcre/bin/pcre-config
make && make install
systemctl stop firewalld
useradd -r -s /sbin/nologin daemon
cat > /http/apache2/htdocs/index.html << EOF
<html>
<body>
<h1> Jihyun's Webserver</h1>
</body>
</html>
EOF
/http/apache2/bin/apachectl start
http.sh 내용을 붙여넣어줍니다.
4. 서버 생성
위 캡쳐에서는 Script 선택을 안했지만 아래 http.sh 스크립트를 선택해줍니다.
5. 포트포워딩 설정 후 xshell 설정
root 비밀번호는 오른쪽 버튼 -> 관리자 비밀번호 확인에서 확인
6. 공인 IP 할당 후 접속해서 "Ji Hyun's Webserver" 가 나오는 걸 확인합니다
'IT > Linux' 카테고리의 다른 글
[Linux] DHCP 실습 (Windows, Linux) (0) | 2022.11.08 |
---|---|
[Linux] Process 관리 (0) | 2022.11.03 |
[Linux] Local Repository 생성 (0) | 2022.11.03 |
[Linux] Script 생성 후 실행하기 (0) | 2022.11.02 |
[Linux] Source로 Apache2 설치하기 (0) | 2022.11.02 |