HTML 4.01 CSS Firefox Download TTF


********************************************************************************
Gentoo Linux 기반의 xx 서버 설치 및 셋팅
********************************************************************************

  1. 2005.07.24 Gentoo 2005.0 LiveCD로 부팅
  2. 2005.07.24 젠투를 Stage3에서부터 설치
  3. 2005.07.25 Xorg - 새로운 X윈도우
  4. 2005.07.25 qingy - 프레임버퍼를 사용한 가벼운 로그인 매니저
  5. 2005.07.25 네트워크 도구 설치
  6. 2005.07.25 vsftp - 보안에 뛰어난 FTP 서버
  7. 2005.07.25 APM - Apache2, PHP4, MySQL을 사용한 웹서버
  8. 2005.07.25 subversion - 모듈 단위의 버전관리 시스템
  9. 2005.07.26 qmail - 새로운 메일서버
  10. 2005.07.26 전체 업데이트
  11. 2005.07.27 플래그 수정 후 전체 업데이트
  12. 2005.07.28 트래픽 감시 도구 설치
  13. 2005.08.05 trac - subversion과 연동되는 프로젝트 관리 도구
  14. 2005.08.05 아파치 설정을 수정


================================================================================
Gentoo 2005.0 LiveCD로 부팅
--------------------------------------------------------------------------------
  1. Gentoo 2005.0 LiveCD를 준비
  2. LiveCD로 시스템 부팅
  3. 시스템 사양 파악
    CPU: Dual Intel Xeon 2.4GHz (533Hz) * 2
    LAN1: 내장형 Intel PRO/100+ Server Network Connection (82550PM controller)
    LAN2: 내장형 Intel PRO/1000 XT Network Connection (82544GC controller)
    VGA: ATI Rage XL SVGA PCI video controller
    HDD: SCSI
    SCSI: 내장형 Adaptec AIC-7899W Dual Channel (Ultra160/LVD channels)
  4. 네트워크 설정
    # ifconfig
    eth0의 IP 할당 여부를 확인
    # net-setup eth0
    static ip로 다음의 내용을 설정
    ip : 000.000.29.221
    bcast : 000.000.29.255
    mask : 255.255.252.0
    gw : 000.000.29.5
    dns : 000.000.10.2
  5. 원격으로 설치하기 위한 ssh 터미널 실행
    # /etc/init.d/sshd start
  6. root 암호 설정
    # passwd
  7. 원격에서 ssh 터미널을 통해 접속
  8. 터미널이 종료되어도 작업이 유지되도록 screen을 실행
    # screen -S setup
    Ctrl+A D 를 누르면 스크린을 떼어냄
    screen -r setup 을 수행하면 스크린을 다시 붙임
    screen -list 를 수행하면 스크린 목록이 보임

