Mac에서 Apache 설치하기

zihooy·2023년 5월 19일
1

Web Development

목록 보기
2/8
post-thumbnail

Mac에서 Apache를 설치하는 방법에 대해 알아보자.

🏹 Apache 설치 확인

Mac에는 기본적으로 Apache가 설치되어 있다고 한다.

설치 확인

sudo apachectl -v

실행 결과

Server version: Apache/2.4.54 (Unix)
Server built:   Dec 16 2022 22:01:38

🏹 Apache 실행하기

아파치 config 파일 변경

sudo vi /private/etc/apache2/httpd.conf

231번째 줄을 ServerName localhost로 수정한다.

아파치 서버 실행

sudo apachectl start

Apache 서버 실행 결과

인터넷에서 localhost에 접속하면 실행 결과를 확인 할 수 있다.

Html 파일 확인 후 내용 수정

cd /Library/WebServer/Documents
sudo vi index.html.en
<!DOCTYPE html>

<html>
        <head>
                <meta charset="utf-8">
        </head>
        <body>
                <h1>안녕하세요</h1>
        </body>
</html>


상대방의 ip 주소를 입력하면 다른 사람의 서버에도 접속할 수 있다.

Apache 서버 종료

 sudo apachectl stop

profile
thisIsZihooLog

0개의 댓글