溫馨提示×

xampp怎么配置域名綁定

養(yǎng)魚的貓咪
982
2021-03-08 17:01:53
欄目: 云計算

在xampp中配置域名綁定的方法:1.xampp安裝目錄打開httpd-vhosts.conf 文件;2.在文件中添加代碼配置;3.系統(tǒng)盤打開hosts文件;4.在文件根據(jù)原有格式添加httpd-vhosts.conf文件中綁定的域名,保存即可;

xampp怎么配置域名綁定

在xampp中配置域名綁定的方法

1.首先,計算機中進入xampp安裝目錄;

2.進入到xampp安裝目錄后,在目錄中查找到httpd-vhosts.conf 文件,并使用記事本打開;

3.httpd-vhosts.conf 文件打開后,在文件添加以下配置;



ServerAdmin yang@21cn.com

DocumentRoot "C:/xampp/htdocs/" #域名目錄

ServerName baidu.com #需要綁定的域名

ServerAlias www.baidu.com #域名別名

ErrorLog "logs/localhost-error.log"

CustomLog "logs/localhost-access.log" combined


Options Indexes FollowSymLinks

AllowOverride all

Order Allow,Deny

Allow from all


4.httpd-vhosts.conf文件配置好后,在計算機中打開系統(tǒng)磁盤;

5.進入到系統(tǒng)磁盤后,在磁盤中查找到hosts文件,并使用記事本打開,hosts文件位置:C:\WINDOWS\system32\drivers\etc;

6.查找hosts文件后,使用記事本打開;

7.最后,hosts文件打開后,在文件中根據(jù)原有格式添加httpd-vhosts.conf文件中綁定的域名,保存即可;


127.0.0.1 www.baidu.com



0