================================================================================
젠투를 Stage3에서부터 설치
--------------------------------------------------------------------------------
  1. 설치 파티션 준비
    # fdisk /dev/sda
    sda1 : ext2 /boot 128M
    sda2 : swap 2048M
    sda3 : xfs / 10240M
    sda4 : xfs /home
    # mke2fs /dev/sda1
    # mkswap /dev/sda2
    # mkfs.xfs /dev/sda3
    # mkfs.xfs /dev/sda4
    # swapon /dev/sda2
    # mount /dev/sda3 /mnt/gentoo
    # mkdir /mnt/gentoo/boot
    # mount /dev/sda1 /mnt/gentoo/boot
    # mkdir /mnt/gentoo/home
    # mount /dev/sda4 /mnt/gentoo/home
  2. Stage3 압축 해제
    # cd /mnt/gentoo
    # ls /mnt/cdrom/stages
    펜티엄4 스테이지를 선택
    # tar -xvjpf /mnt/cdrom/stages/stage3-pentium4-2005.0.tar.bz2
  3. 최적화 옵션 및 미러 선택
    # mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
    # mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
    # nano -w /mnt/gentoo/etc/make.conf
    CFLAGS의 최적화 수준을 -O3로 올리고 다음의 내용을 적절하게 판단하여 수정
    http://gentoo-wiki.com/Safe_Cflags를 참고하여 작성
    CHOST="i686-pc-linux-gnu"
    CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
    CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
    GENTOO_MIRRORS="http://ftp.gentoo.or.kr/ ftp://ftp.jaist.ac.jp/pub/os/Linux/Gentoo/ http://mirror.gentoo.gr.jp ftp://ftp.ankara.edu.tr/gentoo/ http://gentoo.osuosl.org/"
    SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"
    ACCEPT_KEYWORDS="~x86"
    
  4. root 전환
    # cp -L /etc/resolv.conf /mnt/gentoo/etc
    # mount -t proc none /mnt/gentoo/proc
    # chroot /mnt/gentoo /bin/bash
    # env-update
    # source /etc/profile
  5. GMT로 로컬시간 설정
    # ls /usr/share/zoneinfo
    # ln -sf /usr/share/zoneinfo/GMT /etc/localtime
    # date MMDDhhmmYYYY
    MM은 두자리 월, DD는 두자리 일, hh는 24형식의 시간, mm은 분, YYYY는 년
  6. 포티지 설치
    # emerge --sync
    천천히 커피를 마시며 지켜보기
  7. 기본 환경 설정
    # nano -w /etc/rc.conf
    다음 라인을 찾아서 수정 및 주석 해제
    SET_WINDOWKEYS="yes"
    CLOCK="UTC"
    PROTOCOLS="1 2"
    
  8. 언어 설정
    # nano -w /etc/locales.build
    다음을 추가
    ko_KR.EUC-KR/EUC-KR
    ko_KR.UTF-8/UTF-8
    
  9. 마운트 정보 설정
    # nano -w /etc/fstab
    디스크 설정에 맞도록 수정
    /dev/sda1		/boot		ext2		noauto,noatime		1 1
    /dev/sda3		/		xfs		noatime			0 0
    /dev/sda4		/home		xfs		noatime			0 0
    /dev/sda2		none		swap		sw			0 0
    /dev/cdroms/cdrom0	/mnt/cdrom	auto		noauto,ro		0 0
    
    # cp /proc/mounts /etc/mtab
    # nano -w /etc/udev/rules.d/99-user.rules
    다음 내용을 적절한 위치에 추가
    # devfs-names for scsi-devices
    BUS="scsi", KERNEL="sd*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sd %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
    # BUS="scsi", KERNEL="sr*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sr %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
    # BUS="scsi", KERNEL="st*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh st %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
    # BUS="scsi", KERNEL="sg*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sg %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
    
  10. 커널 컴파일
    # emerge gentoo-sources genkernel grub
    하나씩 emerge해도 됨
    화면을 지긋이 응시하며 기다리기
    # ls -al /usr/src/linux
    제대로 연결되어 있는지 확인
    # cd /usr/src/linux
    # genkernel --menuconfig all
    컴파일 옵션을 확인하며 커널 설정
    CPU는 펜티엄 Xeon으로 다중 CPU관련 옵션 켜기
    FAT의 CodePage는 949로 변경
    CharSet을 UTF8로 바꾸고 euc-kr과 utf-8을 추가
    # modules-update
  11. 부트 스플래시 설치
    # emerge splashutils
    커널이 한번이라도 컴파일되어 있어야 emerge 가능
    화면을 지긋이 응시하며 기다리기
    # cd /etc/splash
    # mkdir xxxxxlab
    # wget http://xxnt.xxx.ac.kr/pub/xxxxxlab.tar
    부트 스플래시 스크린을 다운로드
    # cd xxxxxlab
    # tar xvf ../xxxxxlab.tar
    # rm ../xxxxxlab.tar
    # cd /usr/src/linux
    # genkernel --menuconfig --no-clean --gensplash=xxxxxlab all
    # modules-update
  12. 부트로더(grub) 설치
    # nano -w /boot/grub/grub.conf
    다음의 내용을 새로 작성
    default 2
    timeout 10
    fallback 1
    splashimage=(hd0,0)/boot/grub/splash.xpm.gz
    
    title 0. Gentoo (kernel 2.6.11-r6)
    	root (hd0,0)
    	kernel /boot/kernel-2.6.11-gentoo-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/sda3 udev doscsi
    	initrd /boot/initrd-2.6.11-gentoo-r6
    
    title 1. Gentoo (kernel 2.6.11-r6) with Splash 800x600
    	root (hd0,0)
    	kernel /boot/kernel-2.6.11-gentoo-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/sda3 splash=silent,theme:xxxxxlab video=vesafb:ywrap,mtrr,800x600-32@60 udev doscsi
    	initrd /boot/initrd-2.6.11-gentoo-r6
    
    title 2. Gentoo (kernel 2.6.11-r6) with Splash 1024x768
    	root (hd0,0)
    	kernel /boot/kernel-2.6.11-gentoo-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/sda3 splash=silent,theme:xxxxxlab video=vesafb:ywrap,mtrr,1024x768-32@60 udev doscsi
    	initrd /boot/initrd-2.6.11-gentoo-r6
    
    title 3. Gentoo (kernel 2.6.11-r6) with Splash 1280x1024
    	root (hd0,0)
    	kernel /boot/kernel-2.6.11-gentoo-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/sda3 splash=silent,theme:xxxxxlab video=vesafb:ywrap,mtrr,1280x1024-32@60 udev doscsi
    	initrd /boot/initrd-2.6.11-gentoo-r6
    
    # grub-install --root-directory=/boot /dev/sda
  13. 시스템 툴 설치
    # emerge coldplug openssh metalog vixie-cron
    # groupmod -n locate slocate
    # emerge slocate dhcpcd xfsprogs screen
    낮잠이라도 자두기
    # etc-update
    # rc-update add coldplug boot
    # rc-update add sshd default
    # rc-update add metalog default
    # rc-update add vixie-cron default
    # emerge -pv gpm
    콘솔 마우스를 위한 gpm이 설치되어 있는지 확인, 없으면 emerge
    # emerge -u gpm
    # etc-update
    # rc-update add gpm default
    # nano -w /etc/conf.d/gpm
    다음의 내용을 적절히 주석 해제
    MOUSE=imps2
    MOUSEDEV=/dev/psaux
    
  14. 네트워크 설정
    # echo xx > /etc/hostname
    # echo xxx.ac.kr > /etc/dnsdomainname
    # nano -w /etc/resolv.conf
    다음의 내용을 추가
    domain xxx.ac.kr
    search xxx.ac.kr
    
    # nano -w /etc/hosts
    다음의 내용을 수정
    127.0.0.1		xx.xxx.ac.kr	xx	localhost
    
    # rc-update add domainname default
    # nano -w /etc/conf.d/net
    다음의 내용을 적절히 수정
    iface_eth0="000.000.29.221 broadcast 000.000.29.255 netmask 255.255.252.0"
    gateway="eth0/000.000.28.5"
    
    # rc-update add net.eth0 default
  15. 지역 언어 설정
    # nano -w /etc/env.d/02useretc
    LANG="ko_KR.UTF-8"
    SUPPORTED="ko_KR.utf8:ko_KR.UTF-8:ko_KR.eucKR:ko_KR.ko"
    
    # localedef -i ko_KR -c -f UTF-8 ko_KR.UTF-8
    # env-update
  16. 설치 마무리후 시스템 재시작
    # passwd
    root 암호 설정
    # etc-update
    # exit
    # cd
    # umount /mnt/gentoo/home /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo
    # reboot
  17. 커널에 이상이 있을 경우 LiveCD로 재부팅 후 다시 컴파일
    # swapon /dev/sda2
    # mount /dev/sda3 /mnt/gentoo
    # mount /dev/sda1 /mnt/gentoo/boot
    # mount /dev/sda4 /mnt/gentoo/home
    # mount -t proc none /mnt/gentoo/proc
    # chroot /mnt/gentoo /bin/bash
    # genkernel --menuconfig --gensplash=xxxxxlab --no-clean all
    커널 재컴파일이나 추가 작업들을 수행 후 재부팅
    정상적인 부팅 후 커널을 수정할 경우에는 mount /boot 를 먼저 수행한 후 작업
    # modules-update
    # nano -w /boot/grub/grub.conf
    # grub-install --root-directory=/boot /dev/sda
    # exit
    # umount /mnt/gentoo/home /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo
    # reboot

================================================================================
Xorg - 새로운 X윈도우
--------------------------------------------------------------------------------
  1. USE flag 편집기 설치
    # emerge ncurses ufed
    # ufed
  2. Xorg 설치
    # nano -w /etc/make.conf
    USE flag에 다음을 추가
    mmx sse directfb xorg cjk doc unicode tiff jpeg2k xscreensaver rdesktop
    # emerge -pv xorg-x11 | more
    설치될 패키지를 간단히 확인
    # emerge xorg-x11
    재미있는 책이라도 읽기
    # env-update && source /etc/profile
    # xorgconfig
    시스템 내용에 맞도록 설정
    IMPS/2, n, /dev/psaux, 104-key PC, [Enter], [Enter], Korean, [Enter], y,
    [Enter], [Enter], [Enter], ..., Monitor, ..., y, [Enter], ..., Matrox G400,
    8, [Enter], 4, 5, y
    # nano -w /etc/X11/xorg.conf
    내용을 살펴보고 수정
    # startx
    제대로 동작하는지 확인
  3. KDE 설치
    # nano -w /etc/make.conf
    USE flag에 다음을 추가
    kde
    # emerge -pv kde | more
    설치될 패키지를 간단히 확인
    # emerge kde
    편안한 마음으로 하루를 보내기
    # env-update && source /etc/profile
    # ls /etc/X11/Sessions
    사용 가능한 세션 확인
    # nano -w /etc/rc.conf
    다음의 내용을 적절히 수정
    XSESSION="kde-3.4"
    
    # startx
    KDE 최초 설정 수행 및 테스트
  4. KDE 한글화
    # emerge -pv rpm2targz
    rpm2targz가 설치되어 있지 않다면 emerge로 설치
    # wget ftp://ftp.hancom.com/pub/HancomLinux/linux/i386/4.0/ftp/os/Hancom/RPMS/kde-i18n-Korean-3.2.3-041010.1hl.noarch.rpm
    KDE 한글화 RPM 패키지 다운로드
    # rpm2targz kde-i18n*.rpm
    # mv kde-i18n*.tar.gz /
    # cd /
    # tar -xzvf kde-i18n*.tar.gz
    # rm kde-i18n*.tar.gz
    # startx
    이후 KDE 제어판에서 지역관련 설정을 한국으로...
  5. Gnome 설치
    # nano -w /etc/make.conf
    USE flag에 다음을 추가
    gtk2 gnome firefox java
    # emerge -pv gnome | more
    설치될 패키지를 간단히 확인
    # emerge gnome
    편안한 마음으로 하루를 보내기
    # env-update && source /etc/profile
    # ls /etc/X11/Sessions
    사용 가능한 세션 확인
    # nano -w /etc/rc.conf
    다음의 내용을 적절히 수정
    XSESSION="Gnome"
    
    # startx
    Gnome 최초 설정 수행 및 테스트
  6. 글꼴 설치
    # emerge freetype corefonts freefonts artwiz-fonts sharefonts terminus-font ttf-bitstream-vera unifont
    글꼴 관련 패키지 설치

