2012-03-27 93 views
2

嘿,我在Windows 7旗艦版64位上運行XAMPP,我有我的本地主機設置的一些問題,我一直在拖網互聯網多年來試圖得到這個固定但無濟於事。Windows 7本地主機無法正常工作與XAMPP

我的設置如下:

我有Apache和XAMPP上沒有問題運行MySQL,而且我已經編輯我的主機文件沒有問題,確保我使用的記事等管理權限和它不保存爲.txt文件等,目前看起來是這樣的:

# Copyright (c) 1993-2006 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 

# localhost name resolution is handle within DNS itself. 
#  127.0.0.1  localhost 
#  ::1    localhost 
127.0.0.1 localhost 
127.0.0.1 legendary-games.localhost 
127.0.0.1 admin.legendary-games.localhost 
127.0.0.1 shuuro.legendary-games.localhost 
127.0.0.1 yearzero.legendary-games.localhost 
127.0.0.1 chess.legendary-games.localhost 

我也確信,使所有來我的虛擬主機文件進行必要的修改在Apache和所有指向正確的地址。

現在,當我在我的瀏覽器中輸入localhost時,我得到了我打算使用的頁面,但是如果我嘗試其他地址中的任何一個,我會找不到一個頁面。我已經嘗試ping命令提示符中的地址,並且返回成功。我已經嘗試了很多不同的方法來嘗試使用這些工具,包括刷新DNS,重新啓動DNS,我已經檢查過hosts文件正在被服務正確查找,但無濟於事。

任何幫助將不勝感激。

+0

澄清一下,當你鍵入localhost時,你會從htdocs中顯示你的頁面?但是,當您輸入的地址不是來自本地託管的例如google.com時,您會收到未找到響應頁面?你是這個意思嗎? – 2012-03-27 08:24:51

+0

是的,當我在瀏覽器中輸入localhost時,我從htdocs中獲取文件,但是當我從主機中獲得一個地址文件時,例如legendary-games.localhost這給出了一個沒有找到的頁面。正常的互聯網網址工作正常 – 2012-03-27 08:29:03

+0

我明白了。你有沒有在你的apache上啓用虛擬主機模塊?如果您已啓用,那麼您是否添加了別名legendary-games.localhost? – 2012-03-27 08:37:54

回答

1

好的,這裏是解決方案,也許這可以幫助你。

加入這行或者取消註釋從文件httpd.conf在Apache的文件夾中找到 - > CONF

Include conf/extra/httpd-vhosts.conf 

編輯的httpd-vhosts.conf在你的Apache文件夾中找到 - > CONF - >額外

httpd-vhosts.conf

<VirtualHost *:80> 
    DocumentRoot "your-htdocs-path/legendary-games-folder" 
    ServerName legendary-games.localhost 
</VirtualHost> 

然後,重新啓動apache。

+0

我已經取消了apache conf文件中的include vhosts的註釋,並且我已經將下列條目添加到了我的vhosts文件中: DocumentRoot「C:/ Users/fisk/codebase/trunk/htdocs中」 服務器名傳奇-games.localhost <目錄 「C:/用戶/菲斯克/代碼庫/中繼/ htdocs中」> 的AllowOverride所有 訂單允許,拒絕 從所有 允許 – 2012-03-27 08:53:53

相關問題