本地Apache测试泛解析

WBOY
Release: 2016-06-06 20:45:26
Original
1352 people have browsed it

系统:windows 8.1
服务器:Apache
编程语言:php
需求:搭建泛解析环境,方便测试,不知道可以实现吗?
如果可以的话,怎么做呢?
目前的思路:本机搭建dns服务器,就可以实现了,但是我的系统是windows 8.1的,貌似不能搭建dns
比如:
fan.com
aaa.fan.com
bbb.fan.com
等都解析到:D:\www\fanjiexi\ 目录下
hosts文件:127.0.0.1 fan.com

回复内容:

系统:windows 8.1
服务器:Apache
编程语言:php
需求:搭建泛解析环境,方便测试,不知道可以实现吗?
如果可以的话,怎么做呢?
目前的思路:本机搭建dns服务器,就可以实现了,但是我的系统是windows 8.1的,貌似不能搭建dns
比如:
fan.com
aaa.fan.com
bbb.fan.com
等都解析到:D:\www\fanjiexi\ 目录下
hosts文件:127.0.0.1 fan.com

Re:会飞的小猪

推荐方法
在你的本机Apache,建立virtual host,把以下的配置根据自己的需求写入到apache的配置文件。

APACHE

<code class="lang-shell"><virtualhost>
    ServerAdmin a@host.example.com
    DocumentRoot /var/www/xxx你想要解释的文件夹位置
    ServerName xxx这个服务器的域名
    ErrorLog logs/xxx.log
    CustomLog logsxxx.log common
</virtualhost>
</code>
Copy after login

=================================
在你的DNS 服务器,建立A解释

<code class="lang-excel">域名名称    记录类型    主机记录    解析线路    记录值 mx优先级   TTL

a.com   A   *   默认  127.0.0.1   --  600 
</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!