================================================================================
qingy - 프레임버퍼를 사용한 가벼운 로그인 매니저
--------------------------------------------------------------------------------
  1. DirectFB 설치
    # nano -w /etc/make.conf
    USE flag에 다음을 추가
    fbcon
    # emerge DirectFB
    # dfbinfo
    장치 정보 확인
  2. qingy 설치
    # emerge -pv qingy
    설치되는 패키지 내용을 확인
    xorg & kde가 미리 설치되어 있어야 설치가 수월함
    # emerge qingy
    간단한 간식을 먹으면서 기다리기
    # ls /usr/share/doc/qingy-0.5.3
    # info qingy
    설치에 관련된 문서 살펴보기
  3. 부트 로그인 관리자를 qingy로 설정
    # nano -w /etc/inittab
    다음 코드를 찾아서
    c1:12345:respawn:/sbin/agetty 38400 tty1 linux
    c2:12345:respawn:/sbin/agetty 38400 tty2 linux
    c3:12345:respawn:/sbin/agetty 38400 tty3 linux
    c4:12345:respawn:/sbin/agetty 38400 tty4 linux
    
    아래와 같이 변경
    c1:12345:respawn:/sbin/qingy tty1 -s 1
    c2:12345:respawn:/sbin/qingy tty2 -s 1 -v
    c3:12345:respawn:/sbin/qingy-DirectFB tty3 -s 1
    c4:12345:respawn:/sbin/qingy-DirectFB tty4 -s 1 -v
    
  4. 테마 적용
    # cd /usr/share/qingy/themes
    # wget http://xxnt.xxx.ac.kr/pub/xxxxxlab-qingy.tar
    # tar xvf xxxxxlab-qingy.tar
    # nano -w /etc/qingy/settings
    다음의 내용을 적절히 수정
    theme = "xxxxxlab"
    

================================================================================
네트워크 도구 설치
--------------------------------------------------------------------------------
  1. 포트상태 감시 nmap 설치
    # emerge nmap
    # nmap -sS localhost
    모든 포트 상태를 나열
  2. 포트상태 감시 netcat 설치
    # emerge netcat
    # nc -zv localhost 22
    22번 포트를 검사
  3. DNS관련 툴 설치
    # emerge bind-tools
    # nslookup xx.xxx.ac.kr
    xx.xxx.ac.kr 도메인 이름을 검사
  4. 텔넷 설치
    # emerge netkit-telnetd
    # telnet xx.xxx.ac.kr
    xx.xxx.ac.kr로 텔넷 연결

================================================================================
vsftp - 보안에 뛰어난 FTP 서버
--------------------------------------------------------------------------------
  1. vsftp 설치
    # emerge vsftpd
    잠깐 한눈 팔기
    # rc-update add vsftpd default
  2. vsftp 설정
    # cp /etc/vsftpd/vsftpd.conf.example /etc/vsftpd/vsftpd.conf
    # nano -w /etc/vsftpd/vsftpd.conf
    다음 설정을 수정 및 추가
    # StandAlone으로 실행 가능
    background=YES
    listen=YES
    # 익명 로그인 불가
    anonymous_enable=NO
    # 로컬 사용자 로그인 가능
    local_enable=YES
    # 쓰기 가능
    write_enable=YES
    # 파일의 기본권한은 755
    local_umask=022
    # ASCII 모드 지원
    ascii_upload_enable=YES
    ascii_download_enable=YES
    # 배너 내용
    ftpd_banner=Welcome to VR Lab FTP service.
    
    # useradd -g root -d /home/admins/ftproot -m -c 'FTP Administrator' ftproot
    # passwd ftproot
    # /etc/init.d/vsftpd start
  3. 접속하여 테스트
    root로는 로그인이 안되므로 로컬 사용자를 추가하여 테스트

