메뉴 닫기

우분투 VirtualHost설정후 활성화

패키지 설치한 apache VirtualHost를 설정해보자.

cd /etc/apache2/sites-available/

root@ubuntu:/etc/apache2/sites-available# pwd

/etc/apache2/sites-avilable/

vi domain.com

<VirtualHost *:80>

ServerName domain.com
ServerAlias domain.com

DocumentRoot /home2/domain.com/www   [DocumentRoot경로지정을해준다.]

CustomLog /var/log/apache2/domain.com/access.log combined
ErrorLog /var/log/apache2/domain.com.error.log

</VirtualHost>

:wq로 저장후 빠져나온다.

 

a2ensite 명령어로 해당 도메인 VirtualHost를 활성화시켜 줍니다.

root@ubuntu:/etc/apache2/sites-available# pwd

/etc/apache2/sites-avilable/

root@ubuntu:/etc/apache2/sites-available# a2ensite domain.com                             [/etc/apache2/sites-enabled/에 심볼링크가 생성된다.]

명령어 실행후 apache도 재시작해준다

service apache2 restart 

 [polldaddy rating=”7739789″]  

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x