仮想ディレクトリについて
Windows の仮想ディレクトリについて
仮想ディレクトリは、Web ブラウザーで指定される URL と、サーバー上の実ディレクトリとを結びつける役割をします。
簡単には次の組み合わせで構成されます。
- 仮想ディレクトリの設定は、Web サーバーで行います。
項目 | 説明 |
---|---|
ディレクトリ | Web で公開するファイルを入れておくディレクトリです。 |
エイリアス名 | Web ブラウザーからアクセスするとき、URL に指定する名前です。 |
ディレクトリへのアクセス権 | Web サーバーがそのディレクトリに対してできることです。 |
Windows 版で利用する Web サーバー(IIS)では、初期状態で次の項目が設定されています。
- ディレクトリ:C:\InetPub\scripts
- エイリアス名:/scripts
- アクセス権:読み取り不可、実行可能
この設定では、Web ブラウザーから
http://(サーバーのホスト名)/scripts/test.exe
にアクセスすると、 Web サーバーでは、/scripts が指す実行可能のアクセス権を持つ C:\InetPub\scripts ディレクトリにある text.exe が実行されます。
/scripts のアクセス権が実行可能になっていれば、その下にあるすべてのディレクトリも実行可能なアクセス権を保持します。つまり、/scripts/sales/test1.exe や /scripts/system/test2.exe もすべて実行可能です。
サイボウズ製品は、初期設定の C:\InetPub\scripts へインストールすると、仮想ディレクトリの設定を行わなくても、http://(サーバーのホスト名)/scripts/cbag/ag.exe?にアクセスすれば、「Office 7」を実行することができます。
C:\InetPub\scripts 下のディレクトリ以外の場所へインストールした場合は、仮想ディレクトリを新たに設定する必要があります。
Linux の仮想ディレクトリについて
apache での「仮想ディレクトリ」は、Script Alias(CGI 実行可能ディレクトリ)として、Apache の設定ファイル「httpd.conf」で定義されます。
「Office 7」のインストール時に、インストーラーは、「インストール識別子の設定」「CGI ディレクトリの設定」でインストールディレクトリの初期状態を表示します。
(CGI ディレクトリ)/(インストール識別子)がインストールディレクトリの初期状態です。
インストーラーで初期状態に表示されたディレクトリとは異なる場所に「Office 7」をインストールする場合は、そのディレクトリが「httpd.conf」で Script Alias に設定されている必要があります。
例)インストールディレクトリとアクセス URL を、次のように設定する場合
インストールディレクトリ : /cgi/cybozu/cbag
アクセス URL : http:// サーバー名 /cybozu/cbag/ag.cgi?
「httpd.conf」に、次の内容を追加します。
ScriptAlias /cybozu/ "/cgi/cybozu/" <Directory "/cgi/cybozu"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> |
# ScriptAlias: This controls which directories contein server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the realname directory are treated as applications and # run by dhe server when requested rather than as documents sent to the client. # The same rules about trailing "/" apply to ScriptsAlias directives as to # Alias. # ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" # < Directory "/var/www/cgi-bin"> # AllowOverride None # Options ExecCGI # Order allow,deny # < /Directory> ###################################### ScriptAlias /cybozu/ "/cgi/cybozu/" <Directory "/cgi/cybozu"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> ###################################### |
上記のように「httpd.conf」の Script Alias に設定してあるディレクトリは、インストール手順の手順 7/8(「インストール識別子の設定」「CGI ディレクトリの設定」)でインストール先として指定できます。