Home  >  Article  >  Backend Development  >  Apache and PHP installation How to implement multi-website domain name binding in Apache2

Apache and PHP installation How to implement multi-website domain name binding in Apache2

WBOY
WBOYOriginal
2016-07-29 08:45:221413browse

Configuration environment
System: win7
PHP version: 5.3.x
MYSQL version: 5.0.27
Apache:2.2.4 (Win32)
Setting method:
Open D:wampbinapacheApache2.2.17confhttpd.conf
Add
NameVirtualHost * at the end :80

DocumentRoot "D:wampwwwbbs"
ServerName www.a.com

Note during configuration:
ServerName *:80
The * here can be changed to local machine IP such as 192.168.1.11
NameVirtualHost *:80 VirtualHost *:80 Keep it as it is
Then write a sentence in the hosts file: 127.0.0.1 www.a.com
(Hosts file location: - Windows NT/2000/XP/ 2003/Vista default path: %SystemRoot%system32driversetc)
In this way, the domain name a.com is tied to the root directory of the machine, which is equivalent to http://localhost or
http://127.0.0.1 Enter www.a.com to compare Convenient.
Start the apache service and access it with the above domain name

The above introduces the implementation method of Apache and PHP installation to implement multi-website domain name binding in Apache2, including the installation of Apache and PHP. 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