How to Use dedeampz to create a local test for multiple sites
Namevirtualhost *: 80
# Vhoststart
# The default site settings here. If the IP address of an unknown domain name is the same as that of the server, it will also point to this site
# If you want to access your service through an IP address or illegal domain name, set the directory of the site to a non-existent directory.
<Virtualhost *: 80>
Serveradmin admin@myhost.com
DocumentRoot "D:/dedeampz/webroot/Default"
Php_admin_value open_basedir "D:/dedeampz/webroot/Default"
Servername localhost
Errorlog logs/default-error_log
Customlog logs/default-access_log common
</Virtualhost>
# Here is an example of setting up a virtual host (running multiple sites on the server)
# If you want to add a website, copy the following configuration and modify the Directory and domain name.
<Virtualhost *: 80>
Serveradmin admin@myhost.com
Servername www.test.com
Serveralias test.com
DocumentRoot "D:/dedeampz/webroot/test.com"
Php_admin_value open_basedir "D:/dedeampz/webroot/test.com"
Errorlog logs/all-error_log
Customlog logs/all-access_log common
</Virtualhost>
# Vhostend
If you only debug one website, you do not need to add a VM to directly decompress Wordpress to "dedeampz \ webroot \ default"
If you want to debug multiple websites in this environment, you can add virtual hosts as instructed. Note the following:
Servername www.test.com
# You can enter the domain name of your VM. You can change the host file later.
Serveralias test.com
# Remove the host name, which must be the same later
DocumentRoot "D:/dedeampz/webroot/test.com"
# The path of your Vm, where you install it
Php_admin_value open_basedir "D:/dedeampz/webroot/test.com"
# Same as above
Attach a copy of my configuration file for reference
Namevirtualhost *: 80
# Vhoststart
# The default site settings here. If the IP address of an unknown domain name is the same as that of the server, it will also point to this site
# If you want to access your service through an IP address or illegal domain name, set the directory of the site to a non-existent directory.
<Virtualhost *: 80>
Serveradmin admin@myhost.com
DocumentRoot "D:/dedeampz/webroot/Default"
Php_admin_value open_basedir "D:/dedeampz/webroot/Default"
Servername localhost
Errorlog logs/default-error_log
Customlog logs/default-access_log common
</Virtualhost>
# Here is an example of setting up a virtual host (running multiple sites on the server)
# If you want to add a website, copy the following configuration and modify the Directory and domain name.
<Virtualhost *: 80>
Serveradmin admin@myhost.com
Servername www.test.com
Serveralias test.com
DocumentRoot "D:/dedeampz/webroot/test.com"
Php_admin_value open_basedir "D:/dedeampz/webroot/test.com"
Errorlog logs/all-error_log
Customlog logs/all-access_log common
</Virtualhost>
<Virtualhost *: 80>
Serveradmin admin@myhost.com
Servername www.wp.com
Serveralias wp.com
DocumentRoot "D:/dedeampz/webroot/wp.com"
Php_admin_value open_basedir "D:/dedeampz/webroot/wp.com"
Errorlog logs/all-error_log
Customlog logs/all-access_log common
</Virtualhost>
# Vhostend
I added a web hosting www.wp.com.
Next, you need to modify the local host file. You need to direct the Domain Name of the VM you added to your computer. Add the following to my host file:Code
127.0.0.1 www.test.com
127.0.0.1 www.wp.com
Then, place a webpage file such as test.html in D: \ deampz \ webroot \ wp.com.
Test entering the http://www.wp.com/test.html in the browser to see if access is normal.