XAMPP is an environment (PHP+APACHE+MYSQL) software that can quickly create web sites, if there are many projects, Using 127.0.0.1 or localhost access is cumbersome and not easy to remember, you can use the domain name virtual directory to achieve fast access, but also a good distinction between the various projects.
To WordPress and Discuz to do, WordPress use WordPress.com to visit, Discuz use discuz.com to visit.
1. Download good source stacking in Htdocs file
-/htdocs
-/wordpress
-/discuz
2. Open the local Hosts file (c:/windows/system32/drivers/etc/) and add the following code at the end:
127.0.0.1 wordpress.com
127.0.0.1 discuz.com
3. Edit Xampp vhost file (/xampp/apache/conf/extra/httpd-vhosts.conf)
Remove the Namevirtualhost *:80 before the *, and at the end add
# # Add 127.0.0.1 rules, otherwise 127.0.0.1 can't use
The code is as follows |
Copy Code |
<virtualhost *:80> ServerAdmin webmaster@127.0.0.1.com DocumentRoot "e:/xampp/htdocs/" ServerName 127.0.0.1 ErrorLog "Logs/127.0.0.1-error.log" Customlog "Logs/127.0.0.1-access.log" common </VirtualHost>
|
# # Add localhost rules, otherwise localhost can't use
The code is as follows |
Copy Code |
<virtualhost *:80> ServerAdmin webmaster@localhost.com DocumentRoot "e:/xampp/htdocs/" ServerName localhost ErrorLog "Logs/localhost-error.log" Customlog "Logs/localhost-access.log" common </VirtualHost>
|
# # Add wordpress.com rules, otherwise wordpress.com can't use
# # DocumentRoot for source directory
The code is as follows |
Copy Code |
<virtualhost *:80> ServerAdmin webmaster@wordpress.com DocumentRoot "E:/xampp/htdocs/wordpress" ServerName www.111cn.net ErrorLog "Logs/wordpress-error.log" Customlog "Logs/wordpress-access.log" common </VirtualHost>
|
# # Add discuz.com rules, otherwise discuz.com can't use
# # DocumentRoot for source directory
The code is as follows |
Copy Code |
<virtualhost *:80> ServerAdmin webmaster@discuz.com DocumentRoot "E:/xampp/htdocs/discuz" ServerName www.111cn.net ErrorLog "Logs/discuz-error.log" Customlog "Logs/discuz-access.log" common </VirtualHost>
|
4. After the restart of Apache, the public www.111cn.net