電子書籍の厳選無料作品が豊富!

http://oshiete.goo.ne.jp/qa/8355745.html
以上のURLの質問で、せっかくご回答をいただいたのですが
 ご回答内容の内容通りしたいのですが、私は”まだまだ未熟ものなので、
 数日悩みましたが、
まだ解決には至っていません。
 
 質問のすり合わせをしたかったのですが、
 カテ違いとのご指摘をいただいたのと、回答のレスポンスの兼ね合いで、マルチポストになるので
 早々、未解決のまま、〆ました。
 以上のURLの質問での”ご回答内容”に再度質問があります。
 
 以下が、ご回答された文面のです。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 行頭に # がない<VirtualHost *:80>から</VirtualHost>までの内容をコピーして
(<VirtualHost *:80>、</VirtualHost>も含み
その下に貼り付けてください

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 以上のご回答の中に、ここでいう、「その下に貼り付けてください」とはどこのデレクトリの、ファイル
 の事を言っているのでしょうか!?
 
 以上宜しくお願い致します。

A 回答 (2件)

apacheで複数のテストサーバーを動作させるということですよね。


私は、テスト用に他のパーテーションを使用していますが基本的には同じです。
apacheで
1) Virtual hostを有効にする。ipで動作させるなら
NameVirtualHost 127.0.0.1
2) ドキュメントを保存するフォルダーを用意する。
3) そのフォルダーの設定をする。
<VIRTUALHOST 127.0.0.1>
DocumentRoot "/html/"
ServerName hoge.com.local
ServerAdmin webmaster@hoge.com
AddHandler server-parsed .shtml
Options +IncludesNoExec
ErrorLog logs/ichiya_error_log
CustomLog logs/hoge-access_log common
</VIRTUALHOST>

#2 ----LocalHost
<VIRTUALHOST 127.0.0.1>
DocumentRoot "/home/"
ServerName localhost
ServerAdmin webmaster@hoge.com
AddHandler server-parsed .shtml
Options All +Includes +ExecCGI
ErrorLog logs/webtest_error_log
CustomLog logs/webtest_access_log common
</VIRTUALHOST>

とかをhttpd.confの最後に好きなだけ書けばよい。

この回答への補足

”内容が抜けている個所を発見しまして、項目全てを再度以下に書き込みました。

http://oshiete.goo.ne.jp/qa/8355745.html
  以上のURLの、”バーチャルホストの追加手順”
を、基にして、”バーチャルホストの追加手順”
の”内容が抜けている個所を発見しまして、項目全てを
 再度以下に書き込みました。
以下内容です

 P30に入りました。そこで!
以下教本の中身です。
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ■バーチャルホストの追加手順
 バーチャルホストを追加する際はまずドキュメントルートとなるデレクトリを作成します。
 C:¥xampp\htdocs以下にドメインと同じ名前のデェレクトリを作成すると分かりやすいでしょう。
  次にC:\xampp\apache\conf\extra\httpd-vhosts.confにバーチャルホストの設定を追加します。
 <VirtualHost>で囲まれた部分をコピーし、ServerNameやDocumentRootの値を書きかえて保存
 した後、Apacheを再起動します。また、必要に合わせてC:\Windows\System32\drivers\etc\hostsに
 ドメインの指定を追加します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 以上ですが、
  「C:¥xampp\htdocs以下にドメインと同じなめのデェレクトリを作成すると分かりやすいでしょう。」
 が私みたいに抜けていました。
  抜けていたことで、どれぐらい、この問題に対して影響があったのか、ご回答してくださった
 皆様でないと、私は分かりませんが

 皆様にご迷惑をおかけしたことをお詫び申し上げます。
 以上仕切り直しで、ご回答のほどを、宜しくお願い致します。

補足日時:2013/11/24 15:56
    • good
    • 0

> 以上のご回答の中に、ここでいう、「その下に貼り付けてください」とはどこのデレクトリの、ファイル


>  の事を言っているのでしょうか!?

同じファイルの</VirtualHost>と書かれている下に貼り付けてくださいという意味だと思いますが…。

この回答への補足

 レス有難うございます
 
結論から申しますと!
 現在私の
C:\xampp\apache\conf\extra\httpd-vhosts.conf
 のファイルの中身は以下となっております。

 この設定で間違いはないでしょうか!?
 
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<VirtualHost *:80>
ServerName study.localhost
DocumentRoot "C:/xampp/htdocs/study.localhost"
DirectoryIndex index.php index.html
<Directory "C:/xampp/htdocs/study.localhost">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>

##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
##ServerName dummy-host.example.com
##ServerAlias www.dummy-host.example.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost>

##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
もし間違っていなかったなら、この設定は

既にP28~P29のドキュメント設定で既に設定済みなのに
  http://oshiete.goo.ne.jp/qa/8355745.html
  P30の内容を質問しました。そのご回答には、
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
以上質問内容のご回答は以下です。

さて、内容についてですが
行頭に # がない<VirtualHost *:80>から</VirtualHost>までの内容をコピーして(<VirtualHost *:80>、</VirtualHost>も含み
その下に貼り付けてください
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 以上のご回答は
 C:\xampp\apache\conf\extra\httpd-vhosts.conf
のファイルの事を言っているのだろうと思われます。

 もし同じファイルのでしたら、
P28~P29 同設定済みでありますので、再度同じ設定をする
意図は何でしょうか? 
少しナーバス過ぎた質問かもしれませんが
 もし同じ設定だったら、次に進もうと思います。

補足日時:2013/11/24 12:28
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!