XAMPP Create a Domain name virtual directory (PHP+APACHE+MYSQL)

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.