1 頁 (共 1 頁)

httpd.conf 相關問題

發表於 : 2005-12-31 18:31
GamePlayer
Windows 作業系統版本2000 Pro
Appserv 安裝版本:2.4.4a
發生問題:網址加上www便無法找到網頁

現已成功可以在別台電腦連上
但是如果在網址前加www就不能連上(在本機時可以)
例如:
輸入→http://abc.com.twhttp://def.com.tw 可正常開啟網頁
輸入→http://www.abc.com.twhttp://www.def.com.tw 無法開啟網頁

以下是我在 httpd.conf 檔的設定

代碼: 選擇全部

NameVirtualHost 999.999.999.999

<VirtualHost abc.com.tw>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot C:/AppServ/www/user/abc
    ServerName www.abc.com.tw
</VirtualHost>

<VirtualHost def.com.tw>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot C:/AppServ/www/user/def
    ServerName www.def.com.tw
</VirtualHost>
另外在C:\WINNT\system32\drivers\etc\裡面的hosts檔設定

代碼: 選擇全部

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual\r
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

999.999.999.999       abc.com.tw

999.999.999.999       def.com.tw
順便問一下 這樣的狀況 要安裝PHPBB時 有什麼需要注意的??

發表於 : 2006-01-01 15:46
GamePlayer
:-o 真的都沒人欲過這問題嗎??

發表於 : 2006-01-01 17:14
咖啡不加糖
你要把 http://www.abc.com 跟 abc.com 都加入設定
應該就沒問題了..至少我從xp改到2003都是這樣..
沒出過問題..

發表於 : 2006-01-02 10:11
GamePlayer
咖啡不加糖 寫:你要把 http://www.abc.com 跟 abc.com 都加入設定
應該就沒問題了..至少我從xp改到2003都是這樣..
沒出過問題..
我已經把 httpd.conf 檔&hosts 檔的設定改成如下:

代碼: 選擇全部

NameVirtualHost 999.999.999.999

<VirtualHost abc.com.tw>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot C:/AppServ/www/user/abc
    ServerName abc.com.tw
</VirtualHost>

<VirtualHost abc.com.tw>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot C:/AppServ/www/user/abc
    ServerName www.abc.com.tw
</VirtualHost>

<VirtualHost def.com.tw>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot C:/AppServ/www/user/def
    ServerName def.com.tw
</VirtualHost>

<VirtualHost def.com.tw>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot C:/AppServ/www/user/def
    ServerName www.def.com.tw
</VirtualHost>
另外在hosts檔改成

代碼: 選擇全部

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

999.999.999.999       abc.com.tw
999.999.999.999       www.abc.com.tw
999.999.999.999       def.com.tw
999.999.999.999       www.def.com.tw
可是還是不行ㄟ

發表於 : 2006-01-02 13:43
咖啡不加糖
忘了說...我的 hosts 檔從未更改過,也使用正常至今...
那你試著把
<VirtualHost abc.com.tw>
改成
<VirtualHost *>
然後
NameVirtualHost 999.999.999.999
改成
NameVirtualHost *
最後把 hosts 檔還原成最開始的...