================================================================================
APM - Apache2, PHP4, MySQL을 사용한 웹서버
--------------------------------------------------------------------------------
  1. APM 설치
    # nano -w /etc/make.conf
    USE flag에 다음을 추가
    apache2 gd freetype truetype png jpeg mysql berkdb innodb pam ssl xml xml2 maildir imap nls
    # emerge gd mysql apache
    # USE="-doc browserplugin" emerge blackdown-jdk
    # USE="dba" emerge php mod_php
    패키지 설치 에러가 날 경우 메세지를 잘 살펴서 순서대로 설치
    # /usr/bin/mysql_install_db
    # /etc/init.d/mysql start
    # /usr/bin/mysqladmin -u root password '암호'
    mysql의 root 암호 입력
    # chown -R apache:apache /var/www
    # rc-update add apache2 default
    # rc-update add mysql default
  2. 아파치 설정
    # nano -w /etc/conf.d/apache2
    APACHE2_OPTS항목에 SSL을 사용하고 싶으면 "-D SSL"을..
    ~id로 적용되는 유저 디렉토리를 사용하려면 "-D USERDIR"을..
    PHP를 사용하고 싶으면 "-D PHP4"를 추가
    APACHE2_OPTS="-D SSL -D PHP4 -D USERDIR"
    
    # nano -w /etc/apache2/httpd.conf
    언어설정을 변경
    ServerAdmin wwwroot@xx.xxx.ac.kr
    LanguagePriority ko en
    AddDefaultCharset UTF-8
    ServerName xx.xxx.ac.kr
    
  3. SSL을 위한 인증서 생성
    # cd /etc/apache2/ssl/
    # rm server.*
    # gentestcrt.sh
    다음과 같이 입력
    
    Step. 2 발행 기관 정보
    
    1. Country Name             (2 letter code) []:KO
    2. State or Province Name   (full name)     []:
    3. Locality Name            (eg, city)      []:Daegu
    4. Organization Name        (eg, company)   [Apache HTTP Server]:Kyungpook National University VR Lab
    5. Organizational Unit Name (eg, section)   [For testing purposes only]:VR Web Admin
    6. Common Name              (eg, CA name)   [localhost]:xx.xxx.ac.kr
    7. Email Address            (eg, name@FQDN) []:xxroot@xx.xxx.ac.kr
    
    Step. 6 발행 대상 정보
    
    1. Country Name             (2 letter code) []:KO
    2. State or Province Name   (full name)     []:
    3. Locality Name            (eg, city)      []:Daegu
    4. Organization Name        (eg, company)   [Apache HTTP Server]:VR Lab
    5. Organizational Unit Name (eg, section)   [Test Certificate]:VR Web Admin
    6. Common Name              (eg, DOMAIN NAME)   [localhost]:xx.xxx.ac.kr
    7. Email Address            (eg, name@fqdn) []:xxroot@xx.xxx.ac.kr
    
  4. 가상서버 설정
    # mkdir /home/admins
    # useradd -g root -G apache -d /home/admins/wwwroot -m -c 'Web Administrator' wwwroot
    # passwd wwwroot
    # mkdir /home/users
    # useradd -g users -d /home/users/xxlab -m -c 'VR Lab Guest' xxlab
    # passwd xxlab
    웹 관리자인 wwwroot:apache 계정이 /home/admins/wwwroot에..
    사용자 계정 홈들은 /home/users안에 만들어져 있다고 가정
    # nano -w /etc/apache2/httpd.conf
    "ServerAdmin"을 수정하고 사용자 지역 폴더를 "/home/*/..."에서 "/home/users/*/..."로 수정
    "AddHandler cgi-script .cgi"를 주석 해제
    # mv /etc/apache2/vhosts.d/00_default_vhost.conf /etc/apache2/vhosts.d/00_default_vhost.conf.bak
    # mv /etc/apache2/modules.d/41_mod_ssl.default-vhost.conf /etc/apache2/modules.d/41_mod_ssl.default-vhost.conf.bak
    기본 설정된 가상호스트들을 제거
    # mkdir /home/admins/wwwroot/xx
    새로운 가상호스트용 디렉토리들 생성
    # mkdir /home/admins/wwwroot/xx/http
    # mkdir /home/admins/wwwroot/xx/http/logs
    # mkdir /home/admins/wwwroot/xx/http/files
    # mkdir /home/admins/wwwroot/xx/http/cgi-bin
    # mkdir /home/admins/wwwroot/xx/http/imgs
    # mkdir /home/admins/wwwroot/xx/http/css

    # mkdir /home/admins/wwwroot/xx/https
    # mkdir /home/admins/wwwroot/xx/https/logs
    # mkdir /home/admins/wwwroot/xx/https/files
    # mkdir /home/admins/wwwroot/xx/https/cgi-bin
    # mkdir /home/admins/wwwroot/xx/https/imgs
    # mkdir /home/admins/wwwroot/xx/https/css

    # chown -R wwwroot:apache /home/admins/wwwroot

    # ln -s /home/admins/wwwroot/xx/http /var/www/xx
    # chown apache:apache /var/www/xx
    # ln -s /home/admins/wwwroot/xx/https /var/www/xx_ssl
    # chown apache:apache /var/www/xx_ssl
    # nano -w /etc/apache2/vhosts.d/xx.conf
    http://xx.xxx.ac.kr에 대한 가상 서버 설정
    NameVirtualHost *:80
    
    <Directory /var/www/xx>
    	Options -Indexes Includes -ExecCGI FollowSymLinks
    	AllowOverride All
    	<IfModule mod_access.c>
    		Order Deny,Allow
    		Allow from all
    	</IfModule>
    </Directory>
    
    <Directory /var/www/xx/files>
    	Options Indexes Includes -ExecCGI FollowSymLinks
    	AllowOverride All
    	<IfModule mod_access.c>
    		Order Deny,Allow
    		Allow from all
    	</IfModule>
    </Directory>
    
    <Directory /var/www/xx/cgi-bin>
    	Options -Indexes Includes ExecCGI FollowSymLinks
    	SetHandler cgi-script
    	AllowOverride All
    	<IfModule mod_access.c>
    		Order Deny,Allow
    		Allow from all
    	</IfModule>
    </Directory>
    
    <VirtualHost *:80>
    	DocumentRoot /var/www/xx
    	ServerName xxlab.xxx.ac.kr:80
    	ServerAdmin wwwroot@xx.xxx.ac.kr
    	Setenv VLOG  /var/www/xx/logs
    	ErrorLog     /var/www/xx/logs/error_log
    </VirtualHost>
    
    <IfDefine SSL>
      <IfModule !mod_ssl.c>
        LoadModule ssl_module    modules/mod_ssl.so
      </IfModule>
    </IfDefine>
    
    # nano -w /etc/apache2/vhosts.d/xx_ssl.conf
    https://xx.xxx.ac.kr에 대한 가상 서버 설정
    <IfModule mod_ssl.c>
    	NameVirtualHost *:443
    
    	<Directory /var/www/xx_ssl>
    		Options -Indexes Includes -ExecCGI FollowSymLinks
    		AllowOverride None
    		<IfModule mod_access.c>
    			Order Deny,Allow
    			Allow from all
    		</IfModule>
    	</Directory>
    
    	<Directory /var/www/xx_ssl/files>
    		Options Indexes Includes -ExecCGI FollowSymLinks
    		AllowOverride All
    		<IfModule mod_access.c>
    			Order Deny,Allow
    			Allow from all
    		</IfModule>
    	</Directory>
    
    	<Directory /var/www/xx_ssl/cgi-bin>
    		Options -Indexes Includes ExecCGI FollowSymLinks
    		SetHandler cgi-script
    		AllowOverride All
    		<IfModule mod_access.c>
    			Order Deny,Allow
    			Allow from all
    		</IfModule>
    	</Directory>
    
    	<VirtualHost *:443>
    		DocumentRoot "/var/www/xx_ssl"
    		ServerName xx.xxx.ac.kr:443
    		ServerAdmin wwwroot@xx.xxx.ac.kr
    		ErrorLog /var/www/xx_ssl/logs/ssl_error_log
    		<IfModule mod_log_config.c>
    			TransferLog /var/www/xx_ssl/logs/ssl_access_log
    		</IfModule>
    
    		SSLEngine on
    		SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    		SSLCertificateFile conf/ssl/server.crt
    		SSLCertificateKeyFile conf/ssl/server.key
    		#SSLCertificateChainFile conf/ssl/ca.crt
    		#SSLCACertificatePath conf/ssl/ssl.crt
    		#SSLCACertificateFile conf/ssl/ca-bundle.crt
    		#SSLCARevocationPath conf/ssl/ssl.crl
    		#SSLCARevocationFile conf/ssl/ca-bundle.crl
    		#SSLVerifyClient require
    		#SSLVerifyDepth  10
    
    		#<Location />
    			#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
    			#            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
    			#            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
    			#            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
    			#            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
    			#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
    		#</Location>
    
    		#SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire
    
    		<Files ~ "\.(cgi|shtml|phtml|php?)$">
    			SSLOptions +StdEnvVars
    		</Files>
    
    		<Directory "/var/www/xxlab_ssl/htdocs/cgi-bin">
    			SSLOptions +StdEnvVars
    		</Directory>
    
    		<IfModule mod_setenvif.c>
    			SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
    			downgrade-1.0 force-response-1.0
    		</IfModule>
    
    		<IfModule mod_log_config.c>
    			CustomLog /var/www/xx_ssl/logs/ssl_request_log \
    					  "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    		</IfModule>
    
    		<IfModule mod_rewrite.c>
    			RewriteEngine On
    			RewriteOptions inherit
    		</IfModule>
    	</VirtualHost>                                  
    </IfModule>
    
  5. 웹서버 설정 테스트
    # cd
    # apache2ctl -S
    # /etc/init.d/apache2 start
    # nano -w /var/www/xx/test.php
    PHP 테스트 파일 제작
    <?php
    	phpinfo();
    ?>
    
    # links2 http://localhost/test.php
    텍스트 브라우져로 PHP 테스트가 잘나오는지 검사 (종료는 'q'키)
    links2가 없다면 emerge links를 해서 설치
    # cp /var/www/xx/test.php /var/www/xx_ssl/
    # links2 https://localhost/test.php

