mDNkit のコンパイルおよびインストール方法について解説します。 ここではソースからのインストール方法について説明します。 バイナリパッケージの配布も予定されていますが、 それらのインストール方法に関してはそれぞれのパッケージを参照してください。
This document describes mDNkit compiling and installation procedures. Procedures for how to install from the source is described here. Distribution of binary packages is planned; refer to the instructions that accompany each package.
本ドキュメントでは Unix 用のコンパイルとインストール方法について 説明します。Windows 用の mDN Wrapper のインストール 方法に関しては mDN Wrapper のセットアップの 項をご覧ください。
This document describes the compiling and installing procedures for Unix. Refer to the section Setup in mDN Wrapper for information on procedures to install in Windows mDN Wrapper.
ソース配布からのインストール手順はおよそ次のようになります。
Installation procedure from source distribution is implemented as follows.
インストールの後は、DNS サーバの設定 および mDNkit リゾルバのコンフィギュレーション 、さらに dnsproxy を使用する場合には DNS Proxy Server のコンフィギュレーション を参照して設定を行ってください。
After installation, refer to and set up DNS server configuration, mDNkit resolver configuration, and if dnsproxy is to be used DNS Proxy Server configuration.
ソース配布に含まれているパッチを適用する場合には、 それぞれ次の手順にしたがってください。
To install the patch included in source distribution, refer to the following instructions.
mDNkit は EUC や SJIS など様々なローカルエンコーディングで記述された ドメイン名のエンコーディングを変換するために、汎用のコードセット変換 ユーティリティである iconv() を使用します。 そこで、FreeBSD など iconv() が標準で組み込まれていないシステムでは、 mDNkit のインストールに先立って iconv() をインストール しなければなりません。また、mDNkit は iconv() が UTF-8 エンコーディングをサポートしていることを要求します。システム付属の iconv() が UTF-8 をサポートしていない場合にはやはり 外部のパッケージをインストールする必要があります。
mDNkit uses iconv(), a general-purpose utility, to convert domain name encoding of EUC, SJIS or other local encoding. iconv() must be installed prior to mDNkit installation in those systems that do not have iconv() as a standard package, such as FreeBSD. Also, the mDNkit requires that iconv() should support UTF-8 encoding. An external package must be installed if the provided iconv() in the system does not support UTF-8.
iconv() のフリーな実装としては、例えば libiconv
There are free versions of iconv(), for example, libiconv.
があり、ソースを上記のページから入手することができます。 これは LGPL に基づいたフリーソフトウェアで、多くの Unix 系 OS の もとで動作します。このパッケージのインストール方法については、上記ページか、 あるいはソース配布に含まれる INSTALL.generic ファイルをご覧ください。
This source can be downloaded from the above page. This is an LGPL-based free software package that runs on a variety of Unix operating systems. Refer to the above page or the INSTALL.generic file that accompanies the source distribution for information on installation procedures.
mDNkit は bind9 に対するパッチを提供しており、これによって 多言語ドメイン名を扱うことのできる bind9 のリゾルバおよびサーバを 作成することができます。本キットに含まれるパッチは BIND 9.0.0 に 対するものです。ソースは以下の場所からダウンロードすることができます。
The mDNkit provides a bind9 patch that can be used to generate bind9 resolvers and servers that can support multilingual domain names. The patch in this kit is for BIND 9.0.0. The source can be downloaded from the following page.
dnsproxy を利用してクライアントアプリケーションが 多言語ドメイン名を使用できるようにするためには、 名前解決を行うリゾルバライブラリを 8bit スルーにする必要があります。 また DNS サーバでも、多言語ドメイン名のエンコーディングとして ASCII 互換エンコーディングである UTF-5 や RACE 以外の、 例えば UTF-8 などのエンコーディングを使用するためには、 8bit スルーの DNS サーバを使用する必要があります。
To use dnsproxy to enable client applications to support multilingual domain names, the resolver library that resolves names must be made 8-bit through. Also, 8-bit through DNS servers must be used to enable a DNS server to use encodings other than UTF-5, RACE or other ASCII compatible encoding (as multilingual domain name encoding), for example, UTF-8.
mDNkit にはこのために BIND 8.2.2-P7 および BIND 8.2.3-T6B を 8bit スルーにする パッチが含まれています。パッチを適用した bind8 を使用したい場合には あらかじめいずれかのバージョンのソースを用意してください。 ソースは以下の場所からダウンロードすることができます。
The mDNkit for that reason supplies a patch that makes BIND 8.2.2-P7 and BIND 8.2.3-T6B 8-bit through. To use bind8 with a patch installed, obtain the source of the desired version. Sources can be downloaded from the following page.
Web のキャッシュサーバである Squid は、そのままでは多言語 ドメイン名が入力されるとそれをエラーにしてしまい、使用することができません。 このためmDNkit には Squid-2.3.STABLE3 を 8bit スルーにするパッチが含まれています。Squid を多言語ドメイン名で使用 したい場合にはこのソースも用意してください。
Squid, a Web cache server, cannot be used as is, because it will generate an error when entering multilingual domain names. mDNkit comes with a patch that makes Squid-2.3.STABLE3 8-bit through. Obtain this source if you wish to make Squid support multilingual domain names.
mDNkit に関する最新情報は以下の場所から入手可能で、 最新の配布ソースのダウンロードもできます。
The latest information regarding the mDNkit is available on the following site. The most recent distribution source can also be downloaded from the following page.
入手した mDNkit の配布ソースを展開します。 配布ソースのファイル名を mdnkit-X.Y.tar.gzとすると 次のようにして展開できます。
Extracting the obtained mDNkit distribution source. Distribution sources with file names such as mdnkit-X.Y.tar.gz are extracted as shown below.
% gunzip mdnkit-X.Y.tar.gz % tar -xf mdnkit-X.Y.tar
展開すると、mdnkit-X.Yというディレクトリが作られますので、 そこに移動してください。
When extracted, a mdnkit-X.Y directory is generated. Move to this directory.
% cd mdnkit-X.Y
以降の説明では、このディレクトリを $MDNTOP という名前で 参照します。環境変数 $MDNTOP を設定しておくと便利でしょう。
In the following descriptions, this directory is referred to as $MDNTOP. Setting the environment variable $MDNTOP makes it easier to use.
% setenv MDNTOP `pwd` (csh 系のシェルの場合) % MDNTOP=`pwd`; export MDNTOP (sh 系のシェルの場合) % setenv MDNTOP `pwd` (for a csh system shell) % MDNTOP=`pwd`; export MDNTOP (for a sh system shell)
まず mDNkit の本体である、
First compile the following that form the major part of the mDNkit.
まず、mDNkit のトップディレクトリ ($MDNTOP の指すディレクトリ) に移動し、 configure スクリプトを実行します。 configure はヘッダファイルやライブラリの有無など、システム毎の 特徴を調べ、コンパイル環境を適切に設定するためのツールです。
First move to the mDNkit top directory (the directory that $MDNTOP points to) and execute the configure script. Configure is a tool that checks the header file and libraries to learn the features of the system to configure the optimum compiler environment.
% cd $MDNTOP % ./configure
システムに iconv() が組み込まれていて、かつコンパイル時に 特別なオプションを使用しないなら上記のようになにも引数を指定せずに 実行すればよいのですが、そうではない場合、オプションや環境変数で configure の動作を変えることができます。
When iconv() is included with the system and no special options are used during compilation, it can be executed like above without the need to specify any arguments. In other cases, operation of configure can be changed using options and environment variables.
configure に指定できるオプションの中で mDNkit に 直接関係するものは以下の通りです。
The following options that can be set by configure are directly related to mDNkit.
例えば前準備に挙げた
iconv のパッケージをインストールした場合、デフォルトでは
/usr/local/lib の libiconv にインストールされるので、
For example, when the iconv package mentioned in Preparations is installed, it is by default installed in libiconv of /usr/local/lib, so it is a good idea to make the following entry.
と指定すればよいでしょう。libiconv が共有ライブラリの時には、 -R オプションも指定して--with-iconv="-L/usr/local/lib -liconv"
--with-iconv="-L/usr/local/lib -R/usr/local/lib -liconv"
Like RACE and BRACE, LACE is another ASCII compatible encoding scheme and like, RACE, it adds a special prefix to distinguish it from ordinary ASCII domain names. In the current Internet Draft the prefix is "bq--", but this may change in the future; if it does, use this option to enter the correct prefix.
This option adds ZLD (Zero Level Domain) function support. ZLD is a special domain name used to differentiate standard ASCII domain names from multilingual domain names in some encodings used in a DNS server. This option need not be set unless ZLD is selected as the required encoding in a DNS protocol.
なお、ZLD 機能のサポートの有無は dnsproxy や runmdn が設定ファイルを読み込む際の振る舞い (ZLD の指定を無視するかどうか) に影響します。 mDNkit が提供するライブラリ自体は、(設定ファイルを読み込むための一部のモジュールを除いて)このオプションによって動作が変わることはなく、常に ZLD の処理を行うようになっています。
The support of the ZLD function affects operation (i.e. whether or not the ZLD setting is ignored) when configuration files are read in using the dnsproxy or runmdn command. The operation of the library provided by the mDNkit does not change with this option (except some modules used for reading in configuration files), but performs ZLD processing at all times.
Specifies the directory where dnsproxy, the DNS proxy server, is installed. /usr/local/sbin is the default directory.
この他にも configure にはいろいろなオプションを指定することができます。
A number of other options can be specified using configure.
% ./configure --help
で指定可能なオプションの一覧を表示させることができます。
The above is used to display a list of specifiable options.
また、関係する環境変数は次の通りです。
The related environment variables are as follows.
% setenv CFLAGS -I/usr/local/include
また sh 系のシェルの場合には
An sh shell requires the following configuration.
% CFLAGS=-I/usr/local/include; export CFLAGS
とします。
CFLAGS はこの他にも C コンパイラの最適化オプションを指定するためにも使えます。CFLAGS に -O を指定すれば最適化ありでコンパイルされます。
CFLAGS can be used in other situations to specify the optimum C compiler options. When -O is specified in CFLAGS compilation is optimized.
configure を実行することにより、あなたのシステム環境に合わせて調整された Makefile その他のファイルが生成されます。
When configure is executed, Makefile and other files are generated and adapted to your system environment.
configure 実行によって、システム環境に合った Makefile が生成されているので、コンパイルはトップディレクトリ($MDNTOP の指すディレクトリ) でmake コマンドを実行するだけです。
Since configure generates a Makefile tailored to the system environment, all that compile needs to do is to execute the make command in the top directory (the directory pointing to $MDNTOP).
% make
コンパイルが終了したら、実行ファイルなどのインストールを行います。 インストールの前にスーパーユーザになってください。
When compiling is finished, install the executable files and other files. Become a superuser prior to installation.
% su
あとは make install を実行すれば、必要なファイルがシステムにインストールされます。
Then execute make install to install all the required files in the system.
# make install
インストールされるファイルは以下の通りです。
The following files will be installed.
dnsproxy は、デフォルトでは /usr/local/sbinにインストールされます。 インストール先を変えるにはconfigure の --sysconfdirオプションを使用します。
dnsproxy is installed in /usr/local/sbin by default. If you wish to change the installation location, use the configure --sysconfdir option.
mdnconv および runmdn は、デフォルトでは /usr/local/bin にインストールされます。 インストール先を変えるには configure の --bindirオプションを使用します。
mdnconv and runmdn are installed in /usr/local/bin by default. If you wish to change the installation location, use the --bindir option.
デフォルトでは /usr/local/man/man8 (dnsproxy.8)、/usr/local/man/man1 (mdnconv.1、runmdn.1)、/usr/local/man/man5 (mdnres.conf.5)にそれぞれインストールされます。
These manuals are by default installed in /usr/local/man/man8 (dnsproxy.8), /usr/local/man/man1 (mdnconv.1, runmdn.1) and /usr/local/man/man5 (mdnres.conf.5), respectively.
インストール先を変えるには、configure の --mandir オプションを使用します。
To change the location of installation, use the --mandir option of configure.
Configuration files
このファイルの設定方法に関しては DNS Proxy Server のコンフィギュレーションを参照してください。
このファイルの設定方法に関してはmDNkit リゾルバのコンフィギュレーションを参照してください。
いずれもデフォルトでは /usr/local/etc にインストールされます。 インストール先を変えるには、configure の--sysconfdir オプションを使用します。
Both files are by default installed in /usr/local/etc. To change the installation location, use the --sysconfdir option.
A basic mDNkit library that employs dnsproxy, mdnconv and other commands.
いずれのライブラリもデフォルトでは /usr/local/lib にインストールされます。 インストール先を変えるにはconfigure の --libdirオプションを使用します。
Both libraries are by default installed in /usr/local/lib. To change the installation location, use configure with the --libdir option.
展開したソースの中の$MDNTOP/patch/bind9/bind-9.0.0-patch がBIND 9.0.0 に多言語ドメイン名の処理機能を付加するパッチです。 パッチの当て方はこのファイルの先頭にも書いてありますが、簡単に紹介すると、次のようになります。
$MDNTOP/patch/bind9/bind-9.0.0-patch in extracted source is the patch that adds multilingual domain name processing functionality to BIND 9.0.0. Information on how to apply the patch is appended to the beginning of the file, but the following is a brief description.
Move to the BIND 9.0.0 source top directory (the directory that contains the README file).
% cd /somewhere/.../bind-9.0.0
Use the patch command to apply the patch to the source.
% patch -p0 < $MDNTOP/patch/bind9/bind-9.0.0-patch
パッチを当てると、トップディレクトリに README.mdnkit というファイルが作られます。コンパイルの前にこのファイルを読んでください。
When the patch is applied a README.mdnkit file is created in the top directory. Read this file before compilation.
そのあとコンパイルとインストールを行います。方法は README.mdnkit に書かれています。このファイルにも書かれていますが、configure コマンドの実行時に--with-mdn オプションをつけることを忘れないでください。 このオプションをつけないと多言語ドメイン名の処理機能は付加されません。
After this perform compilation and installation. Refer to README.mdnkit for instructions. As stated in this file, be sure to add the --with-mdn option when executing the configure command. Unless this option is added, capability to process multilingual domain names will not be added.
% ./configure --with-mdn
bind9 用のパッチは mDNkit の本体 (特にライブラリとヘッダファイル) がすでにインストールされていることを前提としています。したがって、この作業はmDNkit 本体のインストール終了後に実行してください。
The bind9 patch assumes that the major portion of the mDNkit (especially, the library and header file) is already installed. Consequently, this operation should be performed after the mDNkit has been installed.
展開したソースの中の$MDNTOP/patch/bind8/bind-8.2.2-P7-patch がBIND 8.2.2-P7 に対する 8ビットスルーパッチ、また$MDNTOP/patch/bind8/bind-8.2.3-T6B-patch がBIND 8.2.3-T6B に対する 8ビットスルーパッチです。 パッチの当て方はこれらのファイルの先頭にも書いてありますが、簡単に紹介すると、次のようになります。
The $MDNTOP/patch/bind8/bind-8.2.2-P7-patch in the extracted source is the 8-bit through patch for BIND 8.2.2-P7 and the $MDNTOP/patch/bind8/bind-8.2.3-T6B-patch is the 8-bit through patch for BIND 8.2.3-T6B. Information on how to apply the patch is appended to the beginning of the file, but the following is a brief description.
Move to the top directory of the BIND 8.2.2-P7 or BIND 8.2.3-T6B source (the directory containing the src subdirectory).
% cd /somewhere/.../bind-8.2.2-P7
Use the patch command to apply the patch to the source.
% patch -p0 < $MDNTOP/patch/bind8/bind-8.2.2-P7-patch
パッチを当てたら、あとは通常の BIND のインストール方法にしたがってコンパイルとインストールを行ってください。インストール方法は BIND のソース中の src/INSTALL に書かれています。
When the patch has been applied, perform compilation and installation according to the standard BIND installation procedure. Refer to src/INSTALL for installation instructions.
bind8 用のパッチは BIND を単に 8ビットスルーにするだけで、mDNkit のライブラリ等は使用しません。したがって mDNkit 本体とは独立にコンパイルおよびインストールすることができます。
The bind8 patch only makes BIND 8-bit through and does not use the mDNkit library. Thus it can be compiled and installed separately from the mDNkit.
展開したソースの中の $MDNTOP/patch/squid/squid-2.3.STABLE3-patch がSquid 2.3.STABLE3 に対する 8ビットスルーパッチです。 パッチの当て方はこのファイルの先頭にも書いてありますが、簡単に紹介すると、次のようになります。
The $MDNTOP/patch/squid/squid-2.3.STABLE3-patch in the extracted source is the 8-bit through patch for Squid 2.3.STABLE3. Information on how to apply the patch is appended to the beginning of the file, but the following is a brief description.
Move to the top directory of Squid 2.3.STABLE3 source (the directory containing the README file).
% cd /somewhere/.../squid-2.3.STABLE3
Use the patch command to apply the patch to the source.
% patch -p1 < $MDNTOP/patch/squid/squid-2.3.STABLE3-patch
パッチを当てたら、あとは通常の Squid のインストール方法にしたがってコンパイルとインストールを行ってください。インストール方法はSquid のソースに含まれる INSTALL ファイルに書かれています。
When the patch has been applied, perform compilation and installation according to the standard Squid install procedure. Refer to INSTALL in the Squid source for installation instructions.
Squid 用のパッチも bind8 用のパッチと同様単に 8ビットスルーにするだけで、mDNkit のライブラリ等は使用しません。 したがって mDNkit 本体とは独立にコンパイルおよびインストールすることができます。
Both the Squid and the bind8 patches only add 8-bit through capability and does not use any mDNkit library or other function. Thus they can be compiled and installed independently from the mDNkit.