apache http-vhost.conf 버추얼호스팅 설정 기억하기

# vi /usr/local/apache/conf/extra/httpd-vhost.conf (소스설치시 경로)
#vi /etc/httpd/conf/ (yum설치시 경로)

 

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName   bibaram.com
  ServerAlias  www.bibaram.com
  ServerAlias  bibaram.net www.bibaram.net bibaram.kr www.bibaram.kr
  DocumentRoot /home/bibaram/public_html/

  <Directory /home/bibaram/public_html>
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  php_value    default_charset UTF-8
  php_value    session.save_path /home/bibaram/session/
  php_value    session.cookie_lifetime 0

// ErrorLog 아파치 에러로그 경로 설정 (기본경로: /usr/local/apache/log)
// CustomLog 아파치 Access 로그 설정 (기본경로: /usr/loca/apache/log)
// rotatelogs 이용 일자별(시간대별 가능) 분기
  ErrorLog     "|/usr/local/apache/bin/rotatelogs /home/bibaram/apache_log/error_%Y%m%d.log 86400"
  CustomLog    "|/usr/local/apache/bin/rotatelogs /home/bibaram/apache_log/access_%Y%m%d.log 86400" combined env=!img-nosave

  RewriteEngine On
  RewriteLog   /home/bibaram/apache_log/rewrite_log
  RewriteLogLevel 1
  RewriteRule  ^/join/([a-zA-Z0-9]+)$ /home/bibaram/html/join/index.php?abc=$1 [L]
</VirtualHost>

 

// 일정 기간지난 로그 지우기 예약

#crontab -e
0 0 * * * find /home/bibaram/apache_log/-_log -ctime +1 -exec rm -f {} ;
// -ctime (create time 생성된날짜기준), -mtitme (modify time 수정된날짜기준)
// -exec rm -f {} (강제로 삭제)

 

 

이 정도면 될듯.....

Press ESC to close