================================================================================
subversion - 모듈 단위의 버전관리 시스템
--------------------------------------------------------------------------------
  1. subversion 설치
    # USE="-berkdb" emerge subversion
    # nano -w /etc/make.conf
    USE flag에 다음을 추가
    cvsgraph enscript vhosts
    # emerge enscript viewcvs cvsgraph
    SVN과 ViewCVS를 설치
    웹서버가 설치되어 있어야 함
    # useradd -g root -G svnusers -d /home/admins/srcroot -m -c 'Source Control Administrator' srcroot
    # passwd srcroot
    # groupadd svnusers
    # usermod -G apache,svnusers apache
    SVN 사용자용 그룹 생성
    # usermod -G svnusers xxlab
    그룹원으로 추가
  2. 저장소 생성 및 설정
    # svnadmin create /home/admins/srcroot/xx
    메인 저장소 생성
    # svnadmin create /home/admins/srcroot/trash
    실험용 저장소 생성
    # chown apache:apache -R /home/admins/srcroot
    # chgrp svnusers -R /home/admins/srcroot
    # chmod g+w -R /home/admins/srcroot
    저장소의 소유권과 권한 조정
    # nano -w /etc/conf.d/svnserve
    다음의 내용을 적절하게 수정
    SVNSERVE_OPTS="--root=/home/admins/srcroot"
    SVNSERVE_USER="apache"
    SVNSERVE_GROUP="svnusers"
    
    # /etc/init.d/svnserve start
    # rc-update add svnserve default
  3. ViewCVS 설정
    # webapp-config -I -h xx_ssl -d viewcvs viewcvs 1.0_pre20050523
    # nano -w /var/www/xx_ssl/viewcvs/viewcvs.conf
    svn_roots, root_parents, default_root를 설정
    main_title을 적당하게 수정
    languages에 ko-kr을 추가
    use_enscript를 1로 수정
    allow_tar를 1로 수정
    svn_roots = xx: /home/admins/srcroot/xx,trash: /home/admins/srcroot/trash
    root_parents = /home/admins/srcroot : svn
    default_root = xx
    address = <a href="mailto:srcroot@xx.xxx.ac.kr">Mail to Source Control Administrator</a>
    main_title = VR Lab Repository
    languages = ko-kr, en-us
    use_enscript = 1
    use_php = 1
    allow_tar = 1
    use_cvsgraph = 1
    
    # nano -w /var/www/xx_ssl/viewcvs/cvsgraph.conf
    cvsgraph의 환경 설정
    # nano -w /etc/apache2/vhosts.d/xx_ssl.conf
    다음의 내용들을 적절한 위치에 추가
    <IfModule mod_ssl.c>
    	<VirtualHost *:443>
    
    	ScriptAlias /viewsrc /var/www/xx_ssl/cgi-bin/viewcvs/viewcvs.cgi
    	ScriptAlias /srcquery /var/www/xx_ssl/cgi-bin/viewcvs/cvsquery.cgi
    ...
    	</VirtualHost>                                  
    </IfModule>
    
  4. 검색 로봇의 수집활동을 금지
    # nano -w /var/www/xx_ssl/robots.txt
    User-agent: *
    Disallow: /
    
    # nano -w /var/www/xx_ssl/index.html
    head태그 블록 안에 다음 meta태그를 삽입
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    
    # nano -w /var/www/xx_ssl/viewcvs/templates/include/header.ezt
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    
    # cp /var/www/xx_ssl/robots.txt /var/www/xx_ssl/cgi-bin/viewcvs
  5. SVN그룹 사용자 외에 웹에서의 접근 제한
    # mkdir /var/www/xx_ssl/access_info
    # nano -w /var/www/xx_ssl/access_info/accgrp
    허가할 사용자 목록을 추가
    users: wwwroot srcroot xxlab
    
    # htpasswd2 -c /var/www/xx_ssl/access_info/accpasswd wwwroot
    첫 암호를 생성
    # htpasswd2 /var/www/xx_ssl/access_info/accpasswd srcroot
    암호를 추가로 입력
    # htpasswd2 /var/www/xx_ssl/access_info/accpasswd xxlab
    암호를 추가로 입력
    # nano -w /etc/apache2/vhosts.d/xx_ssl.conf
    디렉토리 접근 권한 설정을 위해 다음을 적절히 추가
    ...
    	<Location />
    		AuthType Basic
    		AuthName "[ xxx VR Lab ] Members Only"
    		AuthUserFile /var/www/xx_ssl/access_info/accpasswd
    		AuthGroupFile /var/www/xx_ssl/access_info/accgrp
    		Require group users
    	</Location>
    
    	<Location /access_info>
    		<IfModule mod_access.c>
    			Order Allow,Deny
    			Deny from all
    		</IfModule>
    	</Location>
    ...
    
    # /etc/init.d/apache2 restart

