XAMPP本地环境搭建笔记

2020-03-14

XAMPP下载地址

https://www.apachefriends.org/zh_cn/download.html

开启虚拟主机

1.编辑文件 C:\xampp\apache\conf\httpd.conf

去掉httpd-vhosts.conf的注释

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

把Directory修改成如下

<Directory />
	Order Deny,Allow
	AllowOverride all
	Allow from all
</Directory>

2.编辑文件 C:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
	ServerName localhost
	DocumentRoot "C:\xampp\htdocs"
</VirtualHost>
<VirtualHost *:80>
	ServerName cloud.localhost
	DocumentRoot "C:/01_cloud/"
	<Directory "C:/01_cloud/">
		Options Indexes FollowSymLinks
		AllowOverride all
		Order Allow,Deny
		Allow from 127.0.0.1
		Allow from ::1
	</Directory>
</VirtualHost>

3.修改 C:\Windows\System32\drivers\etc\hosts

添加

127.0.0.1 cloud.localhost