This article mainly introduces the method of phpStudy to configure multi-site, multi-domain name and multi-port. It has certain reference value. Those who are interested can learn about it.
This article introduces the method of phpStudy to configure multi-site, multi-domain name and multi-port. Port method, share it with everyone, and leave a note for yourself
There are three project directories under the WWW directory: a b c
Apache’s default httpd port is 80, website The directory is D:\WWW\a
1. Configure multiple domain names and multiple sites
Step 1: Click " Other options menu”=>Site domain name management=>Set the following three site domain names:
(1) Website domain name: a.com Website directory: D:\WWW\a Website port: 80
(2) Website domain name: b.com Website directory: D:\WWW\b Website port: 80
(3) Website domain name: c.com Website directory: D:\WWW\c Website port: 80
Save the configuration and generate the configuration file;
Step 2: Open hosts .txt file, add the following content at 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 that the configuration of multiple domain names and multiple sites is OK, the port has not changed and is 80
2. Configure multiple ports
The first step setting is changed to:
(1) Website domain name: a.com Website directory: D:\WWW\a Website port :80
(2) Website domain name: b.com Website directory: D:\WWW\b Website port: 81
(3) Website domain name: c. com Website directory: D:\WWW\c Website port: 82
The second step is the same as above
The third step: Open Configuration file httpd.conf, find the listening port location Listen 80, and add the content under it:
Listen 81
Listen 82
Restart the server , open the vhosts.conf configuration file and check whether there is the following content:
<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 Allow from all 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 Allow from all Require all granted </Directory> </VirtualHost>
If it exists, the configuration is successful.
The above is the detailed content of How to configure phpStudy for multi-site, multi-domain name and multi-port instances. For more information, please follow other related articles on the PHP Chinese website!