================================================================================
qmail - 새로운 메일서버
--------------------------------------------------------------------------------
  1. 기존의 충돌 패키지 제거
    # emerge -pv ssmtp sendmail postfix
    제거할 내용을 확인
    # emerge -C ssmtp sendmail postfix
    패키지 제거
  2. qmail 설치
    # nano -w /etc/make.conf
    USE flag에 다음을 추가
    apache2 maildir valias vhosts authdaemond mysql qmail
    # emerge qmail
    설치 후 지시에 따라 설정을 수행
    # nano -w /var/qmail/control/servercert.cnf
    C=KO
    ST=KB
    L=Daegu
    O=Kyungpook National University VR Lab
    CN=xx.xxx.ac.kr
    emailAddress=mailroot@xx.xxx.ac.kr
    
    # useradd -g root -G qmail -d /home/admins/mailroot -m -c 'Mail Administrator' mailroot
    # passwd mailroot
    # ebuild /var/db/pkg/mail-mta/qmail-1.03-r16/qmail-1.03-r16.ebuild config
    qmail은 root에게 메일을 보내지 않으므로 다른 계정이 필요
    # cd /var/qmail/alias
    # echo mailroot > .qmail-root
    # echo mailroot > .qmail-postmaster
    # echo mailroot > .qmail-mailer-daemon
    # echo mailroot > .qmail-wwwroot
    # echo mailroot > .qmail-srcroot
    # echo mailroot > .qmail-ftproot
    root로 보내는 메일을 mailroot가 받을 경우
    # rc-update add svscan default
    # /etc/init.d/svscan start
    데몬 서비스 관리자 실행
    (이미 실행되어 있다면 위 과정 생략)
    # ln -s /var/qmail/supervise/qmail-send /service/qmail-send
    # sleep 5 && svstat /service/qmail-send
    서비스가 실행중인지 확인
    # svc -t /service/qmail-send
    설정이 바뀌었을 경우 서비스 갱신
  3. 간단한 메일 테스트
    # emerge -pv mutt
    텍스트 베이스 메일 클라이언트
    설치되어 있지 않을 경우 emerge
    # ssh mailroot@localhost
    $ maildirmake .maildir
    $ qmail-inject root << EOF
    test root e-mail!
    EOF
    
    $ qmail-inject postmaster << EOF
    test postmaster e-mail!
    EOF
    
    $ qmail-inject mailroot << EOF
    test mailroot e-mail!
    EOF
    
    $ mutt
    메일박스에 3개의 메일을 확인
    $ exit
    # less /var/log/qmail/qmail-send/*
    메일이 정상적으로 오지 않았다면 로그의 에러를 확인
  4. 도메인 문제 발생시 확인할 내용
    # cat /etc/hostname /etc/dnsdomainname
    xx
    xxx.ac.kr
    # hostname --fqdn
    xx.xxx.ac.kr
    # cat /var/qmail/control/me
    xx.xxx.ac.kr
    # cat /var/qmail/control/defaultdomain
    xxx.ac.kr
    # cat /var/qmail/control/plusdomain
    ac.kr
    # cat /var/qmail/control/locals
    xx.xxx.ac.kr
    # cat /var/qmail/control/rcpthosts
    xx.xxx.ac.kr
    localhost
  5. courier-imap 설치
    # emerge courier-imap
    vpopmail을 사용한다면 반드시 vpopmail을 먼저 설치한 뒤에 설치를 수행해야 함
    # etc-update
    # nano -w /etc/courier/authlib/authdaemonrc
    다음의 내용을 찾아서 적절히 수정
    authmodulelist="authpam authuserdb authshadow"
    authmodulelistorig="authuserdb authpam authshadow"
    
    # rc-update add courier-authlib default
    # /etc/init.d/courier-authlib start
    인증 서비스 시작

    # nano -w /etc/courier-imap/pop3d
    다음의 내용을 찾아서 적절히 수정
    POP3DSTART=YES
    
    # nano -w /etc/courier-imap/pop3d.cnf
    "[ req_dn ]"부분을 적절하게 수정
    [ req_dn ]
    C=KO
    ST=KB
    L=Daegu
    O=Kyungpook National University VR Lab
    OU=Automatically-generated POP3 SSL key
    CN=xx.xxx.ac.kr
    emailAddress=mailroot@xx.xxx.ac.kr
    
    # mkpop3dcert
    # rc-update add courier-pop3d-ssl default
    # /etc/init.d/courier-pop3d-ssl start
    POP3 over SSL 서비스 시작
    평문 POP3를 지원하려면 courier-pop3d 데몬을 추가한다

    # nano -w /etc/courier-imap/imapd
    다음의 내용을 찾아서 적절히 수정
    IMAPDSTART=YES
    
    # nano -w /etc/courier-imap/imapd.cnf
    "[ req_dn ]"부분을 적절하게 수정
    [ req_dn ]
    C=KO
    ST=KB
    L=Daegu
    O=Kyungpook National University VR Lab
    OU=Automatically-generated IMAP SSL key
    CN=xx.xxx.ac.kr
    emailAddress=mailroot@xx.xxx.ac.kr
    
    # mkimapdcert
    # rc-update add courier-imapd-ssl default
    # /etc/init.d/courier-imapd-ssl start
    IMAP over SSL 서비스 시작
    평문 IMAP을 지원하려면 courier-imapd 데몬을 추가한다
  6. SMTP 인증 설정
    # emerge checkpassword-pam
    # nano -w /var/qmail/control/conf-smtpd
    다음 줄을 찾아서 주석 해제
    QMAIL_SMTP_CHECKPASSWORD="/usr/bin/checkpassword-pam -s system-auth"
    
    # /etc/init.d/svscan restart
  7. relay-ctrl 설치
    # emerge relay-ctrl
    # cd /etc/tcprules.d/
    # nano -w tcp.qmail-smtp
    가장 마지막에 릴레이를 허용할 영역을 추가
    # VR Lab 506
    000.000.90.87-97:allow,RELAYCLIENT="",RBLSMTPD=""
    000.000.90.136-145:allow,RELAYCLIENT="",RBLSMTPD=""
    # VR Lab 404
    000.000.29.220-227:allow,RELAYCLIENT="",RBLSMTPD=""
    # VR Lab 509
    000.000.90.16:allow,RELAYCLIENT="",RBLSMTPD=""
    
    # tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp < /etc/tcprules.d/tcp.qmail-smtp
    # nano -w /var/qmail/control/conf-smtpd
    다음 줄들을 찾아서 주석 해제
    TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"
    
    QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"
    QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} relay-ctrl-check"
    
    # nano -w /var/qmail/control/conf-pop3d
    다음 줄들을 찾아서 주석 해제
    QMAIL_POP3_POP3HOST="$(<${QMAIL_CONTROLDIR}/me)"
    
    QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"
    QMAIL_POP3_POSTAUTH="${QMAIL_POP3_POSTAUTH} /usr/bin/relay-ctrl-allow"
    
    # nano -w /etc/courier-imap/pop3d
    "PRERUN" 항목에 "envdir /etc/relay-ctrl relay-ctrl-chdir"를 추가
    "LOGINRUN" 항목에 "relay-ctrl-allow"를 추가
    PRERUN="envdir /etc/relay-ctrl relay-ctrl-chdir"
    LOGINRUN="relay-ctrl-allow"
    
    # nano -w /etc/courier-imap/imapd
    "PRERUN" 항목에 "envdir /etc/relay-ctrl relay-ctrl-chdir"를 추가
    "LOGINRUN" 항목에 "relay-ctrl-allow"를 추가
    PRERUN="envdir /etc/relay-ctrl relay-ctrl-chdir"
    LOGINRUN="relay-ctrl-allow"
    
    # /etc/init.d/svscan restart
    모든 서비스를 재시작해서 설정 적용
  8. 메일용 백신 설치
    # emerge clamav
    # nano -w /etc/conf.d/clamd
    "START_CLAMD"항목을 "yes"로 설정
    START_CLAMD=yes
    
    # nano -w /etc/clamd.conf
    샘플 설정파일을 확인 후 "Example"줄을 주석 처리
    #Example
    User qscand
    
    # chown qscand -R /var/run/clamav
    # nano -w /etc/freshclam.conf
    샘플 설정파일을 확인 후 "Example"줄을 주석 처리
    #Example
    
    # rc-update add clamd default
    # /etc/init.d/clamd start
    서비스 실행
  9. 스팸방지 필터 설치
    # emerge spamassassin
    # nano -w /etc/mail/spamassassin/local.cf
    다음과 같은 내용을 추가
    rewrite_header Subject *****SPAM*****
    report_safe 1
    required_hits 6
    skip_rbl_checks 1
    
    # rc-update add spamd default
    # /etc/init.d/spamd start
  10. qmail용 메일 필터링 스캐너 설치
    # USE="spamassassin" emerge qmail-scanner
    # nano -w /var/qmail/control/conf-common
    다음 항목을 수정
    export QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue
    
    conf-common 대신 tcprules를 변경할 경우 접근권한 오류가 났었음
    # setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z
    # setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -g
    # chown -R qscand:qscand /var/spool/qmailscan/
    # nano -w /var/qmail/bin/qmail-scanner-queue.pl
    clamav가 설치되어 있다면 다음과 같은 내용이 있는지 확인
    my $clamscan_binary='/usr/bin/clamscan';
    my $clamdscan_binary='/usr/bin/clamdscan';
    
    spamassassin이 설치되어 있다면 다음과 같은 내용이 있는지 확인
    my $spamassassin_binary='/usr/bin/spamassassin ';
    
    # /etc/init.d/svscan restart
    메일 서비스를 다시 실행
  11. 다람쥐 웹메일 설치
    # cd
    # USE="virus-scan" emerge squirrelmail
    # webapp-config -I -h xx_ssl -d squirrelmail squirrelmail 1.4.5
    잠시 설치를 기다림
    # cd /var/www/xx_ssl/htdocs/squirrelmail/config
    # perl conf.pl
    서버 설정을 통해 xx.xxx.ac.kr을 서버로 하고
    기타, 언어나 css를 설정
    # nano -w /etc/apache2/vhosts.d/xx_ssl.conf
    다음의 내용을 적절한 위치에 추가
    <IfModule mod_ssl.c>
    	<VirtualHost *:443>
    
    	Alias /mail /var/www/xx_ssl/htdocs/mail
    ...
    	</VirtualHost>                                  
    </IfModule>
    

