This article mainly introduced the Phpstudy configuration Multi-site multi-domain and the multi-port method, has the certain reference value, has the interest to be possible to understand
This article describes the Phpstudy configuration multi-site multi-domain and multiport method, share to everyone, but also to leave a note
The WWW directory has three project directories: a b C
Apache default httpd port is 80, Site Directory is D:\WWW\a
1. Configure multi-domain multi-site
The first step: click on the "Other options menu" +-site domain name management and set the following three site domain names:
(1) Website domain name: a.com Site Directory: D:\WWW\a website port: 80
(2) Website domain name: B.Com Site Directory: D:\WWW\b website port: 80
(3) Website domain name: c.com Site Directory: D:\WWW\c website port: 80
Save the configuration and generate the configuration file;
Step Two: Open the Hosts.txt file and add the following to the end of the file:
127.0.0.1 localmall.com
127.0.0.1 ynb.com
127.0.0.1 admintest.com
Restart Apache, so multi-domain multi-site Configuration OK, the port has not changed is 80
2. Configure multi-port
The first step setting changes to:
(1) Website domain name: a.com Site Directory: D:\WWW\a website port: 80
(2) Website domain name: B.Com Site Directory: D:\WWW\b website Port: 81
(3) Website domain name: c.com Site Directory: D:\WWW\c website port: 82
Step two Ibid.
Step three: Open the configuration file httpd.conf, locate the listening port location Listen 80, and add the following:
Listen 81
Listen 82
Restart the server and open the Vhosts.conf configuration file to see if you have the following:
<virtualhost *:80> documentroot "D:\WWW\a" ServerName a.com serveralias phpstudy.net < Directory "D:\WWW\a" > Options followsymlinks execcgi allowoverride all Order allow,deny allow From all Require all granted </directory></virtualhost><virtualhost *:81> documentroot "D : \www\b " ServerName b.com serveralias <directory" D:\WWW\b "> Options followsymlinks execcgi allowoverride All Order allow,deny- Require all granted </Directory> </virtualhost><virtualhost *:82> documentroot "D:\WWW\c" ServerName c.com Serveralias <directory "D:\WWW\c" > Options followsymlinks execcgi allowoverride all Order allow,deny to all Require all Granted </Directory></VirtualHost>
If present, the configuration is successful.