我的项目保存在c:/ wamp / www / EducationPortal中 现在在浏览器中我想用www.eportal.com打开文件
我已经使用
在httpd.conf中进行了更改<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 :(得分: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
答案 1 :(得分: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下\驱动程序\等强> 注意:如果您无法编辑该文件,则必须以管理员身份打开该文件
单击“开始”,“所有程序”,“附件”,打开“具有管理权限的记事本”,然后右键单击“记事本”并选择以管理员身份打开。
现在,记事本已打开,具有管理权限,在记事本中浏览到(C:\ Windows \ System32 \ drivers \ etc)并打开hosts文件。
然后输入类似
的条目127.0.0.1 test.com
重启服务器就是这样