================================================================================
전체 업데이트
--------------------------------------------------------------------------------
  1. 전체 업데이트 수행
    # emerge -u world
  2. 바뀐 설정 파일들 조정
    # etc-update
    # nano -w /etc/rc.conf
    다음의 내용을 확인
    XSESSION="Gnome"
    
    # nano -w /etc/inittab
    다음의 내용을 확인
    c1:12345:respawn:/sbin/qingy tty1 -s 1
    c2:12345:respawn:/sbin/qingy tty2 -s 1 -v
    c3:12345:respawn:/sbin/qingy-DirectFB tty3 -s 1
    c4:12345:respawn:/sbin/qingy-DirectFB tty4 -s 1 -v
    
  3. world 업데이트 후에는 항상 주의해서 etc를 업데이트 하여야 한다

================================================================================
플래그 수정 후 전체 업데이트
--------------------------------------------------------------------------------
  1. 컴파일 옵션 조정
    # nano -w /etc/make.conf
    다음의 내용을 추가
    MAKEOPTS="-j5"
    
    # nano -w /etc/portage/package.use
    다음의 내용을 추가
    dev-libs/apr-util -berkdb
    dev-util/subversion -berkdb
    net-dns/libidn -java
    
  2. 전체 시스템 업데이트
    # emerge sync
    포티지 업데이트를 기다림
    # emerge -uDNpv world
    # emerge --update --deep --newuse --pretend --verbose world
    업데이트될 내용 확인
    # wget http://000.000.29.220/pub/j2sdk-1_4_2-doc.zip
    # mv j2sdk-1_4_2-doc.zip /usr/portage/distfiles/
    # emerge -uDN world
    업데이트 수행
  3. 바뀐 설정 파일들 조정
    # env-update
    # source /etc/profile
    # etc-update
    world 업데이트 후에는 항상 주의해서 etc를 업데이트 하여야 한다
    웹메일이나 ViewCVS 등을 살펴본 후 설정을 조정한다

================================================================================
트래픽 감시 도구 설치
--------------------------------------------------------------------------------
  1. ntop 설치
    # emerge -pv ntop
    # emerge ntop
    # nano -w /etc/conf.d/ntop
    다음의 내용을 수정
    NTOP_OPTS="--http-server 0 --https-server 3020 --interface eth0"
    
    # ntop
    최초 수행하여 초기화 Ctrl-C 로 종료
    # /etc/init.d/ntop start
    최초 수행하여 초기화
    # links2 https://localhost:3020/
    실행을 확인
  2. iftop 설치
    # emerge -pv iftop
    # emerge iftop
    # iftop
    포트 번호 표시 : p 화면 스크롤 : j/k

================================================================================
trac - subversion과 연동되는 프로젝트 관리 도구
--------------------------------------------------------------------------------
  1. trac 설치
    # emerge -pv trac
    # emerge trac
    # webapp-config -I -h xx_ssl -d trac trac 0.8.4
    # ln -s /home/admins/srcroot /var/svn
    # cd /usr/share/trac
    # mv templates templates_en
    # wget http://000.000.29.220/pub/trac_0.8.4_ko.tar
    # tar xvf trac_0.8.4_ko.tar
    # rm trac_0.8.4_ko.tar
    # mv templates templates_ko
    # ln -s templates_ko templates
    한글화
  2. 실험용 프로젝트 생성
    # trac-admin /var/www/xx_ssl/htdocs/trac/trash initenv
    실험하기 위한 테스트 프로젝트를 생성
    Project Name [My Project]> Trash Project
    Path to repository [/var/svn/test]> /var/svn/trash
    Templates directory [/usr/share/trac/templates]> 
    
    # nano -w /etc/apache2/vhosts.d/xx_ssl.conf
    웹서버에 연결
    # chown wwwroot:apache /var/www/xx_ssl/* -R
    # chmod g+w /var/www/xx_ssl/htdocs/trac/trash/db -R
    # trac-admin /var/www/xx_ssl/htdocs/trac/trash
    프로젝트 설정
    'quit'로 종료한다
    # /etc/init.d/apache2 restart
  3. 연구실 전체 프로젝트 생성
    # trac-admin /var/www/xx_ssl/htdocs/trac/xx initenv
    Project Name [My Project]> VR Lab Project
    Path to repository [/var/svn/test]> /var/svn/xx
    Templates directory [/usr/share/trac/templates]> 
    
    # nano -w /etc/apache2/vhosts.d/xx_ssl.conf
    웹서버에 연결
    # chown wwwroot:apache /var/www/xx_ssl/* -R
    # chmod g+w /var/www/xx_ssl/htdocs/trac/xx/db -R
    # trac-admin /var/www/xx_ssl/htdocs/trac/xx
    프로젝트 설정
    'quit'로 종료한다
    # /etc/init.d/apache2 restart

