'Apache Virtual Hosts'에 해당되는 글 1건

반응형

아파치 웹 서버 실행

 

아파치, php 버전 확인

$ apachectl -v

$ php -v

 

아파치, php 설치 (설치되어 있지 않을 경우)

$ brew install httpd

$ brew install php

 

아파치 실행

$ sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

 

아파치 종료

$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

 

기본 웹서버 패스

/Library/WebServer/Documents/index.html

 

브라우저로 확인 

http://127.0.0.1

http://localhost

 

 

 

[ 요약 ]

sudo vi /private/etc/hosts

# mysite

127.0.0.1       ww1.mysite.net

127.0.0.1       ww2.mysite.net

 

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

 

sudo vi /private/etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80>
    ServerName     ww1.mysite.net
    ServerAdmin    netcanis@mysite.net
    DocumentRoot   "/private/etc/apache2/htdocs-ww1"
    CustomLog      "/private/var/log/apache2/ww1.access.log" common
    ErrorLog       "/private/var/log/apache2/ww1.error.log"
    <Directory "/private/etc/apache2/htdocs-ww1">
        Options Indexes MultiViews
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>



<VirtualHost *:80>
    ServerName     ww2.mysite.net
    ServerAdmin    netcanis@mysite.net
    DocumentRoot   "/private/etc/apache2/htdocs-ww2"
    CustomLog      "/private/var/log/apache2/ww2.access.log" common
    ErrorLog       "/private/var/log/apache2/ww2.error.log"
    <Directory "/private/etc/apache2/htdocs-ww2">
        Options Indexes MultiViews
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>

 

 

테스트

sudo apachectl configtest

 

재시작

sudo apachectl graceful

 

브라우저 테스트

http://ww1.mysite.net

http://ww2.mysite.net

 

 

 

웹서버 패스

/private/etc/apache2/htdocs-ww1/index.html 

/private/etc/apache2/htdocs-ww2/index.html 

 

로그파일 패스

/private/var/log/apache2/ww1.access.log

/private/var/log/apache2/ww1.error.log

/private/var/log/apache2/ww2.access.log

/private/var/log/apache2/ww2.error.log

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

반응형

'개발 > Note' 카테고리의 다른 글

Packet Format for the LE Uncoded PHYs  (0) 2024.01.09
Push Notification  (1) 2023.12.27
Unwind Segue 사용방법  (0) 2023.01.11
랜덤 seed 초기화  (0) 2022.11.18
matplotlib 사용  (0) 2022.11.18
블로그 이미지

SKY STORY

,