Home > Backend Development > PHP Tutorial > How to configure phpStudy for multi-site, multi-domain name and multi-port instances

How to configure phpStudy for multi-site, multi-domain name and multi-port instances

黄舟
Release: 2023-03-15 17:46:01
Original
3056 people have browsed it

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>
Copy after login

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!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
docker install phpstudy
From 1970-01-01 08:00:00
0
0
0
phpStudy installation problems
From 1970-01-01 08:00:00
0
0
0
How to set up phpstudy ssl
From 1970-01-01 08:00:00
0
0
0
phpstudy installs php7.3
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template