================================================================================
아파치 설정을 수정
--------------------------------------------------------------------------------
  1. https를 통한 암호 인증 부분 수정
    # nano -w /etc/apache2/vhosts.d/xx_ssl.conf
    다음의 내용으로 정리
    /files : users 그룹 멤버만 사용할 수 있는 공유 파일
    /mail : 로컬 사용자만 사용할 수 있는 웹 메일
    /viewsrc : users 그룹 멤버만 사용할 수 있는 소스 서버 뷰어
    /projects/xx : users 그룹 멤버만 사용할 수 있는 VR Lab 프로젝트 관리
    /projects/trash : users 그룹 멤버만 사용할 수 있는 연습용 프로젝트 관리
    <IfDefine SSL>
            <IfModule !mod_ssl.c>
                    LoadModule ssl_module    modules/mod_ssl.so
            </IfModule>
    </IfDefine>
    
    <IfModule mod_ssl.c>
            NameVirtualHost *:443
    
            ScriptAlias /viewsrc /var/www/xx_ssl/cgi-bin/viewcvs/viewcvs.cgi
    #       ScriptAlias /srcquery /var/www/xx_ssl/cgi-bin/viewcvs/cvsquery.cgi
    
            Alias /mail /var/www/xx_ssl/htdocs/squirrelmail
    
            ScriptAlias /projects/trash /var/www/xx_ssl/cgi-bin/trac.cgi
            ScriptAlias /projects/xx /var/www/xx_ssl/cgi-bin/trac.cgi
            Alias /trac /var/www/xx_ssl/htdocs/trac
    
            <Directory /var/www/xx_ssl>
                    Options -Indexes Includes -ExecCGI FollowSymLinks
                    AllowOverride None
                    <IfModule mod_access.c>
                            Order Deny,Allow
                            Allow from all
                    </IfModule>
            </Directory>
    
            <Directory /var/www/xx_ssl/files>
                    Options Indexes Includes -ExecCGI FollowSymLinks
                    AllowOverride All
                    <IfModule mod_access.c>
                            Order Deny,Allow
                            Allow from all
                    </IfModule>
                    AuthType Basic
                    AuthName "[ xxx VR Lab ] Members Only"
                    AuthUserFile /var/www/xx_ssl/access_info/accpasswd
                    AuthGroupFile /var/www/xx_ssl/access_info/accgrp
                    Require group users
            </Directory>
    
            <Location /mail/>
                    Options -Indexes Includes -ExecCGI FollowSymLinks
                    AllowOverride All
                    <IfModule mod_access.c>
                            Order Deny,Allow
                            Allow from all
                    </IfModule>
            </Location>
    
            <Directory /var/www/xx_ssl/cgi-bin>
                    Options -Indexes Includes ExecCGI FollowSymLinks
                    SetHandler cgi-script
                    AllowOverride All
                    <IfModule mod_access.c>
                            Order Deny,Allow
                            Allow from all
                    </IfModule>
            </Directory>
    
            <Location /viewsrc>
                    AuthType Basic
                    AuthName "[ xxx VR Lab ] Members Only"
                    AuthUserFile /var/www/xx_ssl/access_info/accpasswd
                    AuthGroupFile /var/www/xx_ssl/access_info/accgrp
                    Require group users
            </Location>
    
            <Location /projects/trash>
                    SetEnv TRAC_ENV "/var/www/xx_ssl/htdocs/trac/trash"
                    AuthType Basic
                    AuthName "[ Trash Project ] Members Only"
                    AuthUserFile /var/www/xx_ssl/access_info/accpasswd
                    AuthGroupFile /var/www/xx_ssl/access_info/accgrp
                    Require group users
            </Location>
    
            <Location /projects/xx>
                    SetEnv TRAC_ENV "/var/www/xx_ssl/htdocs/trac/xx"
                    AuthType Basic
                    AuthName "[ VR Lab Project ] Members Only"
                    AuthUserFile /var/www/xx_ssl/access_info/accpasswd
                    AuthGroupFile /var/www/xx_ssl/access_info/accgrp
                    Require group users
            </Location>
    
            <Location /access_info>
                    <IfModule mod_access.c>
                            Order Allow,Deny
                            Deny from all
                    </IfModule>
            </Location>
    
            <VirtualHost *:443>
                    DocumentRoot "/var/www/xx_ssl"
                    ServerName xx.xxx.ac.kr:443
                    ServerAdmin wwwroot@xx.xxx.ac.kr
                    ErrorLog /var/www/xx_ssl/logs/ssl_error_log
                    <IfModule mod_log_config.c>
                            TransferLog /var/www/xx_ssl/logs/ssl_access_log
                    </IfModule>
    
                    SSLEngine on
                    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
                    SSLCertificateFile conf/ssl/server.crt
                    SSLCertificateKeyFile conf/ssl/server.key
                    #SSLCertificateChainFile conf/ssl/ca.crt
                    #SSLCACertificatePath conf/ssl/ssl.crt
                    #SSLCACertificateFile conf/ssl/ca-bundle.crt
                    #SSLCARevocationPath conf/ssl/ssl.crl
                    #SSLCARevocationFile conf/ssl/ca-bundle.crl
                    #SSLVerifyClient require
                    #SSLVerifyDepth  10
    
                    #<Location />
                            #SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
                            #            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
                            #            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
                            #            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
                            #            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
                            #           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
                    #</Location>
    
                    #SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire
    
                    <Files ~ "\.(cgi|shtml|phtml|php?)$">
                            SSLOptions +StdEnvVars
                    </Files>
    
                    <Directory "/var/www/xx_ssl/cgi-bin">
                            SSLOptions +StdEnvVars
                    </Directory>
    
                    <IfModule mod_setenvif.c>
                            SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
                            downgrade-1.0 force-response-1.0
                    </IfModule>
    
                    <IfModule mod_log_config.c>
                            CustomLog /var/www/xx_ssl/logs/ssl_request_log \
                                            "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
                    </IfModule>
    
                    <IfModule mod_rewrite.c>
                            RewriteEngine On
                            RewriteOptions inherit
                    </IfModule>
            </VirtualHost>
    </IfModule>