= FastCGI로 Trac 운영하기 =

버전 0.9 이후에, Trac을 [http://www.fastcgi.com/ FastCGI] 인터페이스를 통해서 운영할 수 있습니다. [wiki:TracModPython mod_python]처럼, Trac을 resident 상태로 유지합니다. 그리고 각 요청에 대해서 새로운 프로세스를 시작해야만 하는 외부의 CGI 인터페이스에 비해서 빠릅니다. 그러나 mod_python과는 달리, [http://httpd.apache.org/docs/suexec.html SuEXEC]를 지원할 수 있습니다. 추가적으로 다양한 웹서버에 의해서 지원되어집니다.

== 간단한 아파치 설정 ==
{{{
# Enable fastcgi for .fcgi files
# (If you're using a distro package for mod_fcgi, something like
# this is probably already present)
<IfModule mod_fastcgi.c>
   AddHandler fastcgi-script .fcgi
   FastCgiIpcDir /var/lib/apache2/fastcgi 
</IfModule>
LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
}}}

전체의 기본설정으로 `TRAC_ENV`를 설정하거나:
{{{
FastCgiConfig -initial-env TRAC_ENV=/path/to/env/trac
}}}

다음과 같이 하나의 디렉토리에 여러개의 Trac 프로젝트들을 설정할 수도 있습니다.:
{{{
FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/parent/dir/of/projects
}}}

[wiki:TracCgi]에서 설명한 대로 `ScriptAlias` 혹은 그와 유사한 옵션에 `trac.cgi` 대신 `trac.fcgi`를 사용해서 설정하십시오.

== 간단한 Lighttpd 설정 ==

FastCGI는 주로 [http://www.lighttpd.net/ lighttpd]같은 다른 웹서버에서 사용하기 위해서 개발되어졌습니다.

높은 성능의 환경에 대해 최적화되어 있는 lighttpd는 보안성, 속도, compliant가 뛰어나며 매우 유연한 웹서버입니다. lighttpd는 다른 웹서버와 비교해서 매우 작은 메모리와 CPU 부하를 가집니다.

lighttpd와 같이 `trac.fcgi`를 사용하기 위해서는, lighttpd.conf 파일에 다음 내용을 추가하십시오.:
{{{
fastcgi.server = ("/trac" =>
                   ("trac" =>
                     ("socket" => "/tmp/trac-fastcgi.sock",
                      "bin-path" => "/path/to/cgi-bin/trac.fcgi",
                      "check-local" => "disable",
                      "bin-environment" =>
                        ("TRAC_ENV" => "/path/to/projenv")
                     )
                   )
                 )
}}}

동작시키기를 원하는 각각의 Trac 인스턴스에 대해서 `fastcgi.server`에 새로운 엔트리를 추가할 필요가 있음을 주의하십시오. 위에서 설명한 `TRAC_ENV` 대신에 `TRAC_ENV_PARENT_DIR` 변수를 사용할 수도 있습니다.

Other important information like [http://trac.lighttpd.net/trac/wiki/TracInstall this updated TracInstall page], [wiki:TracCgi#MappingStaticResources and this] are useful for non-fastcgi specific installation aspects.

lighttpd를 다시 시작하고 Trac에 접속하기 위해서 `http://yourhost.example.org/trac`로 접속하십시오.

----
참고 : TracCgi, TracModPython, TracInstall, TracGuide
