温馨提示×

如何在apache中绑定域名解析

九三
335
2021-02-07 08:17:36
栏目: 云计算

如何在apache中绑定域名解析

在apache中绑定域名解析的方法

1.首先,在计算机中使用记事本打开hosts文件,hosts文件位置:C:\Windows\System32\Drivers\etc\hosts;

2.hosts文件打开后,在文件中添加解析的域名并保存;

127.0.0.1 localhost aaa.com

3.域名解析添加好后,在apache安装目录中,使用记事本打开httpd-vhosts.conf文件;

4.httpd-vhosts.conf文件打开后,在文件中添加以下配置;

ServerAdmin webmaster@dummy-host.localhost

DocumentRoot "D:/EmpireServer/web"

ServerName localhost

ServerAlias localhost

ErrorLog "logs/localhost-error_log"

ServerAdmin webmaster@dummy-host.localhost

DocumentRoot "D:/EmpireServer/web"

ServerName aaa.com

ServerAlias *.aaa.com

ErrorLog "logs/localhost-error_log"

5.最后,httpd-vhosts.conf文件配置好后,开启80端口即可;

0