Home >Backend Development >PHP Tutorial >Configure domain name on wamp

Configure domain name on wamp

WBOY
WBOYOriginal
2016-07-29 09:10:511495browse

You can also configure multiple domain names and multiple directories. Block website ads~~

1. Find the Apacheinstallation directory of wamp and find the httpd.conf file. For example, the directory I installed is C:wampbinApacheApache2.2.21confhttpd.conf

You can also use wamp icon opens. Find Virtual hosts and remove the #
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

2. This will include the C:wampbinApacheApache2.2.21confextrahttpd-vhosts.conf file

Add later

#2015-12-5 15:02:55 Test multiple domain names

ServerAdmin 1439120442@qq.com
DocumentRoot "D:/www/thinkphpTest"
ServerName www. jiayou.com
ServerAlias ​​www.jiayou.com
ErrorLog "logs/ www.jiayou.com -errlo.log"
CustomLog "logs/ www.jiayou.com -access.log" common


Among them, ServerAdmin, ErrorLog and CustomLog are optional configurations. It does not need to be configured.

3.C:Add at the end of WindowsSystem32driversetchosts

#2015-12-5 15:06:52 Test multiple domain names
127.0.0.1 www.jiayou.com

Here you can block various sites.

4. Restart the

Apache
service. It’s ok.


The above introduces the domain name configuration on wamp, including Apache content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn