1. Locate the httpd-vhosts.conf virtual host profile under Conf under extra in the Apache directory to copy and paste the following code to the bottom: #<virtualhost *:80>
# ServerAdmin [email protected]
# documentroot "${srvroot}/docs/dummy-host2.example.com"
# ServerName Dummy-host2.example.com
# errorlog "Logs/dummy-host2.example.com-error.log"
# customlog "Logs/dummy-host2.example.com-access.log" common
#</virtualhost> edited into the following code: <virtualhost *:80>
DocumentRoot "F:\project"
ServerName www.thinkphp.com
</VirtualHost> DocumentRoot behind is the root directory of the project (my project directory is in this folder); servername is followed by the virtual domain name, the domain name when accessed in the browser (own definition): 2, Locate the httpd.conf file under the Conf directory in the Apache directory (1) to open the # include conf/extra/httpd-vhosts.conf in the found file, remove the previous # (2) to find #loadmodule Rewrite_ Module modules/mod_rewrite.so, remove the previous # #, set access rights (1) Find code: <directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
</Directory> Add # (#是注释, allow everyone to access) before Deny from all (2) if it is Apache2.4: found: <directory/>
allowoverride None
Require all denied
</Directory> changed to the following: <directory/>
allowoverride None
Require all granted
</Directory> 4. Modify the host file for Windows C: directory: C:\Windows\System32\drivers\etc\host add one row below (the virtual domain name you just set): 127.0.0.1 Www.thinkphp.com Original Address: http://blog.csdn.net/iloveyougirls/article/details/54463668 support original!
Windows Apache server Simple configuration Virtual domain name (reprint)