2014-01-21 193 views
2

我的項目是保存在C的configuraton全設置:/ WAMP/WWW/EducationPortal 現在在瀏覽器中我要開www.eportal.com爲本地主機

文件我已經作出的httpd變化。 conf with

<VirtualHost *:80> 
    DocumentRoot "C:/wamp/www/EducationPortal" 
    ServerName www.eportal.com 
# ServerAlias www.site1.dev 
Options Indexes FollowSymLinks 
<Directory "C:/wamp/www/EducationPortal"> 
    AllowOverride All 
     Order Deny,Allow 
     Deny from all 
     Allow from 127.0.0.1 
     Allow from localhost 
     Allow from ::1 
    </Directory> 
</VirtualHost> 

現在我該怎麼做呢?

+0

使用'vhosts',添加條目'127.0.0.1 www.eportal.com'到您的主機文件。 –

+0

httpd.conf中需要做什麼修改? –

回答

0

您需要訪問hosts文件並進行編輯。該文件位於:C:\Windows\System32\drivers\etc,它的名稱爲hosts,但沒有擴展名。

這似乎是以下幾點:

# Copyright (c) 1993-2009 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 handled within DNS itself. 
# 127.0.0.1  localhost 
# ::1    localhost 

127.0.0.1  localhost 
127.0.0.1  larablog.fox 
127.0.0.1  phpmyadmin.fox 
127.0.0.1  cake241.fox 
+0

你能告訴我帶路徑的文件名嗎? –

+0

主機文件在.ics中,無法保存 –

+0

您可以更改權限。 – SaidbakR

0

第1步:

更改的httpd.conf

<VirtualHost *:80> 
DocumentRoot "C:/wamp/www/test" 
ServerName www.test.com 

Options Indexes FollowSymLinks 
<Directory "C:/wamp/www/test"> 
    AllowOverride All 
    Order Deny,Allow 
    Deny from all 
    Allow from 127.0.0.1 
    Allow from localhost 
    Allow from ::1 
</Directory> 
</VirtualHost> 

第2步:

編輯lhost文件,這將是可在

C:\ WINDOWS \ SYSTEM32 \ drivers \ etc下 注意:如果你不能編輯文件,可以通過單擊開始,所有打開的文件作爲管理員

  1. 具有管理員權限打開記事本程序,附件,然後右鍵單擊記事本,然後選擇以管理員身份打開。

  2. 現在記事本打開具有管理權限在記事本中瀏覽到(C:\ Windows \ System32 \ drivers \ etc)並打開hosts文件。

然後把喜歡

127.0.0.1  test.com 

條目重新啓動服務器就是這樣