共計 577 個字符,預計需要花費 2 分鐘才能閱讀完成。
在 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 端口即可;
丸趣 TV 網 – 提供最優質的資源集合!