svn+trac+fastcgi

분류없음 2009/12/26 21:51
  1. Why fastcgi?
    • Apache mod_python을 이용한 svn+trac 셋업 방법은 일전에 포스팅했었다. 그러나 이 방법은 관리자 계정을 필요로 하며, apache를 사용하기 때문에 꽤 무겁게 느껴질 수 있다.
    • 그러므로 일반 사용자 계정을 이용해 Stand-alone으로 trac을 동작시키고 싶으므로 찾아보았다.
  2. 설치 패키지 리스트
  3. 설치 방법 (자세한 설명은 생략한다)
    • Installing packages

      Install subversion:
          install by yourself via whatever you want - yum, apt-get, rpm, ...
         
      Install lighttpd:
          wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.25.tar.gz
          tar xzf lighttpd-1.4.25.tar.gz
          cd lighttpd-1.4.25
          sh configure --prefix=~/lighttpd --without-pcre --without-zlib --without-bzip2
          make && make install   

      Install setup-tools:
          wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
          tar xzf setuptools-0.6c11.tar.gz
          cd setuptools-0.6c11
          python virtual-python.py --prefix=~/python
             
          export PATH=~/python/bin:$PATH
          python setup.py install
         
      Install Genshi:   
          easy_install -U Genshi   
         
      Install pysqlite:
          easy_install -U pysqlite
         
      Install trac:
          easy_install -U Trac

      Trac plug-ins   
      1. Account Manager - 웹으로 편리하게 Trac 계정 관리
          svn export http://trac-hacks.org/svn/accountmanagerplugin/0.11 ~/amp
          (cd ~/amp && python setup.py install && rm -rf ~/amp)
         
      2. TracWysiwygPlugin - 편리한 에디터
          svn export http://trac-hacks.org/svn/tracwysiwygplugin/0.11 ~/tracwysiwygplugin
          (cd ~/tracwysiwygplugin && python setup.py install && rm -rf ~/tracwysiwygplugin)
         
      3. IniAdminPlugin - 편리한 trac.ini 설정
          svn export http://trac-hacks.org/svn/iniadminplugin/0.11/ ~/iap
          (cd ~/iap && python setup.py install && rm -rf ~/iap)
         
      4. Bitten - Continuous Integration 시스템
          svn export http://svn.edgewall.org/repos/bitten/trunk ~/bitten
          (cd ~/bitten && python setup.py install && rm -rf ~/bitten)

      5. SvnAuthz File Administration Plugin for Trac
          svn export http://trac-hacks.org/svn/svnauthzadminplugin/0.11 ~/saa
          (cd ~/saa && python setup.py install && rm -rf ~/saa)
  4. trac 설정 방법 (자세한 설명은 생략한다)
    • Configure trac.ini:
      cat >> ~/tracbase/conf/trac.ini
      [account-manager]
      password_store = SvnServePasswordStore
      password_file = /home/svntrac/svnrepo/conf/passwd

      [svnauthzadmin]
      show_all_repos = true

      [components]
      trac.web.auth.LoginModule = disabled
      acct_mgr.web_ui.LoginModule = enabled
      acct_mgr.web_ui.RegistrationModule = disabled
      acct_mgr.svnserve.* = enabled
      acct_mgr.svnserve.svnservepasswordstore = enabled
      acct_mgr.admin.AccountManagerAdminPage = enabled

      tracwysiwyg.* = enabled
      bitten.* = enabled
      iniadmin.iniadmin.iniadminplugin = enabled
      svnauthz.* = enabled

      [trac]
      authz_file = /home/svntrac/svnrepo/conf/authz
  5. lighttpd 설정
    • 기본 설정 파일을 소스로부터 가져온다.
      • cp ~/lighttpd-1.4.25/doc/lighttpd.conf ~/lighttpd.conf
    • server.modules에서 "mod_fastcgi" 를 활성화 시킨다.
    • 다음을 적당히 설정한다.
      • server.document-root
      • server.errorlog
      • accesslog.filename
      • server.port
      • server.pid-file
    • 다음 내용을 lighttpd.conf 파일에 추가한다.
      • var.fcgi_binary="/home/svntrac/python/bin/python /home/svntrac/python/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/fcgi_frontend.py" # 0.11 if installed with easy_setup, it is inside the egg directory
        fastcgi.server = ("/trac" =>
                            ("trac" =>
                                ("socket" => "/tmp/trac-fastcgi.sock",
                                    "bin-path" => fcgi_binary,
                                    "check-local" => "disable",
                                    "bin-environment" =>
                                    ("TRAC_ENV" => "/home/svntrac/tracbase")
                                )
                            )
                        )
    • lighttpd가 적절히 동작하는지 테스트 해본다.
      • ~/lighttpd/sbin/lighttpd -f ~/lighttpd.conf -D
    • http://localhost/trac 을 확인.
    • 참고
      • http://redmine.lighttpd.net/wiki/lighttpd/HowToSetupTrac
    • some plugins
      • http://trac-hacks.org/wiki/CodeTagsPlugin
      • http://trac-hacks.org/wiki/DiscussionPlugin
      • http://trac-hacks.org/wiki/GanttCalendarPlugin
      • http://trac-hacks.org/wiki/MenusPlugin
      • http://trac-hacks.org/wiki/ScreenshotsPlugin
      • http://trac-hacks.org/wiki/TracDownloaderPlugin
      • http://trac-hacks.org/wiki/WatchlistPlugin



저작자 표시 비영리 변경 금지
Posted by clique