<VirtualHost *:80>
ServerAdmin info@example.com
DocumentRoot "/Users/example/Sites/magento2"
ServerName local.magento2
<Directory "/Users/example/Sites/magento2">
Options Indexes FollowSymLinks Includes
AllowOverride All
Allow from All
Order deny,allow
</Directory>
</VirtualHost>
ini Apache虚拟主机模板
## ServerName should have the same value as the URL in the hosts file.
## Assuming XAMPP is utilizing port 80...
## No need for a trailing slash on DocumentRoot or <Directory "">
## Unsure if forward slash or backward slash makes a difference...
## <Site name> ##
<VirtualHost *:80>
DocumentRoot "C:\Users\PATH\TO\SITE"
ServerName site-name.tld
<Directory "C:\Users\PATH\TO\SITE">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>