# HG changeset patch # User Yoshiki Yazawa # Date 1228727944 -32400 # Node ID bc32663d557ecb4e09dd2ad411c7cbafebcd91eb # Parent 3f9f9b087109f1fe8fe55fae75e45546bcc18e56 more collab.tex diff -r 3f9f9b087109 -r bc32663d557e ja/collab.tex --- a/ja/collab.tex Mon Dec 08 12:30:31 2008 +0900 +++ b/ja/collab.tex Mon Dec 08 18:19:04 2008 +0900 @@ -1218,78 +1218,127 @@ \section{CGIを使用したHTTPによるサービス} \label{sec:collab:cgi} -Depending on how ambitious you are, configuring Mercurial's CGI -interface can take anything from a few moments to several hours. +%Depending on how ambitious you are, configuring Mercurial's CGI +%interface can take anything from a few moments to several hours. + +どの程度のことを狙うかによって,MercurialのCGIインタフェースの設定には数 +分から数時間程度の時間がかかる. -We'll begin with the simplest of examples, and work our way towards a -more complex configuration. Even for the most basic case, you're -almost certainly going to need to read and modify your web server's -configuration. +%We'll begin with the simplest of examples, and work our way towards a +%more complex configuration. Even for the most basic case, you're +%almost certainly going to need to read and modify your web server's +%configuration. + +ここでは最も単純な例から始めて,より複雑な設定へ進んでいくことにしよう. +最も単純なケースでもおそらくウェブサーバの設定を調べて変更する必要がある +だろう. \begin{note} - Configuring a web server is a complex, fiddly, and highly - system-dependent activity. I can't possibly give you instructions - that will cover anything like all of the cases you will encounter. - Please use your discretion and judgment in following the sections - below. Be prepared to make plenty of mistakes, and to spend a lot - of time reading your server's error logs. +% Configuring a web server is a complex, fiddly, and highly +% system-dependent activity. I can't possibly give you instructions +% that will cover anything like all of the cases you will encounter. +% Please use your discretion and judgment in following the sections +% below. Be prepared to make plenty of mistakes, and to spend a lot +% of time reading your server's error logs. +ウェブサーバの設定は複雑かつ厄介でシステム依存の作業である. +読者が遭遇するすべてのケースについて手引きをすることはできないだろう. +以下のセクションでは,読みながら読者自身の思慮と判断を働かせて欲しい. +たくさんのミスを犯し,サーバのエラーログの解読に多くの時間を割くことにな +るのを肝に銘じておいて欲しい. \end{note} %\subsection{Web server configuration checklist} \subsection{Webサーバ設定のチェックリスト} -Before you continue, do take a few moments to check a few aspects of -your system's setup. +%Before you continue, do take a few moments to check a few aspects of +%your system's setup. +ここから先へ進む前に,読者のシステムについて確認をしておこう. \begin{enumerate} -\item Do you have a web server installed at all? Mac OS X ships with - Apache, but many other systems may not have a web server installed. -\item If you have a web server installed, is it actually running? On - most systems, even if one is present, it will be disabled by - default. -\item Is your server configured to allow you to run CGI programs in - the directory where you plan to do so? Most servers default to - explicitly disabling the ability to run CGI programs. +%\item Do you have a web server installed at all? Mac OS X ships with +% Apache, but many other systems may not have a web server installed. + \item ウェブサーバはすでにインストールされているか? Mac OS Xには標準で + Apacheがインストールされているが,他のシステムではウェブサーバが + インストールされていないこともある. +%\item If you have a web server installed, is it actually running? On +% most systems, even if one is present, it will be disabled by +% default. + \item ウェブサーバがインストールされている場合,すでに動作しているか? + 多くのシステムでは,デフォルトで停止されている. +%\item Is your server configured to allow you to run CGI programs in +% the directory where you plan to do so? Most servers default to +% explicitly disabling the ability to run CGI programs. + \item ウェブサーバはCGIプログラムを目的のディレクトリで動作できるように + 設定されているか? 大半のサーバではデフォルトでCGIプログラムの動 + 作を明示的に禁じている. \end{enumerate} -If you don't have a web server installed, and don't have substantial -experience configuring Apache, you should consider using the -\texttt{lighttpd} web server instead of Apache. Apache has a -well-deserved reputation for baroque and confusing configuration. -While \texttt{lighttpd} is less capable in some ways than Apache, most -of these capabilities are not relevant to serving Mercurial -repositories. And \texttt{lighttpd} is undeniably \emph{much} easier -to get started with than Apache. +%If you don't have a web server installed, and don't have substantial +%experience configuring Apache, you should consider using the +%\texttt{lighttpd} web server instead of Apache. Apache has a +%well-deserved reputation for baroque and confusing configuration. +%While \texttt{lighttpd} is less capable in some ways than Apache, most +%of these capabilities are not relevant to serving Mercurial +%repositories. And \texttt{lighttpd} is undeniably \emph{much} easier +%to get started with than Apache. + +ウェブサーバがインストールされていない場合や,Apachの設定に十分な経験がな +い場合は,Apacheではなく\texttt{lighttpd}ウェブサーバを検討した方がよいだ +ろう.Apacheは奇異で混乱する設定で悪名が高い. \texttt{lighttpd}はApache +よりもできることが少ないが,それらはMercurialリポジトリのサービスとは関係 +がない. \texttt{lighttpd}はApacheよりも明らかに簡単に使うことができる. %\subsection{Basic CGI configuration} \subsection{CGIの基本的な設定} -On Unix-like systems, it's common for users to have a subdirectory -named something like \dirname{public\_html} in their home directory, -from which they can serve up web pages. A file named \filename{foo} -in this directory will be accessible at a URL of the form -\texttt{http://www.example.com/\~username/foo}. +%On Unix-like systems, it's common for users to have a subdirectory +%named something like \dirname{public\_html} in their home directory, +%from which they can serve up web pages. A file named \filename{foo} +%in this directory will be accessible at a URL of the form +%\texttt{http://www.example.com/\~username/foo}. + +Unix系システムでは,ユーザのホームディレクトリにウェブページをサービスす +るための\dirname{public\_html}というサブディレクトリがあることが普通であ +る.このディレクトリ内の\filename{foo}というファイルは +\texttt{http://www.example.com/\~username/foo}というURLでアクセスできる. -To get started, find the \sfilename{hgweb.cgi} script that should be -present in your Mercurial installation. If you can't quickly find a -local copy on your system, simply download one from the master -Mercurial repository at -\url{http://www.selenic.com/repo/hg/raw-file/tip/hgweb.cgi}. +%To get started, find the \sfilename{hgweb.cgi} script that should be +%present in your Mercurial installation. If you can't quickly find a +%local copy on your system, simply download one from the master +%Mercurial repository at +%\url{http://www.selenic.com/repo/hg/raw-file/tip/hgweb.cgi}. -You'll need to copy this script into your \dirname{public\_html} -directory, and ensure that it's executable. +まずインストールされているMercurialから\sfilename{hgweb.cgi}スクリプトを +見つける.すぐにローカルコピーが見つからなければ,Mercurialのマスターリ +ポジトリ \url{http://www.selenic.com/repo/hg/raw-file/tip/hgweb.cgi} か +らダウンロードする. + +%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 .../hgweb.cgi ~/public_html chmod 755 ~/public_html/hgweb.cgi \end{codesample2} -The \texttt{755} argument to \command{chmod} is a little more general -than just making the script executable: it ensures that the script is -executable by anyone, and that ``group'' and ``other'' write -permissions are \emph{not} set. If you were to leave those write -permissions enabled, Apache's \texttt{suexec} subsystem would likely -refuse to execute the script. In fact, \texttt{suexec} also insists -that the \emph{directory} in which the script resides must not be -writable by others. +%The \texttt{755} argument to \command{chmod} is a little more general +%than just making the script executable: it ensures that the script is +%executable by anyone, and that ``group'' and ``other'' write +%permissions are \emph{not} set. If you were to leave those write +%permissions enabled, Apache's \texttt{suexec} subsystem would likely +%refuse to execute the script. In fact, \texttt{suexec} also insists +%that the \emph{directory} in which the script resides must not be +%writable by others. + +\command{chmod}コマンドへ\texttt{755}を渡すと,スクリプトは実行可能よりも +若干一般的になる.スクリプトは誰からも実行可能だが,``group''と``other'' +のユーザからは書き込めなくなる.書き込みパーミッションが有効である +と,Apacheの\texttt{suexec}サブシステムはスクリプトの実行を拒否する可能性 +が高い.実際のところ,\texttt{suexec}はさらにスクリプトの置かれている +\emph{ディレクトリ}が他のユーザの書き込みを拒否する設定であることを要求す +る. + \begin{codesample2} chmod 755 ~/public_html \end{codesample2} @@ -1298,44 +1347,71 @@ \subsubsection{どこが問題と成り得るか?} \label{sec:collab:wtf} -Once you've copied the CGI script into place, go into a web browser, -and try to open the URL \url{http://myhostname/~myuser/hgweb.cgi}, -\emph{but} brace yourself for instant failure. There's a high -probability that trying to visit this URL will fail, and there are -many possible reasons for this. In fact, you're likely to stumble -over almost every one of the possible errors below, so please read -carefully. The following are all of the problems I ran into on a -system running Fedora~7, with a fresh installation of Apache, and a -user account that I created specially to perform this exercise. +%Once you've copied the CGI script into place, go into a web browser, +%and try to open the URL \url{http://myhostname/~myuser/hgweb.cgi}, +%\emph{but} brace yourself for instant failure. There's a high +%probability that trying to visit this URL will fail, and there are +%many possible reasons for this. In fact, you're likely to stumble +%over almost every one of the possible errors below, so please read +%carefully. The following are all of the problems I ran into on a +%system running Fedora~7, with a fresh installation of Apache, and a +%user account that I created specially to perform this exercise. + +CGIスクリプトを所定の場所にコピーしたら,ウェブブラウザを起動して +\url{http://myhostname/~myuser/hgweb.cgi} を開く.しかしこのURLにアクセス +してもエラーがでる可能性が高いので,落ち着いて欲しい.エラーには多くの理 +由が考えられ,実際,そのすべてに引っ掛かっている可能性が高いので,以下の +記述を注意深く読んで欲しい.ここに挙げたのは,Fedora~7で,新規にインストー +ルされたApacheと,この例題のために新規に作成したユーザアカウントで筆者が +実際にで遭遇した問題である. -Your web server may have per-user directories disabled. If you're -using Apache, search your config file for a \texttt{UserDir} -directive. If there's none present, per-user directories will be -disabled. If one exists, but its value is \texttt{disabled}, then -per-user directories will be disabled. Otherwise, the string after -\texttt{UserDir} gives the name of the subdirectory that Apache will -look in under your home directory, for example \dirname{public\_html}. +%Your web server may have per-user directories disabled. If you're +%using Apache, search your config file for a \texttt{UserDir} +%directive. If there's none present, per-user directories will be +%disabled. If one exists, but its value is \texttt{disabled}, then +%per-user directories will be disabled. Otherwise, the string after +%\texttt{UserDir} gives the name of the subdirectory that Apache will +%look in under your home directory, for example \dirname{public\_html}. -Your file access permissions may be too restrictive. The web server -must be able to traverse your home directory and directories under -your \dirname{public\_html} directory, and read files under the latter -too. Here's a quick recipe to help you to make your permissions more -appropriate. +ウェブサーバはユーザ毎のディレクトリサービスを禁止されているかもしれない. +Apacheを使っている場合,設定ファイルの\texttt{UserDir}ディレクティブを +チェックする.もし存在しなければ,ユーザ毎のディレクトリサービスは禁止さ +れている.存在しても,値が\texttt{disabled}に設定されていれば,ユーザ毎の +ディレクトリサービスは禁止である.また,\texttt{UserDir}ディレクティブは +Apacheがサービス用に探すホームディレクトリ内のサブディレクトリを指定す +る.典型的な例は\dirname{public\_html}である. + +%Your file access permissions may be too restrictive. The web server +%must be able to traverse your home directory and directories under +%your \dirname{public\_html} directory, and read files under the latter +%too. Here's a quick recipe to help you to make your permissions more +%appropriate. +ファイルアクセスパーミッションがきつすぎる.ウェブサーバはホームディレク +トリと\dirname{public\_html}内のディレクトリを渡ってファイルを読めなけれ +ばならない.パーミッションを適切に設定するには例えば次のようにすればよい. \begin{codesample2} chmod 755 ~ find ~/public_html -type d -print0 | xargs -0r chmod 755 find ~/public_html -type f -print0 | xargs -0r chmod 644 \end{codesample2} -The other possibility with permissions is that you might get a -completely empty window when you try to load the script. In this -case, it's likely that your access permissions are \emph{too - permissive}. Apache's \texttt{suexec} subsystem won't execute a -script that's group-~or world-writable, for example. +%The other possibility with permissions is that you might get a +%completely empty window when you try to load the script. In this +%case, it's likely that your access permissions are \emph{too +% permissive}. Apache's \texttt{suexec} subsystem won't execute a +%script that's group-~or world-writable, for example. -Your web server may be configured to disallow execution of CGI -programs in your per-user web directory. Here's Apache's -default per-user configuration from my Fedora system. +パーミッションに関するその他の可能性として,スクリプトをロードしようとす +ると空のウィンドウが表示される問題がある.この場合は,パーミッション設定 +が\emph{緩すぎる}可能性が高い.例えばApacheの\texttt{suexec}サブシステム +は,グループや全世界から書き込みのできるスクリプトを実行しない. + +%Your web server may be configured to disallow execution of CGI +%programs in your per-user web directory. Here's Apache's +%default per-user configuration from my Fedora system. +ウェブサーバはCGIプログラムの実行を禁止するように設定されているかもしれ +ない.著者のFedoraシステムから,Apacheのユーザ毎のデフォルト設定を例とし +て示す. \begin{codesample2} AllowOverride FileInfo AuthConfig Limit @@ -1350,38 +1426,62 @@ \end{codesample2} -If you find a similar-looking \texttt{Directory} group in your Apache -configuration, the directive to look at inside it is \texttt{Options}. -Add \texttt{ExecCGI} to the end of this list if it's missing, and -restart the web server. +%If you find a similar-looking \texttt{Directory} group in your Apache +%configuration, the directive to look at inside it is \texttt{Options}. +%Add \texttt{ExecCGI} to the end of this list if it's missing, and +%restart the web server. -If you find that Apache serves you the text of the CGI script instead -of executing it, you may need to either uncomment (if already present) -or add a directive like this. +Apache設定の中に同様の\texttt{Directory}グループがある場合,その中で注目 +すべきディレクティブは\texttt{Options}である. \texttt{ExecCGI}がリストに +無ければ最後に追加し,ウェブサーバを再起動する. + +%If you find that Apache serves you the text of the CGI script instead +%of executing it, you may need to either uncomment (if already present) +%or add a directive like this. +ApacheがCGIスクリプトを実行するのではなく,スクリプト自体のテキストを送っ +てくる場合は,以下のディレクティブを追加するか,すでに存在してコメントア +ウトされていれば,アンコメントする. \begin{codesample2} AddHandler cgi-script .cgi \end{codesample2} -The next possibility is that you might be served with a colourful -Python backtrace claiming that it can't import a -\texttt{mercurial}-related module. This is actually progress! The -server is now capable of executing your CGI script. This error is -only likely to occur if you're running a private installation of -Mercurial, instead of a system-wide version. Remember that the web -server runs the CGI program without any of the environment variables -that you take for granted in an interactive session. If this error -happens to you, edit your copy of \sfilename{hgweb.cgi} and follow the -directions inside it to correctly set your \envar{PYTHONPATH} -environment variable. +%The next possibility is that you might be served with a colourful +%Python backtrace claiming that it can't import a +%\texttt{mercurial}-related module. This is actually progress! The +%server is now capable of executing your CGI script. This error is +%only likely to occur if you're running a private installation of +%Mercurial, instead of a system-wide version. Remember that the web +%server runs the CGI program without any of the environment variables +%that you take for granted in an interactive session. If this error +%happens to you, edit your copy of \sfilename{hgweb.cgi} and follow the +%directions inside it to correctly set your \envar{PYTHONPATH} +%environment variable. -Finally, you are \emph{certain} to by served with another colourful -Python backtrace: this one will complain that it can't find -\dirname{/path/to/repository}. Edit your \sfilename{hgweb.cgi} script -and replace the \dirname{/path/to/repository} string with the complete -path to the repository you want to serve up. +次の可能性は\texttt{mercurial}に関連したmoduleがインポートできないことを +警告するカラフルなPythonバックトレースが見えることだ.これは前進と言え +る.サーバはCGIスクリプトを実行できるようになった.このエラーはMercurial +をシステムワイドにインストールするのではなく,プライベートインストールし +た場合にのみ起きる.対話的なセッションとは異なり,ウェブサーバはCGIプログ +ラムを環境変数なしで起動する.このエラーが起きた場合は +\sfilename{hgweb.cgi}を編集し,環境変数\envar{PYTHONPATH}がセットされるよ +うにする. -At this point, when you try to reload the page, you should be -presented with a nice HTML view of your repository's history. Whew! +%Finally, you are \emph{certain} to by served with another colourful +%Python backtrace: this one will complain that it can't find +%\dirname{/path/to/repository}. Edit your \sfilename{hgweb.cgi} script +%and replace the \dirname{/path/to/repository} string with the complete +%path to the repository you want to serve up. + +今度は\emph{おそらく}カラフルなPythonのバックトレースが見えるはずだ.これ +は\dirname{/path/to/repository}が見つからないことを警告している. +\sfilename{hgweb.cgi}スクリプトを編集し,\dirname{/path/to/repository}と +いう文字列を,サービスしたいリポジトリへの完全なパスに置き換える. + +%At this point, when you try to reload the page, you should be +%presented with a nice HTML view of your repository's history. Whew! + +ここでページをリロードすると,リポジトリの履歴を表す美しいHTMLが見えるは +ずだ.やった! %\subsubsection{Configuring lighttpd} \subsubsection{lighttpdの設定} diff -r 3f9f9b087109 -r bc32663d557e ja/todo.txt --- a/ja/todo.txt Mon Dec 08 12:30:31 2008 +0900 +++ b/ja/todo.txt Mon Dec 08 18:19:04 2008 +0900 @@ -1,7 +1,7 @@ translate proofread 00book.tex 100% branch.tex 100% -collab.tex 50% +collab.tex 70% concepts.tex daily.tex 2% filenames.tex 100%