After the XAMPP is installed, open the browser, enter the URL "http://localhost" or "HTTP://127.0.0.1/", the browser appears on behalf of the successful installation.
The default local path of the Web page is "C:\xampp\htdocs", the original file in this directory can be deleted all, and then create a new file yourself ("index.html" or "index.htm" or "index.php" is the default page).
Apache is a server software that configures Apache virtual hosts to run multiple Web sites on a single server, each of which binds separate domain names and binds them to separate directories.
In the Windows environment.
The first step: Open the C:\Windows\System32\drivers\etc\host file, add "127.0.0.1 www.test.com" in the file, 127.0.0.1 means the IP address of the machine, "127.0.0.1" and " Www.test.com "There are several spaces between. "Www.testlz.com" is the virtual domain name set by the machine owner.
Such as:
You can also set up two virtual domain names
This way, entering http://www.test.com/and http://www.test.com/in the browser is the same as entering localhost. They point to the contents of the same directory.
Next, you can set each virtual domain name to point to a different, separate directory so that you can achieve the purpose of running multiple projects on the same server.
In Win7 environment, open C:\xampp\apache\conf\httpd.conf, find
This line, and remove the "#" in the red circle. This way, Apache will not load the conf/extra/httpd-vhosts.conf file until it is booted.
Then open the Httpd-vhosts.conf file and add the following, both Www.hello.com and www.test.com are the domain names when they are published externally.
and create the corresponding folder in the C:\xampp\htdocs directory, and put the HTML file in the folder. ,
This successfully configures two items when input http://www.test.com/is, pointing to the contents of the Test folder. Enter http://www.hello.com/to display the contents of the Hello folder
If you do not configure the httpd-vhosts.conf file, the input http://www.test.com and http://www.hello.com/will not enter the test and the Hello folder, both the path configuration is invalid, the browser is displayed
Apache Virtual Host