# HG changeset patch # User Yoshiki Yazawa # Date 1229512675 -32400 # Node ID 250ae178582870f75ff669687e0faab92a517428 # Parent bc32663d557ecb4e09dd2ad411c7cbafebcd91eb finished collab.tex diff -r bc32663d557e -r 250ae1785828 ja/collab.tex --- a/ja/collab.tex Mon Dec 08 18:19:04 2008 +0900 +++ b/ja/collab.tex Wed Dec 17 20:17:55 2008 +0900 @@ -1486,105 +1486,167 @@ %\subsubsection{Configuring lighttpd} \subsubsection{lighttpdの設定} -To be exhaustive in my experiments, I tried configuring the -increasingly popular \texttt{lighttpd} web server to serve the same -repository as I described with Apache above. I had already overcome -all of the problems I outlined with Apache, many of which are not -server-specific. As a result, I was fairly sure that my file and -directory permissions were good, and that my \sfilename{hgweb.cgi} -script was properly edited. +%To be exhaustive in my experiments, I tried configuring the +%increasingly popular \texttt{lighttpd} web server to serve the same +%repository as I described with Apache above. I had already overcome +%all of the problems I outlined with Apache, many of which are not +%server-specific. As a result, I was fairly sure that my file and +%directory permissions were good, and that my \sfilename{hgweb.cgi} +%script was properly edited. + +筆者の実験の中では,Apacheを使ってサービスしたのと同じリポジトリを人気を +獲得しつつあるウェブサーバである\texttt{lighttpd}を用いてサービスすること +も試みた. Apacheに関する全ての問題点を既に解決していたが,その中の多くは +サーバ特有というわけではなかった.結果として,ファイルとディレクトリのパー +ミッション設定が正しいこと, \sfilename{hgweb.cgi}スクリプトが正しく設定 +されていることを確信した. -Once I had Apache running, getting \texttt{lighttpd} to serve the -repository was a snap (in other words, even if you're trying to use -\texttt{lighttpd}, you should read the Apache section). I first had -to edit the \texttt{mod\_access} section of its config file to enable -\texttt{mod\_cgi} and \texttt{mod\_userdir}, both of which were -disabled by default on my system. I then added a few lines to the end -of the config file, to configure these modules. +%Once I had Apache running, getting \texttt{lighttpd} to serve the +%repository was a snap (in other words, even if you're trying to use +%\texttt{lighttpd}, you should read the Apache section). I first had +%to edit the \texttt{mod\_access} section of its config file to enable +%\texttt{mod\_cgi} and \texttt{mod\_userdir}, both of which were +%disabled by default on my system. I then added a few lines to the end +%of the config file, to configure these modules. +すでにApacheを使っていたので,\texttt{lighttpd}でリポジトリのサービスを行 +うことはたやすかった.(これは\texttt{lighttpd}を使ってサービスを試みる場 +合もApacheのセクションを読む必要があるということでもある.)筆者のシステ +ムでは\texttt{mod\_cgi}と\texttt{mod\_userdir}が共に無効に設定されていた +ので,これらを有効にするために,まず設定ファイルの\texttt{mod\_access}セ +クションを編集する必要があった.その後で,下記のモジュールを有効にするた +めに,設定ファイルの末尾に数行を追加した. \begin{codesample2} userdir.path = "public_html" cgi.assign = ( ".cgi" => "" ) \end{codesample2} -With this done, \texttt{lighttpd} ran immediately for me. If I had -configured \texttt{lighttpd} before Apache, I'd almost certainly have -run into many of the same system-level configuration problems as I did -with Apache. However, I found \texttt{lighttpd} to be noticeably -easier to configure than Apache, even though I've used Apache for over -a decade, and this was my first exposure to \texttt{lighttpd}. +%With this done, \texttt{lighttpd} ran immediately for me. If I had +%configured \texttt{lighttpd} before Apache, I'd almost certainly have +%run into many of the same system-level configuration problems as I did +%with Apache. However, I found \texttt{lighttpd} to be noticeably +%easier to configure than Apache, even though I've used Apache for over +%a decade, and this was my first exposure to \texttt{lighttpd}. +これらの設定をするだけで\texttt{lighttpd}はすぐに動作した. Apacheより前 +に\texttt{lighttpd}を試していたら,Apacheで直面したような様々なシステムレ +ベルの設定問題に遭遇していたに違いないが,初めて使う\texttt{lighttpd}の設 +定の方が,これまで10年以上にわたって使ってきたApacheのそれよりも明らかに +簡単であることが分かった. %\subsection{Sharing multiple repositories with one CGI script} \subsection{1つのCGIスクリプトで複数のリポジトリを共有する} -The \sfilename{hgweb.cgi} script only lets you publish a single -repository, which is an annoying restriction. If you want to publish -more than one without wracking yourself with multiple copies of the -same script, each with different names, a better choice is to use the -\sfilename{hgwebdir.cgi} script. +%The \sfilename{hgweb.cgi} script only lets you publish a single +%repository, which is an annoying restriction. If you want to publish +%more than one without wracking yourself with multiple copies of the +%same script, each with different names, a better choice is to use the +%\sfilename{hgwebdir.cgi} script. +\sfilename{hgweb.cgi}スクリプトには,1つのリポジトリしか公開できないとい +う厄介な制限がある. 2つ以上のリポジトリを公開したい場合は,同じスクリプ +トを別の名前でいくつも動かすのではなく, \sfilename{hgwebdir.cgi}スクリプ +トを使うのが良いだろう. -The procedure to configure \sfilename{hgwebdir.cgi} is only a little -more involved than for \sfilename{hgweb.cgi}. First, you must obtain -a copy of the script. If you don't have one handy, you can download a -copy from the master Mercurial repository at -\url{http://www.selenic.com/repo/hg/raw-file/tip/hgwebdir.cgi}. +%The procedure to configure \sfilename{hgwebdir.cgi} is only a little +%more involved than for \sfilename{hgweb.cgi}. First, you must obtain +%a copy of the script. If you don't have one handy, you can download a +%copy from the master Mercurial repository at +%\url{http://www.selenic.com/repo/hg/raw-file/tip/hgwebdir.cgi}. +\sfilename{hgwebdir.cgi}の設定の手順は\sfilename{hgweb.cgi}よりもわずかに +込み入っているだけだ.手近なところにスクリプトがなければ,Mercurialのマス +ターリポジトリ +\url{http://www.selenic.com/repo/hg/raw-file/tip/hgwebdir.cgi}からスクリ +プトを入手できる. -You'll need to copy this script into your \dirname{public\_html} -directory, and ensure that it's executable. +%You'll need to copy this script into your \dirname{public\_html} +%directory, and ensure that it's executable. +このスクリプトを\dirname{public\_html}ディレクトリにコピーし,実行パーミッ +ションを与える. \begin{codesample2} cp .../hgwebdir.cgi ~/public_html chmod 755 ~/public_html ~/public_html/hgwebdir.cgi \end{codesample2} -With basic configuration out of the way, try to visit -\url{http://myhostname/~myuser/hgwebdir.cgi} in your browser. It -should display an empty list of repositories. If you get a blank -window or error message, try walking through the list of potential -problems in section~\ref{sec:collab:wtf}. +%With basic configuration out of the way, try to visit +%\url{http://myhostname/~myuser/hgwebdir.cgi} in your browser. It +%should display an empty list of repositories. If you get a blank +%window or error message, try walking through the list of potential +%problems in section~\ref{sec:collab:wtf}. +通常の設定の場合,ブラウザで\url{http://myhostname/~myuser/hgwebdir.cgi} +を開くと,中身が空のリポジトリを表示するはずだ.ウィンドウ自体が空だった +り,エラーメッセージが表示される場合は,セクション~\ref{sec:collab:wtf} +の問題リストを参照してほしい. -The \sfilename{hgwebdir.cgi} script relies on an external -configuration file. By default, it searches for a file named -\sfilename{hgweb.config} in the same directory as itself. You'll need -to create this file, and make it world-readable. The format of the -file is similar to a Windows ``ini'' file, as understood by Python's -\texttt{ConfigParser}~\cite{web:configparser} module. +%The \sfilename{hgwebdir.cgi} script relies on an external +%configuration file. By default, it searches for a file named +%\sfilename{hgweb.config} in the same directory as itself. You'll need +%to create this file, and make it world-readable. The format of the +%file is similar to a Windows ``ini'' file, as understood by Python's +%\texttt{ConfigParser}~\cite{web:configparser} module. +\sfilename{hgwebdir.cgi}は外部の設定ファイルを使用している.デフォルトで +は同じディレクトリ内の\sfilename{hgweb.config}というファイルを参照する. +このファイルを作成し,全てのユーザから読めるように設定する. +このファイルはPythonの\texttt{ConfigParser}~\cite{web:configparser}で処 +理できるようWindowsの``ini''ファイルと似た形式になっている. -The easiest way to configure \sfilename{hgwebdir.cgi} is with a -section named \texttt{collections}. This will automatically publish -\emph{every} repository under the directories you name. The section -should look like this: +%The easiest way to configure \sfilename{hgwebdir.cgi} is with a +%section named \texttt{collections}. This will automatically publish +%\emph{every} repository under the directories you name. The section +%should look like this: +\sfilename{hgwebdir.cgi}の最も簡単な設定方法は,\texttt{collections}セク +ションを編集することである.これは自動的に指定したディレクトリ以下の +\emph{全ての}リポジトリを公開する.このセクションは次のようになっている: \begin{codesample2} [collections] /my/root = /my/root \end{codesample2} -Mercurial interprets this by looking at the directory name on the -\emph{right} hand side of the ``\texttt{=}'' sign; finding -repositories in that directory hierarchy; and using the text on the -\emph{left} to strip off matching text from the names it will actually -list in the web interface. The remaining component of a path after -this stripping has occurred is called a ``virtual path''. +%Mercurial interprets this by looking at the directory name on the +%\emph{right} hand side of the ``\texttt{=}'' sign; finding +%repositories in that directory hierarchy; and using the text on the +%\emph{left} to strip off matching text from the names it will actually +%list in the web interface. The remaining component of a path after +%this stripping has occurred is called a ``virtual path''. +Mercurialは``\texttt{=}''記号の\emph{右側}のディレクトリ名を参照して,ディ +レクトリ階層内のリポジトリを探す.見つかった時は,リポジトリのパスから +\emph{左側}の文字列とマッチする部分を削り,実際にウェブインタフェースに表 +示されるパス文字列を作る.削除後のパスを``仮想パス''と呼ぶ. -Given the example above, if we have a repository whose local path is -\dirname{/my/root/this/repo}, the CGI script will strip the leading -\dirname{/my/root} from the name, and publish the repository with a -virtual path of \dirname{this/repo}. If the base URL for our CGI -script is \url{http://myhostname/~myuser/hgwebdir.cgi}, the complete -URL for that repository will be -\url{http://myhostname/~myuser/hgwebdir.cgi/this/repo}. +%Given the example above, if we have a repository whose local path is +%\dirname{/my/root/this/repo}, the CGI script will strip the leading +%\dirname{/my/root} from the name, and publish the repository with a +%virtual path of \dirname{this/repo}. If the base URL for our CGI +%script is \url{http://myhostname/~myuser/hgwebdir.cgi}, the complete +%URL for that repository will be +%\url{http://myhostname/~myuser/hgwebdir.cgi/this/repo}. +上の例で,CGIスクリプトは,ローカルパスが\dirname{/my/root/this/repo}であ +るリポジトリに対して\dirname{/my/root}を取り除き,\dirname{this/repo}とい +う仮想パスを作成し,公開する.もしCGIスクリプトのベースURLが +\url{http://myhostname/~myuser/hgwebdir.cgi}だとすると,リポジトリの完全 +なURLは\url{http://myhostname/~myuser/hgwebdir.cgi/this/repo}となる. -If we replace \dirname{/my/root} on the left hand side of this example -with \dirname{/my}, then \sfilename{hgwebdir.cgi} will only strip off -\dirname{/my} from the repository name, and will give us a virtual -path of \dirname{root/this/repo} instead of \dirname{this/repo}. +%If we replace \dirname{/my/root} on the left hand side of this example +%with \dirname{/my}, then \sfilename{hgwebdir.cgi} will only strip off +%\dirname{/my} from the repository name, and will give us a virtual +%path of \dirname{root/this/repo} instead of \dirname{this/repo}. +この例の左辺の\dirname{/my/root}を\dirname{/my}で置き換えると +\sfilename{hgwebdir.cgi}は\dirname{/my}だけをリポジトリ名から取り除き,仮 +想パスとして\dirname{this/repo}ではなく\dirname{root/this/repo}を作る. -The \sfilename{hgwebdir.cgi} script will recursively search each -directory listed in the \texttt{collections} section of its -configuration file, but it will \texttt{not} recurse into the -repositories it finds. +%The \sfilename{hgwebdir.cgi} script will recursively search each +%directory listed in the \texttt{collections} section of its +%configuration file, but it will \texttt{not} recurse into the +%repositories it finds. +\sfilename{hgwebdir.cgi}スクリプトは,設定ファイルの\texttt{collections} +セクションに書かれたディレクトリを再帰的にサーチする.このスクリプトは見 +つけたリポジトリの中はサーチ\texttt{しない}. -The \texttt{collections} mechanism makes it easy to publish many -repositories in a ``fire and forget'' manner. You only need to set up -the CGI script and configuration file one time. Afterwards, you can -publish or unpublish a repository at any time by simply moving it -into, or out of, the directory hierarchy in which you've configured -\sfilename{hgwebdir.cgi} to look. +%The \texttt{collections} mechanism makes it easy to publish many +%repositories in a ``fire and forget'' manner. You only need to set up +%the CGI script and configuration file one time. Afterwards, you can +%publish or unpublish a repository at any time by simply moving it +%into, or out of, the directory hierarchy in which you've configured +%\sfilename{hgwebdir.cgi} to look. +\texttt{collections}メカニズムによって複数のリポジトリを簡単に公開するこ +とができる.CGIスクリプトと設定ファイルを編集するのは最初の一回だけでよ +く,リポジトリを\sfilename{hgwebdir.cgi}の探索するディレクトリ階層内に移 +動すれば公開に,階層内から外せば非公開に設定できる. + %\subsubsection{Explicitly specifying which repositories to publish} \subsubsection{どのリポジトリを表示するか明示的に指定する} @@ -1799,7 +1861,6 @@ %Some of the items in the \rcsection{web} section of a \hgrc\ file are %only for use with the \hgcmd{serve} command. - \hgrc\ ファイルの\rcsection{web}セクションの項目は\hgcmd{serve}コマンド でのみ用いられる.