[apache24] Freebsd httpd-vhost.conf 설정

Freebsd httpd-vhost.conf 설정

참고페이지: https://httpd.apache.org/docs/2.4/ko/sections.html

FreeBSD apache24 vhost 설정으로 wiki.test.com / blog.test.com 을 설정하는 내용입니다.

 

blog.test.com VirtualHost 추가

blog.test.com 으로 사용할 Direcoty 생성 및 Directory 권한설정

root@bsd11:~ # mkdir /www
root@bsd11:~ # chown www:www /www/

 

apache24 설정 변경

root@bsd11:~ # vi /usr/local/etc/apache24/httpd.conf
~중략
# Virtual hosts
Include etc/apache24/extra/httpd-vhosts.conf

LoadModule vhost_alias_module libexec/apache24/mod_vhost_alias.so


root@bsd11:~ # cd /usr/local/etc/apache24/extra/
root@bsd11:/usr/local/etc/apache24/extra # vi httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin admin@test.com
    DocumentRoot "/usr/local/www/dokuwiki"
    ServerName wiki.test.com
    ErrorLog "/var/log/wiki.test.com-error_log"
    CustomLog "/var/log/wiki.test.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin admin@test.com
    DocumentRoot "/www"
    ServerName blog.test.com
    ErrorLog "/var/log/blog.test.com-error_log"
    CustomLog "/var/log/blog.test.com-access_log" common
     <Directory "/www">
        AllowOverride None
        Order Allow,deny
        Allow from all
     </Directory>
</VirtualHost>

 

httpd.conf 나 httpd-vhost.conf 에 사용할 디렉토리 설정을 추가해야 됩니다.

<Directory "/www">
   AllowOverride None
   Order Allow,deny
   Allow from all
</Directory>

 

설정을 마친후 apache24 를 재시작 합니다.

root@bsd11:~ # service apache24 restart
Performing sanity check on apache24 configuration:
Syntax OK
Stopping apache24.
Waiting for PIDS: 1125.
Performing sanity check on apache24 configuration:
Syntax OK
Starting apache24.
root@bsd11:~ #

 

web browser 확인

 

 

댓글 남기기