Virtual Services Howto <author>Brian Ackerman, <tt/brian@nycrc.net/ <date>v1.2, 4 November 1997 <trans>伊佐治 哲, <tt/isaji@mxu.meshnet.or.jp/ <tdate>23 Dec 1997 <abstract> <!-- This document came about to satisfy the ever increasing need to know how to virtualize a service. --> このドキュメントはサービスの仮想化の方法についてますます増えてきた要求 に応じて書かれました。 <!-- 原作者のメールから --> (訳者:訳文に関する質問は<em/必ず/伊佐治まで お願いいたします。またこのHOWTO本体(英語)の最新版は <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/" name="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/"> から入手できます)。 </abstract> <!-- Table of contents --> <toc> <!-- Beginning --> <sect>イントロダクション <!-- 1. Introduction --> <p> <sect1>必要な知識 <!-- 1.1. Knowledge Required --> <p> <!-- Creating a virtual services machine is not all that difficult. However, more than fundamental knowledge is required. And this document is not a primer to how to fully configure a Linux machine. --> 仮想サービスの設定はそんなに難しいものではありません。しかし基礎的な 事柄に加えてそれ以上の知識も必要とされます。このドキュメントではLinuxマシン の設定の仕方については取り扱いません。 <p> <!-- In order to understand this HOWTO document it is assumed that you are thoroughly familiar with the following: --> このドキュメントを理解するには以下述べるドキュメントの内容にちゃんと 慣れ親しんでいるものと仮定します。 <itemize> <item> LinuxカーネルのコンパイルとIP aliasingサポートの追加 <!-- Compiling a Linux kernel and adding IP aliasing support --> <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/mini/IP-Alias" name="IP alias mini-HOWTO"> <item> ネットワークデバイスのセットアップと設定 <!-- Setting up and configuring of network devices --> <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/NET-3-HOWTO.html" name="NET-3 HOWTO"> <item> inetdの設定 <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/NET-3-HOWTO.html" name="NET-3 HOWTO"> <item> ネットワークパッケージのコンパイルとインストール <!-- Compiling and installing various network packages like --> <htmlurl url="http://www.sendmail.org" name=" Sendmail Site "> <htmlurl url="http://www.apache.org" name=" Apache Site "> <htmlurl url="http://www.cetis.hvu.nl/~koos/wu-ftpd-faq.html" name=" Wu-Ftpd FAQ"> <item> DNSの設定 <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/DNS-HOWTO.html" name="DNS HOWTO"> </itemize> <!-- If you are uncertain of how to proceed with any of the above it is STRONGLY recommended that you use the links provided to familiarize yourself with all packages. I will NOT reply to any mail reguarding any of the above. Please direct any questions to the appropriate author of the HOWTO. --> もし上に述べた事柄についてまだ理解していなければ、これらのパッケージに 慣れるように上に指示されたリンクを使いそのドキュメント等を読まれること を強くお奨めます。これらのドキュメント内容についてメールを送っていただい ても返事は出しません。HOWTOの該当する著者に直接聞いて下さい。 <sect1>目的 <!-- 1.2. Purpose --> <p> <!-- The purpose of virtual services is to allow a single machine to recognize multiple IP addresses without multiple network cards. IP aliasing is a kernel option that allows you to assign each network device more than one IP address. The kernel then multiplexes (swaps between them very fast) in the background and to the user it appears like you have more than one network card. --> 仮想サービスの目的は複数のネットワークカードを使わないで複数のIPアドレスを 単体マシンに認識させるというものです。IPエイリアスはカーネルオプションで、 このオプションは各ネットワークデバイスに一つ以上のIPアドレスを割り当てるよう にするためのです。 カーネルはバックグランドで各IPアドレスを高速にスワップすることにより多重送信 (multiplexes)を行います。ユーザーにとってはひとつ以上のネットワークカードがあ るかのように見えるわけです。 <p> <!-- This multiplexing allows multiple domains (www.domain1.com, www.domain2.com, etc.) to be hosted by the same machine for the same cost as hosting one domain. Unfortunately, most services (ftp, web, mail) were not designed to handle muliple domains. In order to make them work properly you must modify both configuration files and source code. This document describes how to make these modifications in the setting up of a virtual machine. --> この多重送信(multiplexing)によって<tt/www.domain1.com, www.domain2.com/などと いった複数のドメインをひとつのドメイン程度のコストで運営できます。 残念なことに多くのサービス(ftp, web, mail)はそのままではこの複数のドメイン で使えません。それらを適切に動作させるためには、設定ファイルとソースコードを 修正しなくてはなりません。このドキュメントは仮想マシンのセッティングにおいて その修正をどのように行うか解説しています。 <p> <!-- A deamon is also required in order to make virtual services function. The source for this daemon (virtuald) is provided later in this document. --> デーモンも同様に仮想サービスの機能を提供するために必要です。 今回使うデーモン(virtuald)のソースは、この後ドキュメント中に出てきます。 <sect1>フィードバック <!-- 1.3. Feedback --> <p> <!-- This document will expand as packages are updated and source or configuration modifications change. If there are any portions of this document that are unclear please feel free to email me with your suggestions or questions. So that I do not have to go searching through the entire HOWTO please make certain that all comments are as specific as possible and include the section where the uncertainty lies. It is important that all mail be addressed with VIRTSERVICES HOWTO in the subject line. Any other mail will be considered personal and all my friends know that I do not ever read my personal mail so it will probably get discarded with theirs. --> パッケージがアップデートされたり設定の変更があった時に、このドキュメントを 拡張します。このドキュメントで、はっきりしないなどの不具合がありましたらその 提案や質問などをメールに書いて送って下さい。またコメントはできるだけはっきり と、どこの章がわかりにくいかを明記して下さい。その結果著者がHOWTO全文に目を 通さずにすみます。サブジェクトには<tt/VIRTSERVICES HOWTO/と書いて送っていた だくことも大切です。その他のメールは個人用となります。個人用メールを読まず せっかく送ったメールも処分してしまうかもしれないので十分注意して下さい。 <!-- 著者の知合いは、私が個人用メールを読まずせっかく送ったメールが処分されてしま うかもしれないということを知っています。 --> <p> <!-- Please note that my examples are just that, examples and should not be copied verbatim. You may have to insert your own values. If you are having trouble, send me mail, with all the pertinent configuration files and the error messages you get when installing, and I will look them over and mail my suggestions back. --> このドキュメントで著者が提示した例はほんの一例にすぎないので、そのままコピー して使わないで下さい。読者各自が自分の環境にあうように書き換えておいて下さい。 もし何か問題がありましたら著者までメールを送って下さい。その際メールには ちゃんと設定ファイル、エラーメッセージを書いてくだされば、ちゃんと目を通して その解決などの提案をメールで返事します。 <sect1> 改訂履歴 <!-- Revision History --> <p> <!-- V1.0 Initial version --> V1.0 初期バージョン <p> <!-- V1.1 Fixed error in Virtual Web Section --> V1.1 Virtual Web Sectionのエラー更新 <p> <!-- V1.2 Fixed the date --> V1.2 日付の更新 <sect1> 著作権、配布条件(Copyright/Distribution) <p> This document is Copyright (c) 1997 by The Computer Resource Center Inc. <p> A verbatim copy may be reproduced or distributed in any medium physical or electronic without permission of the author. Translations are similiarly permitted without express permission if it includes a notice on who translated it. Commercial redistribution is allowed and encouraged; however please notify <htmlurl url="mailto:brian@nycrc.net" name="Computer Resource Center"> of any such distributions. <p> Excerpts from the document may be used without prior consent provided that the derivative work contains the verbatim copy or a pointer to a verbatim copy. <p> Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies. <p> In short, we wish to promote dissemination of this information through as many channels as possible. However, I do wish to retain copyright on this HOWTO document, and would like to be notified of any plans to redistribute this HOWTO. <p> <hrule> (和訳文を付けておきますが、正式な著作権は英語の原文に従います) <p> 著者の承認をとらずに原文のコピーをして物理的/電子的媒体で改変/配布 してもかまいません。翻訳も同様に特別な許可はいりませんが、その場合は 誰が翻訳したのか必ず明記して下さい。商用的な再配布は認めます。また推 奨します。しかしそのような配布をする時も <htmlurl url="mailto:brian@nycrc.net" name="Computer Resource Center">に まで届け出て下さい。 <p> 本文からの引用は事前の同意(原文引用や原文へのポインタを含んだ内容を 提供する際の同意)なしで使っていただいてかまいません。 <p> ドキュメントの原文コピーを改変/配布する際は、著作権の表示やこの許可条項が 文書に含まれている限り可能です。 <p> できるだけ多くの分野でこの情報が普及すること希望します。しかしドキュメント の著作権は保護されますし再配布する場合は届け出て下さい。 <sect>IPエイリアス <!-- 2. IP aliasing --> <p> <!-- IP aliasing is a kernel option that needs to be set up in order to run a virtual hosting machine. There is already a mini-HOWTO on <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/mini/IP-Alias" name="IP aliasing">. Consult that for any questions on how to set it up. --> IPエイリアス(IP aliasing)は仮想ホストマシンを稼働するために設定する カーネルオプションのことです。mini-HOWTOがすでにあるのでこちらを参照 してください (<htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/mini/IP-Alias" name="IP aliasing">)。設定方法の質問などが扱われています。 (<em/訳注:/具体的なエイリアスの設定。カーネルオプションでエイリアス オプションを選択してカーネルの再構築をします。その後rootで <verb> ifconfig eth0:0 (追加するIP) route add -host (追加するIP) dev eth0:0 </verb> とします。詳しくは「NET-2/3-HOWTO」の13.11.2.1を参照して下さい)。 <sect>バーチャルデーモン(virtuald) <!-- 3. virtuald --> <sect1>どのような動作をするか <!-- 3.1. how it works --> <p> <!-- every network connection is made up of two ip address/port pairs. the api (applications program interface) for network programming is called the sockets api. the socket acts like an open file and by reading/writing to it you can send data over a network connection. there is a function call <tt> getsockname </tt> that will return the ip address of the local socket. virtuald uses <tt> getsockname </tt> to determine which ip on the local machine is being accessed. virtuald reads a config file to retrieve the directory associated with that ip. it will <tt> chroot </tt> to that directory and hand the connection off to the service. <tt> chroot </tt> resets / or the root directory to a new point so everything higher in the directory tree is cut off from the running program. therefore, each ip address gets their own virtual filesystem. to the network program this is transparent and the program will behave like nothing happened. virtuald in conjunction with a program like inetd can then be used to virtualize any service. --> ネットワーク接続は&dquot;IPアドレス&dquot;と&dquot;ポート番号&dquot;のペア からなっています。ネットワークプログラミングのAPI(Applications Program Interface)は<tt/sockets api/と呼ばれます。ソケットは開いたファイルのように 振舞い、これに対する読み書きをすることでネットワーク経由でデータをやりとり ができます。 ローカルソケットのIPアドレスを返すファンクションコール<tt>getsockname</tt> があります。 virtualdは<tt>getsockname</tt>(訳注:<tt>/lib/libc.so</tt>)を、 どのローカルマシンのIPがアクセスされているかを決めるのに用います。 Virtualdは設定ファイルを読み込み、そのIPに対応するディレクトリを取得します。 そのディレクトリに <tt>chroot</tt>した後、実際に行われるサービスに接続を 引き渡します。 <tt> chroot </tt> はルートディレクトリ'/' を別のディレクトリにセット し直し、そのディレクトリ(新しいルートディレクトリ)よりも上にある全てのもの は実行されているプログラムからは見えません(切り離されます)。 <!-- (訳注:<tt> chroot </tt> はmini-HOWTO「Diskless」でも取り扱っています)。 --> こうして各IPアドレスはそれぞれの仮想ファイルシステムを取得します。 これはネットワークプログラムからは透過的なので(上に書いたような操作は 隠してあるので)、プログラムは何事もなかったかのように動作します。 このようにして、inetdといったプログラムと連結されたVirtuald はいろいろなサービスを仮想化して使うことができるのです。 <sect1> inetd <p> <!-- Inetd is a network super server that listens at multiple ports and when it receives a connection (for example, an incoming pop request), inetd performs the network negotiation and hands the network connection off to the specified program. This prevents servers from running idly when they are not needed. --> Inetdは複数のポートを監視し、接続があった場合に(例えばpop要求があったとき などに)ネットワークネゴシエーション行って指定されたプログラムに接続を 引き渡すスーパーサーバです。 これにより、必要がなくて何もしていないサーバがないようにします。 <p> <!-- A standard /etc/inetd.conf file looks like this: --> 標準的な <tt>/etc/inetd.conf</tt>ファイルは <verb> ftp stream tcp nowait root /usr/sbin/tcpd wu.ftpd -l -a pop-3 stream tcp nowait root /usr/sbin/tcpd in.qpop -s </verb> となります。(<em/訳注:/pop-3はpop3の場合はpop3にして下さい)。 <!-- A virtual /etc/inetd.conf file looks like this: --> また仮想的な<tt>/etc/inetd.conf</tt>ファイルは <verb> ftp stream tcp nowait root /usr/bin/virtuald virtuald /virtual/conf.ftp wu.ftpd -l -a pop-3 stream tcp nowait root /usr/bin/virtuald virtuald /virtual/conf.pop in.qpop -s </verb> となります。 <sect1> virtual.conf <p> <!-- Each service gets a conf file that will control what IPs and directories are allowed for that service. You can have one master conf file or several conf files if you want each service to get a different list of domains. A virtual.conf file looks like this: --> それぞれのサービスに対応するIPとディレクトリをコントロールする confファイルを取得します。一つのマスターconfファイルがあり、また ドメインの異なるリストのサービスが必要なときはそれに応じたconfファイル を用意することができます。virtual.confは以下のような内容です。 <verb> # This is a comment and so are blank lines # Format IP <SPACE> dir <NOSPACES> 10.10.10.129 /virtual/foo.bar.com 10.10.10.130 /virtual/bar.foo.com 10.10.10.157 /virtual/boo.la.com </verb> (<em/訳注:/実際の中身は各設定環境に合わせて書き換えて下さい。 そしてこのファイルは(上のinitd.confの設定に合わせた)該当ディレクトリ およびファイル名にコピーします)。 <sect1> virtualdのソース <!-- The source (virtuald) --> <p> (<em/訳注:/このVirtualdのソースは <tt/gcc -o viturald virtuald.c/として コンパイルできます。また後の文章と合わせるために<tt>/usr/bin</tt>に コピーします) <code> #include <netinet/in.h> #include <sys/socket.h> #include <arpa/inet.h> #include <stdarg.h> #include <string.h> #include <syslog.h> #include <stdio.h> #define BUFSIZE 8192 main(int argc,char **argv) { char buffer[BUFSIZE]; char *ipaddr,*dir; logit("Virtuald Starting: $Revision: 1.2 $"); if (!argv[1]) { logit("invalid arguments: no conf file"); quitting_virtuald(0); } if (!argv[2]) { logit("invalid arguments: no program to run"); quitting_virtuald(0); } if (getipaddr(&ipaddr)) { logit("getipaddr failed"); quitting_virtuald(0); } sprintf(buffer,"Incoming ip: %s",ipaddr); logit(buffer); if (iptodir(&dir,ipaddr,argv[1])) { logit("iptodir failed"); quitting_virtuald(0); } if (chroot(dir)<0) { logit("chroot failed: %m"); quitting_virtuald(0); } sprintf(buffer,"Chroot dir: %s",dir); logit(buffer); if (chdir("/")<0) { logit("chdir failed: %m"); quitting_virtuald(0); } if (execvp(argv[2],argv+2)<0) { logit("execvp failed: %m"); quitting_virtuald(0); } } int logit(char *buf) { openlog("virtuald",LOG_PID,LOG_DAEMON); syslog(LOG_ERR,buf); closelog(); return 0; } int quitting_virtuald(int retval) { exit(retval); return 0; } int getipaddr(char **ipaddr) { struct sockaddr_in virtual_addr; static char ipaddrbuf[BUFSIZE]; int virtual_len; char *ipptr; virtual_len=sizeof(virtual_addr); if (getsockname(0,(struct sockaddr *)&virtual_addr,&virtual_len)<0) { logit("getipaddr: getsockname failed: %m"); return -1; } if (!(ipptr=inet_ntoa(virtual_addr.sin_addr))) { logit("getipaddr: inet_ntoa failed: %m"); return -1; } strncpy(ipaddrbuf,ipptr,sizeof(ipaddrbuf)-1); *ipaddr=ipaddrbuf; return 0; } int iptodir(char **dir,char *ipaddr,char *filename) { char buffer[BUFSIZE],*bufptr; static char dirbuf[BUFSIZE]; FILE *fp; if (!(fp=fopen(filename,"r"))) { logit("iptodir: fopen failed: %m"); return -1; } *dir=NULL; while(fgets(buffer,BUFSIZE,fp)) { buffer[strlen(buffer)-1]=0; if (*buffer=='#' || *buffer==0) continue; if (!(bufptr=strchr(buffer,' '))) { logit("iptodir: strchr failed"); return -1; } *bufptr++=0; if (!strcmp(buffer,ipaddr)) { strncpy(dirbuf,bufptr,sizeof(dirbuf)-1); *dir=dirbuf; break; } } if (fclose(fp)==EOF) { logit("iptodir: fclose failed: %m"); return -1; } if (!*dir) { logit("iptodir: ip not found in conf file"); return -1; } return 0; } </code> <sect> 仮想スクリプト(Virt scripts) <!-- Virt scripts --> <sect1> virtfs <p> <!-- Each domain should get their own directory structure. Since you are using <tt> chroot </tt> you will require duplicate copies of the shared libraries, binaries, conf files, etc. I use /virtual/domain.com for each domain that I create. I realize that you are taking up more disk space but it is cheaper than a whole new machine and network cards. If you really want to preserve space you can link the files together so only one copy of each binary exists. --> 各ドメインはそれぞれのディレクトリ構造を持っています。<tt> chroot </tt>を 使っているのでシェアライブラリ(shared libraries), バイナリ, conf ファイル等 の 重複したコピーが必要になります。著者は各ドメイン用の <tt>/virtual/domain.com</tt>を作り、それぞれにコピーして使っています。 そのため多くのディスクスペースを使いますが新しいマシンやネットワークカード を購入するよりは安価でしょう。もしディスクスペースを節約したいのなら それぞれのファイルをリンクすれば間に合います (訳注:このリンクはシンボリックリンクではありません)。 <p> <!-- Here is a sample virtfs script: --> ここでvirtfsスクリプトの例をあげます。 <code> #!/bin/bash echo '$Revision: 1.2 $' echo -n "Enter the domain name: " read domain if [ "$domain" = "" ] then echo Nothing entered: aborting exit 0 fi leadingdir=/virtual echo -n "Enter leading dir: (Enter for default: $leadingdir): " read ans if [ "$ans" != "" ] then leadingdir=$ans fi newdir=$leadingdir/$domain if [ -d "$newdir" ] then echo New directory: $newdir: ALREADY exists exit 0 else echo New directory: $newdir fi echo Create $newdir mkdir -p $newdir echo Create bin cp -pdR /bin $newdir echo Create dev cp -pdR /dev $newdir echo Create dev/log ln -f /virtual/log $newdir/dev/log echo Create etc mkdir -p $newdir/etc for i in /etc/* do if [ -d "$i" ] then continue fi cp -pd $i $newdir/etc done echo Create etc/skel mkdir -p $newdir/etc/skel echo Create home for i in a b c d e f g h i j k l m n o p q r s t u v w x y z # (訳注:ここの[a-z]はそれぞれ設定するユーザー名に変更します) do mkdir -p $newdir/home/$i done echo Create home/c/crc mkdir -p $newdir/home/c/crc chown crc.users $newdir/home/c/crc # (訳注:ここも設定したユーザーに合わせて変更して下さい) echo Create lib mkdir -p $newdir/lib for i in /lib/* do if [ -d "$i" ] then continue fi cp -pd $i $newdir/lib done echo Create proc mkdir -p $newdir/proc echo Create sbin cp -pdR /sbin $newdir echo Create tmp mkdir -p -m 0777 $newdir/tmp chmod +t $newdir/tmp echo Create usr mkdir -p $newdir/usr echo Create usr/bin cp -pdR /usr/bin $newdir/usr echo Create usr/lib mkdir -p $newdir/usr/lib echo Create usr/lib/locale cp -pdR /usr/lib/locale $newdir/usr/lib # (訳注:ここのディレクトリ適当に変更します) echo Create usr/lib/terminfo cp -pdR /usr/lib/terminfo $newdir/usr/lib echo Create usr/lib/zoneinfo cp -pdR /usr/lib/zoneinfo $newdir/usr/lib echo Create usr/lib/\*.so\* cp -pdR /usr/lib/*.so* $newdir/usr/lib echo Create usr/sbin cp -pdR /usr/sbin $newdir/usr echo Linking usr/tmp ln -s /tmp $newdir/usr/tmp echo Create var mkdir -p $newdir/var echo Create var/lock cp -pdR /var/lock $newdir/var echo Create var/log mkdir -p $newdir/var/log echo Create var/log/wtmp cp /dev/null $newdir/var/log/wtmp echo Create var/run cp -pdR /var/run $newdir/var echo Create var/run/utmp cp /dev/null $newdir/var/run/utmp echo Create var/spool cp -pdR /var/spool $newdir/var echo Linking var/tmp ln -s /tmp $newdir/var/tmp echo Create var/www/html mkdir -p $newdir/var/www/html chown webmast.www $newdir/var/www/html # (訳注:ここのchownも適当に変更しておいて下さい。以下同様) chmod g+s $newdir/var/www/html echo Create var/www/master mkdir -p $newdir/var/www/master chown webmast.www $newdir/var/www/master echo Create var/www/server mkdir -p $newdir/var/www/server chown webmast.www $newdir/var/www/server exit 0 </code> <sect1> virtexec <p> <!-- To execute commands in a virtual environment you have to <tt> chroot </tt> to that directory and then run the command. I have written a special shell script called virtexec that handles this for any command: --> 仮想環境でコマンドを実行するにはそのディレクトリへ<tt> chroot </tt>してから 実行します。ここでコマンドを操作するvirtexecを呼び出すシェル スクリプトを書きました。 (訳注:以下のコードを切り取って<tt>/usr/bin</tt>ディレクトリにコピー します。属性の変更(<tt/chmod +x/)をしておいて下さい)。 <code> #!/bin/sh echo '$Revision: 1.2 $' BNAME=`basename $0` FIRST4CHAR=`echo $BNAME | cut -c1-4` REALBNAME=`echo $BNAME | cut -c5-` if [ "$BNAME" = "virtexec" ] then echo Cannot run virtexec directly: NEED a symlink exit 0 fi if [ "$FIRST4CHAR" != "virt" ] then echo Symlink not a virt function exit 0 fi list="" num=1 for i in /virtual/* do if [ ! -d "$i" ] then continue fi if [ "$i" = "/virtual/lost+found" ] then continue fi list="$list $i $num" num=`expr $num + 1` done if [ "$list" = "" ] then echo No virtual environments exist exit 0 fi dialog --clear --title 'Virtexec' --menu Pick 20 70 12 $list 2> /tmp/menu.$$ if [ "$?" = "0" ] then newdir=`cat /tmp/menu.$$` else newdir="" fi tput clear rm -f /tmp/menu.$$ echo '$Revision: 1.2 $' if [ ! -d "$newdir" ] then echo New directory: $newdir: NOT EXIST exit 0 else echo New directory: $newdir fi echo bname: $BNAME echo realbname: $REALBNAME if [ "$*" = "" ] then echo args: none else echo args: $* fi echo Changing to $newdir cd $newdir echo Running program $REALBNAME chroot $newdir $REALBNAME $* exit 0 </code> <!-- Please note that you must have the <tt> dialog </tt> program installed on your system for this to work. To use virtexec just symlink a program to it. For example, --> これを実行するには各自のシステムに<tt> dialog </tt>プログラムがインストール されている必要があります。注意してください。 (<em/訳注:/dialog = シェルスクリプトからダイアログボックスを開く コマンドです。ほとんどのシステムではインストールされています)。 virtexecを使うためにシンボリックリンクをはります。例えば、 <verb> ln -s /usr/bin/virtexec /usr/bin/virtpasswd ln -s /usr/bin/virtexec /usr/bin/virtvi ln -s /usr/bin/virtexec /usr/bin/virtpico ln -s /usr/bin/virtexec /usr/bin/virtemacs ln -s /usr/bin/virtexec /usr/bin/virtmailq </verb> <!-- Then if you type virtvi or virtpasswd or virtmailq it will allow you to vi a program, change a user's password or check the mail queue on your virtual system. You can create as many virtexec symlinks as you want. However, note that if your program requires a shared library it has to be in the virtual filesystem. The binary has to exist on the virtual filesystem also. --> ここで<tt/virtvi、virtpasswd、virtmailq/等と入力すればそれぞれviが起動した り、ユーザーのパスワードが変更できたり、仮想システム上のメールキューを チェックできたりします。必要に応じてもっと多くリンクをはることもできます。 しかしプログラムがシェアライブラリ(shared library)を必要とするときは 仮想ファイルシステム上になければなりません。バイナリファイルも同様に 仮想ファイルシステム上になければなりません。 <sect1> virtfsとvirtexecに関する注意 <!-- Notes on virtfs and virtexec --> <p> <!-- I install all the scripts in /usr/bin. Anything that I do not want to put on the virtual filesystem I put in /usr/local. The script does not touch anything in there for copying. Any files that are important to not cross virtual filesystems should be removed. For example, ssh is installed on my system and I did not want the private key for the server available on all the virtual filesystems so I remove it from each virtual filesystem after I run virtfs. I also change resolv.conf and remove anything that has the name of another domain on it for legal reasons. For example, /etc/hosts and /etc/HOSTNAME. --> 著者は全てのスクリプトを/usr/binにインストールしています。仮想ファイル システム上に置きたくないものは/usr/localに置いています。スクリプトは コピーに関してなにもタッチしないようにします。 仮想ファイルシステム間でまたがらないことが重要な全てのファイルは削除しなく てはいけません。 例えば、著者のシステムにはsshがインストールされていますが、プライベートキー (private key)はどの仮想ファイルシステムからも見えるようにはしたくありません。 そこでvirtfsを実行した後にそれぞれの仮想ファイルシステムからプライベートキー を削除しています。 (<em/訳注:/sshはSecure Shellのことです。<tt>secure authentication, encryption, encrypted X11 connections, encrypted TCP/IP forwarding</tt> をもったリモートログインプログラムで,適当なアーカイブサーバの <tt>archives/net/ssh/</tt>ディレクトリなどから入手できます) またresolv.conf(訳注: DNS情報など <tt>/etc/resolv.conf</tt>) も変更し 他のドメイン名があるファイルは全て移動しています。例えば <tt>/etc/hosts</tt> や <tt>/etc/HOSTNAME</tt>などです。 <p> <!-- The programs that I symlink to virtexec are: --> virtexecにシンボリックリンクをはっているプログラムは <itemize> <item> virtpasswd -- パスワード変更 <item> virtadduser -- ユーザー追加 <item> virtdeluser -- ユーザー削除 <item> virtsmbstatus -- samba status <item> virtvi -- ファイルの編集 <item> virtmailq -- mailqのチェック <item> virtnewaliases -- エイリアステーブル再構築 </itemize> です。 <sect> DNS <p> <!-- You can configure DNS normally. The beauty of this system is that all services will behave normally like they are on separate machines. There is a HOWTO on <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/DNS-HOWTO.html" name="DNS">. --> DNSは普通に設定できます。このシステムの良い点は、全てのサービスにおいて マシンが(実は一台にもかかわらず)わかれているかのように振舞うということです。 DNSに関するHOWTOは <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/DNS-HOWTO.html" name="DNS"> を参照してください。 <sect> Syslog <sect1> 問題点 <!-- Problem --> <p> <!-- Syslog is the system logging utility commonly used on UNIX systems. Syslog is a daemon that opens a special file called a FIFO. A FIFO is a special file that is like a pipe. Anything that is written to the write side will come out the read side. The syslog daemon waits for data from the read side. There are C functions that write to the write side. If you write your program with these C functions your output will go to syslog. Remember that we have used a <tt> chroot </tt> environment and the FIFO /dev/log is not in the virtual environment. That means all the virtual environments will not log to syslog. We cannot simply copy the file since the programs use /dev/log instead of the new one we would create. --> <tt/syslog/はUNIXシステムで共通して使われるシステムログユーティリティです。 (<em/訳注:/syslog=カーネル(kernel)のメッセージ・リング・バッファー を読んだり消去(clear)したりする)。 <tt/syslog/は<tt/FIFO(First In First Out)/と呼ばれるスペシャルファイルを開く デーモンです。FIFOはパイプ(pipe)に似たスペシャルファイルです。 syslogデーモンはリードサイドからのデータを待ち、ライトサイドに書き込むための C関数があります。もしこれらのC関数でプログラムを書けば出力はsyslogに入ります。 <tt> chroot </tt>環境を使っていて、<tt>FIFO /dev/log</tt>は仮想環境 には存在しないことに注意して下さい。これは全ての仮想環境がsyslogへの記録が できないということを意味しています。プログラムは新しく作ったものの代わ りとして<tt>/dev/log </tt>を使えないので、ファイルを単にコピーすることもで きません。 <p> <!-- Beware that certain versions of syslog use a udp socket instead of the FIFO. However, this is usually not the case. --> syslogの特定のバージョンにはudpソケットをFIFOの代わりに使っているものも ありますが、これは一般的なことではありません。 <sect1> 解決方法 <!-- Solution --> <p> <!-- Syslog can look to a different FIFO if you tell it on the command line so run syslog with the argument: --> syslogは、コマンドラインで指定すれば、異なるFIFOを探します。 例えば以下のようにします。 <verb> syslog -p /virtual/log </verb> <!-- Then link /dev/log to /virtual/log by (Note it is a SYMLINK):--> そして/dev/logを/virtual/logにリンクをはります(シンボリックリンク)。 <verb> ln -sf /virtual/log /dev/log </verb> <!-- Then link all the /dev/log copies to this file by running (Note it is a hard link and NOT a symlink): --> つぎに以下のようにしてこのファイルに全ての<tt>/dev/log</tt>をリンクします (これはハードリンクでシンボリックリンクではないことに注意)。 <verb> ln /virtual/log /virtual/domain.com/dev/log </verb> <!-- The virtfs script above already does this. Since /virtual is one contiguous disk and the /dev/log's are linked they have the same inode number and point to the same data. The <tt> chroot </tt> cannot stop this so all your virtual /dev/log's will now function. Note that all the messages from all the environments will be logged in one place. However, you can write separate programs to filter out the data. If you do not want to write a program and require separate log files you can use a separate syslog for each virtual filesystem by running: --> 上記のvirtfsスクリプトではすでにこれを行っています。<tt>/virtual</tt>は一つ の連続したディスクにあり、<tt>/dev/log</tt>はリンクされているので同じinode 番号かつ同じデータを指すことになります。<tt>chroot</tt>はこれをストップ できないので全ての仮想<tt>/dev/log</tt>は機能します。全環境からのメッセージ は一つの場所に記録されます。しかしもしプログラムを書きたくなく、それぞれlog ファイルを分けたいという場合は以下のようにして別々にsyslogを使うこともできま す。 <verb> syslog -p /virtual/domain1.com/dev/log syslog -p /virtual/domain2.com/dev/log </verb> <!-- However that wastes process id's so I do not recommend it. This version of the syslog.init file relinks the /dev/log's each time you start it in case they have been improperly set up. Here is a modified syslog.init file: --> もっともこうすることはプロセスIDの浪費なのでお奨めしません。 このバージョンのsyslog.initは、不適切な設定がされている場合には起動する度に 毎回 /dev/log に再リンクしてしまいます。 以下、修正したsyslog.initファイルを挙げておきます。 <code> #!/bin/sh # Source function library. . /etc/rc.d/init.d/functions case "$1" in start) echo -n "Starting dev log: " ln -sf /virtual/log /dev/log echo done echo -n "Starting system loggers: " daemon syslogd -p /virtual/log daemon klogd echo echo -n "Starting virtual dev log: " for i in /virtual/* do if [ ! -d "$i" ] then continue fi if [ "$i" = "/virtual/lost+found" ] then continue fi ln -f /virtual/log $i/dev/log echo -n "." done echo " done" touch /var/lock/subsys/syslog ;; stop) echo -n "Shutting down system loggers: " killproc syslogd killproc klogd echo rm -f /var/lock/subsys/syslog ;; *) echo "Usage: syslog {start|stop}" exit 1 esac exit 0 </code> <!-- Note that you do not have to put all the virtual filesystems on one disk. However, you will have to run a different syslog for each partition that has virtual filesystems on it. --> 一台のディスクに全ての仮想ファイルシステムを置かなくてもよいことに 注意して下さい。もっともディスク上に仮想ファイルシステムを持つ各パーティ ション用のsyslogを実行しなければならないでしょう。 <sect> 仮想FTP <!-- Virtual FTP --> <p> <!-- Wu-ftpd comes with built in support to make it virtual. However, you cannot maintain separate password files for each domain. For example, if <tt> bob@domain1.com </tt> and <tt> bob@domain2.com </tt> both want an account you would have to make one of them bob2 or have one of the users choose a different user name. Since you now have a virtual filesystem for each domain you have separate password files and this problem goes away. Just create a virtnewuser script and virtpasswd script in the way mentioned above and you are all set. You can also have anonymous ftp in each virtual environment as that would be unaffected by the virtual filesystem as well. --> Wu-ftpdも仮想化して使うように設定できます(<em/訳注:/「Virtual-wu-ftpd」 (吉峯 幸郎さん訳)も出ているのでそちらも参照して下さい)。しかし各ドメイン でパスワードファイルをわけた状態にはできません。例えばもし <tt> bob@domain1.com </tt>と<tt> bob@domain2.com </tt>の両方がアカウント を必要とした場合、どちらか一方をbob2としたりします。つまり違う名前にする 必要があります。 各ドメインの仮想ファイルシステムがある状態なのでパスワードファイル をわけてしまえばこの問題は解消します。virtnewuserスクリプトと virtpasswdスクリプトを上に書いたような方法で作って設定してください。 仮想ファイルシステムによって各仮想環境上で影響を受けることなくanonymous ftp を行うことができます。 <p> <!-- The inetd.conf entries for wu-ftp: --> inetd.confにwu-ftpをエントリします。 <verb> ftp stream tcp nowait root /usr/bin/virtuald virtuald /virtual/conf.ftp wu.ftpd -l -a </verb> <sect> 仮想Web <!-- Virtual Web --> <p> <!-- Apache has their own support for virtual domains. This is the only program I recommend using the internal virtual domain mechanism. When you run something through inetd there is a cost. The program now has to start up each time you run it. That means slower response times which is unacceptable for web service. Apache also has a mechanism for stopping connections when too many come in. --> Apacheはそれ自身で仮想ドメインをサポートしています。内部仮想ドメイン メカニズムを使うことを著者が推奨しているプログラムです。inetdを通して 何か実行する時はコストがかかります。この場合、プログラムは実行する毎に スタートせねばなりません。つまりwebサービスには不向きな遅い応答であるという ことを意味しています。 Apacheは多くのアクセスが生じた時の接続を止めるメカニズムも持っています。 <p> <!-- However, if you did want to run Apache through inetd then add the following line to your inetd.conf file: --> もしinetdを通さずApacheを使い場合はinetd.confファイルに 以下の行を追加してください。 <verb> www stream tcp nowait www /usr/bin/virtuald \ virtuald /virtual/conf.www httpd -f /var/www/conf/httpd.conf </verb> <!-- In the /var/www/conf/httpd.conf file you have to specify: --> そして <tt>/var/www/conf/httpd.conf</tt>ファイル(訳注:環境によって httpd.confがある場所は違います)に以下のように明記します。 <!-- e.g /var/lib/httpd/conf --> <verb> ServerType inetd </verb> デフォルトでは&dquot;standalone&dquot;を設定しています。 <!-- Then configure each instance of the Apache server like you would normally for single domain use. --> あとはシングルドメインで使っていた時と同じようにApacheサーバの設定をします。 <p> <!-- At the time of this writing there is no virtual web HOWTO. However, I am under the impression one is coming. Eventually I will just refer to that HOWTO and have some notes on it. If it does not come soon and I get enough requests I will write a small section on how to configure the Apache virthost directive. --> これを書いている時点では仮想web HOWTOはありません (<em/訳注:/「Virtual-Web-HOWTO」が現在は出ています)。 しかしこれが出てくるだろうと思います。やがては そのHOWTOを参照してここに書こうと思います。もしまだ出てこず、要求が 出て来たらApache仮想ホストの設定方法についての章を書くつもりです。 <sect> 仮想的なMail/Pop <!-- Virtual Mail/Pop --> <sect1> Qmail の注意点 <p> <!-- This section applies to sendmail only. A section for qmail will be added in the next version of this HOWTO document. --> この章はsendmailのみに関する内容です。qmailの章はHOWTOの次のバージョン で追加します(<em/訳注:/Qmailに関するマニュアルは「Qmail+MH」などが出て います)。 <!-- 「Sendmail+UUCP」英文のみ --> <sect1> 問題 <p> <!-- Virtual mail support is in ever increasing demand. Sendmail says it supports virtual mail. What it does support is listening for incoming mail from different domains. You can then specify to have the mail forwarded somewhere. However, if you forward it to the local machine and have incoming mail to bob@domain1.com and bob@domain2.com they will go to the same mail folder. This is a problem since both bob's are different people with different mail. --> 現在、仮想メールのサポートに関する要求はますます増えています。Sendmailは 仮想メールをサポートすると言っていますが、その内容は異なるドメインからの メール取り込みのことのようです。 メールをどこかにフォワードさせるということができます。しかしもしローカル マシンにフォワードしたり<tt/bob@domain1.com、bob@domain2.com/にメールが 来る場合などでは同じメールフォルダにたまってしまうでしょう。これは bob宛のメールが実際は違う人宛で中身も違うのだから問題です。 <sect1> 悪い解決方法 <!-- Bad Solution --> <p> <!-- You can make sure that each user name is unique by using a numbering scheme: bob1, bob2, etc or prepending a few characters to each username dom1bob, dom2bob, etc. You could also hack mail and pop to do these conversions behind the scenes but that can get messy. Outgoing mail also has the banner maindomain.com and you want each subdomain's outgoing mail banner to be different. --> ユーザー名に番号を追加(例えばbob1, bob2など)したり、頭に文字を入れて dom1bob, dom2bobにしたりすることによってユーザーの一意性(unique)を 保証することはできます。これを裏で変換するように mailやpop をハック(hack) することもできますが汚い(messy)方法です。 出ていく方のメールもまたバーナー(ヘッダ)に<tt/maindomain.com/がついていて 各サブドメインのメールバーナーも違ったものにしたいのです。 <sect1> 良い解決方法 <!-- Good Solution --> <p> <!-- Each virtual filesystem gives a domain its own /etc/passwd. This means that bob@domain1.com and bob@domain2.com are different users in different /etc/passwds so mail will be no problem. They also have their own spool directories so the mail folders will be different files on different virtual filesystems. --> 各仮想ファイルシステムに各ドメイン用の<tt>/etc/passwd</tt>を用意してい ます。これは<tt/bob@domain1.com/と<tt/bob@domain2.com/が、別々の <tt>/etc/passwd</tt>上の違うユーザーであり、メールのトラブルはないという ことになります。このユーザー達には自分用のspoolディレクトリが用意されていて、 各仮想ファイルシステム上のメールフォルダは互いに違うものであることになりま す。 <p> <!-- However, sendmail requires one minor source code modification. Sendmail has a file called /etc/sendmail.cw and it contains all machine names that sendmail will deliver mail to locally rather than forwarding to another machine. Sendmail does internal checking of all the devices on the machine to initialize this list with the local IPs. This presents a problem if you are mailing between virtual domains on the same machine. Sendmail will be fooled into thinking another virtual domain is a local address and spool the mail locally. For example, bob@domain1.com sends mail to fred@domain2.com. Since domain1.com's sendmail thinks domain2.com is local, it will spool the mail on domain1.com and never send it to domain2.com. You have to modify sendmail (I did this on v8.8.5 without a problem): --> しかし、sendmailはちょっとしたソースコードの修正が必要です。 sendmailは<tt>/etc/sendmail.cw</tt>と呼ばれるファイルを持っています。 これはsendmailが他のホストに転送しないでローカルに配送する全ての ホスト名を含んでいるファイルです。 sendmailはマシン上の全デバイスの内部チェックを、ローカルIPでこのリストを 初期化するために行います。 もし同じマシン上の仮想ドメイン間でメールを送る場合、問題が出てきてしまい ます。sendmailには他の仮想ドメインがローカルアドレスであり、メールもロー カルにスプールするという考えはないのです。 例えば<tt/bob@domain1.com/さんが<tt/fred@domain2.com/にメールを送ったと します。<tt/domain1.com/のsendmailは<tt/domain2.com/がローカルであると 判断するので<tt/domain1.com/にメールをスプールしてしまい、結果として <tt/domain2.com/にメールが届くことはありません。 そこでsendmailを修正してやります(著者はv8.8.5のsendmailでこれを行い、特に 問題はありません)。<tt>src/main.c</tt>の494行辺りを編集します。 sendmailのソースは適当なサイトやディストリビューションCDROMから入手できま す。 <verb> vi v8.8.5/src/main.c # Approximately Line 493 </verb> として、 <verb> load_if_names(); </verb> という箇所を <verb> /* load_if_names(); Commented out since hurts virtual */ </verb> とコメントアウトしてしまいます(訳注:この関数はインターフェースの 走査と追加名の場所をしめす関数でconf.c line 4399にこの関数自体が あります。IPリストのスキャンなどを行っています)。 <!-- Note only do this if you need to send mail between virtual domains which I think is probable. --> もし仮想ドメイン間のメール送信が必要ならこれを行うだけでよいことに注意して 下さい。 <p> <!-- This will fix the problem. However, the main ethernet device eth0 is not removed. Therefore, if you send mail from a virtual IP to the one on eth0 on the same box it will delivery locally. Therefore, I just use this as a dummy IP virtual1.domain.com (10.10.10.157). I never send mail to this host so neither will the virtual domains. This is also the IP I would use to ssh into the box to check if the system is ok. --> 問題は解決されたのですが、メインのイーサネットデバイスeth0は削除されていま せん。そこで、もし同一マシンの仮想IPからeth0上のIPにメールを送る場合は ローカルに送られます。著者はダミーIP<tt>virtual1.domain.com (10.10.10.157) </tt>として使っています。このホストにはメールを送らないのでどの仮想ドメイン もいりません。これはシステムが大丈夫かどうかチェックするために sshでログイン する時に使うIPでもあります。 <!-- Edit /etc/sendmail.cw with the local hostnames. --> <tt>/etc/sendmail.cw</tt>の編集 <verb> vi /etc/sendmail.cw mail.domain1.com domain1.com domain1 localhost </verb> <!-- Create /etc/sendmail.cf like you would normally through m4. I used: --> m4を使って<tt>/etc/sendmail.cf</tt>を好きなように作ります。 著者は以下のようなものを使いました。 <verb> divert(0)dnl VERSIONID(`@(#)tcpproto.mc 8.5 (Berkeley) 3/23/96') OSTYPE(linux) FEATURE(redirect) FEATURE(always_add_domain) FEATURE(use_cw_file) FEATURE(local_procmail) MAILER(local) MAILER(smtp) </verb> (<em/訳注:/m4はUNIXマクロプロセッサで、たいていのシステムに入っています。 最新バージョンは<tt>ftp://prep.ai.mit.edu/pub/gnu/</tt>から 入手できます。<tt>m4 linux.mc > /etc/sendmail.cf</tt>などとして使います。 m4の例が<tt>/usr/lib/m4-example</tt>にあります。オプションは<tt/m4 --help/ で調べて下さい) <!-- Edit /etc/sendmail.cf to respond as your virtual domain: --> <tt>/etc/sendmail.cf</tt>を仮想ドメイン応答するように編集。 <verb> vi /etc/sendmail.cf # 86行辺りを編集 # my official SMTP hostname (defined automatically) #Dj$w.Foo.COM という箇所があるので、これを # my official SMTP hostname (defined automatically) Djdomain1.com としておきます。 </verb> <!-- Sendmail cannot be started stand alone anymore so you have to run it through inetd. This is inefficient and will result in lower start up time but if you had such a high hit site you would not share it on a virtual box with other domains. Note that you are NOT running with the -bd flag. Also note that you need a sendmail -q running for each domain to queue up undelivered mail. The new sendmail.init file: --> sendmailはそれ自身ではそのサービスを始めることができず、inetdを 通して起動する必要があります。これは役に立つことでもなく起動時間を 遅くしているだけでしょう。読者が高速なサイトを管理しているなら 仮想マシン上に他のドメインを占有させるべきではないかもしれません。 <p> <tt/ -bd /フラグを付けて起動することは決してしないで下さい。 (<em/訳注:/このフラグはsendmailをデーモンとして起動するオプションです。 くわしいことは<tt/man sendmail/して下さい)。 また各ドメインで配送していないメールを送り出す(queue up)するために <tt/sendmail -q/と実行する必要があることに注意してください。 <verb> #!/bin/sh # Source function library. . /etc/rc.d/init.d/functions case "$1" in start) echo -n "Starting sendmail: " daemon sendmail -q1h echo echo -n "Starting virtual sendmail: " for i in /virtual/* do if [ ! -d "$i" ] then continue fi if [ "$i" = "/virtual/lost+found" ] then continue fi chroot $i sendmail -q1h echo -n "." done echo " done" touch /var/lock/subsys/sendmail ;; stop) echo -n "Stopping sendmail: " killproc sendmail echo rm -f /var/lock/subsys/sendmail ;; *) echo "Usage: sendmail {start|stop}" exit 1 esac exit 0 </verb> <!-- Pop should install normally with no extra effort. It will just need the inetd entry for it with the virtuald part added. The inetd.conf entries for sendmail and pop: --> popは特に何もせずにインストールしてしまいます。virtualdのパートを追加した上で inetdのエントリーをすることが必要です。sendmailとpopに関するinetd.confの エントリは、 <verb> pop-3 stream tcp nowait root /usr/bin/virtuald virtuald /virtual/conf.pop in.qpop -s smtp stream tcp nowait root /usr/bin/virtuald virtuald /virtual/conf.mail sendmail -bs </verb> となります。 <sect> その他仮想的にできること <!-- Virtual other --> <p> <!-- Any other service should be a similar procedure. --> 他のサービスも同じような手順です。 <!-- <itemize> <item> Add the binary and the libraries to the virtual filesystem. <item> Add it to /etc/inetd.conf. <item> Create a /virtual/conf.service file. <item> Create any virtual scripts that need to be made. </itemize> --> <itemize> <item> 仮想ファイルシステムにバイナリ、ライブラリファイルを追加 <item> <tt>/etc/inetd.conf</tt>の追加 <item> <tt>/virtual/conf.service</tt>を作る <item> 必要に応じて仮想スクリプトを編集する </itemize> <!-- I have experimented with both the samba package and have written a virtual poppassd through Eudora. Both work without any problems. If there is enough interest, I will add a section on installing virtual samba. --> sambaパッケージとEudoraを使っての仮想poppassdを試してみました。 どちらも問題なく動作しています。もしもっと興味があれば仮想sambaの インストール方法についての章も設けたいと考えています。 <sect> まとめ <!-- Conclusion --> <p> <!-- Those are all the steps you need. I hope that this article meets with a positive response. Again mail any responses to <htmlurl url="mailto:brian@nycrc.net" name="Computer Resource Center">. If you have a question or an update to the document let me know and I will add it. --> 以上が必要な作業です。この文書によって人びとの前向きな反応に出会える ことを期待しています。連絡は <htmlurl url="mailto:brian@nycrc.net" name="Computer Resource Center"> までお願いいたします。もし疑問な点やドキュメントのアップデートなど ありましたら教えて下さい。今後のHOWTOに追加したいと思います。 <sect> FAQ <p> <!-- Q1. Why are there no questions in this FAQ? A1. Because nobody has asked any yet. --> Q1. どうしてこのFAQについて質問がないのですか? <p> A1. まだだれも質問してないからです。 <p> (<em/訳注:/以上ここまでが原文) <hrule> <sect>作業メモ <p> <sect1>virtfsについて <p> 実行すると <verb> Enter the domain name: domain.com Enter leading dir: (Enter for default: /virtual): </verb> と聞かれます。それぞれ入力して下さい。上の例では以下のような ディレクトリが作られ、適当なファイルがそれぞれのディレクトリにコピー されます。 <verb> /virtual/domain.com/ |- bin |- dev |- etc |- home |- lib |- proc |- sbin |- tmp |- usr |- var \-log </verb> <sect1>その他のエラー <sect2>/var/log/syslog: <p> <verb> Dec 22 23:28:46 kaien virtuald[298]: Virtuald Starting: $Revision: 1.2 $ Dec 22 23:28:46 kaien virtuald[298]: getipaddr: getsockname failed: Socket opera Dec 22 23:28:46 kaien virtuald[298]: getipaddr failed </verb> ======> ip-aliasが設定されていません。 <p> <verb> Dec 23 00:30:26 kaien virtuald[1132]: Virtuald Starting: $Revision: 1.2 $ Dec 23 00:30:26 kaien virtuald[1132]: Incoming ip: 192.168.1.1 Dec 23 00:30:26 kaien virtuald[1132]: iptodir: fopen failed: No such file or dir Dec 23 00:30:26 kaien virtuald[1132]: iptodir failed </verb> ======> <tt>/etc/initd.conf</tt>に設定したconfファイルがありません。 <sect2>FTP <p> ftp は <tt>/virtual/etc/passwd</tt>で設定したユーザーでloginできます。 <p> 例: <verb> Connected to 192.168.1.4. <=== IP-alias address 220 kaien FTP server (Version wu-2.4(1) Tue Dec 5 20:51:15 CST 1995) ready. Name (192.168.1.4:apple): 331 Password required for hogehoge 230-No directory! Logging in with home=/ ===>これはまだ /virtual/home/hogehogeを作っていないから。 230 User hogehoge logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> 221 Goodbye. </verb> <sect2>Mail <p> <sect2>Web <p> [訳者 : 伊佐治 哲 (<tt/isaji@mxu.meshnet.or.jp/)<p> 校正 : 藤原 輝嘉さん (<tt/fujiwara@cim.pe.u-tokyo.ac.jp/) ] <!-- Ending --> </article>