Apache 2.2 で仮想ホストを設定したいです。
したがって、IP アドレスとポート番号を使用してサイトにアクセスできます。
のようにhttp://192.168.101.111:4291つのサイトの場合、http://192.168.101.111:420他のサイトなどの場合。
私のマシンのOSはWindows 7です。
httpd.conf ファイルで以下を試しました。
Listen 192.168.101.83:82
#chaffoteaux
<Directory "Path to project folder">
AllowOverride All
</Directory>
<VirtualHost 192.168.101.83:82>
ServerAdmin [email protected]
DirectoryIndex index.html index.htm index.php index.html.var
DocumentRoot "Path to project folder"
#ServerName dummy-host.example.com
ErrorLog logs/Zara.log
#ErrorLog logs/dummy-host.example.com-error_log
#CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
私の設定に欠けているものがあれば提案していただけますか。
前もって感謝します
アビナッシュ
答え1
Apache がリッスンするさまざまなポートを指定する必要があります。
また、
NameVirtualHost
使用する IP:ポートの組み合わせごとに指定されるディレクティブ。
次に、VirtualHost 定義を設定します。
見てこれらの例詳細については。
編集
<Directory>ブロックを<VirtualHost>ブロック内に置く
線を追加する
Order allow,deny
Allow from all
ディレクトリブロック内
必要に応じて、仮想ホストごとに設定を指定するのではなく、httpd.conf 内でこれらの設定をグローバルに変更できます。