Alibaba Cloud server phpstudy builds multiple websites and configures multiple domain names

Preface

Many online tutorials are for configuring multi-site locally. Let me post a tutorial on configuring multi-site on the server and configuring domain name resolution .

Suppose our main domain name is tuziang.com and its directory is C:\phpStudy\PHPTutorial\WWW. Now we need to make another website, test.tuziang.com, whose directory is C:\phpStudy\PHPTutorial\WWW\test.

phpstudy

1. Open phpStudy, the "other options" where point click "Site Domain Settings'
Alibaba Cloud server phpstudy builds multiple websites and configures multiple domain names

2. See the following interface
Alibaba Cloud server phpstudy builds multiple websites and configures multiple domain names

Fill in the website domain name (test.tuziang.com), fill in www.test.tuziang.com as the second domain name, then select the website directory C:\phpStudy\PHPTutorial\WWW\test, then click [Add] , then click [Save settings and generate configuration files]
3. Then phpstudy will Automatically restart apache

The phpstudy on the server has been configured. Next, configure the domain name.

DNS

I use the Tencent Cloud domain name, so let's take a look at Tencent Cloud's second-level domain name resolution .

  1. Open the cloud analysis of Tencent Cloud console
    Alibaba Cloud server phpstudy builds multiple websites and configures multiple domain names

2. Open the red box in the figure below
Alibaba Cloud server phpstudy builds multiple websites and configures multiple domain names

3. Click Add Record
and then pay attention to whether the content in the red box is filled in incorrectly, because this will affect the success or failure of the entire second-level domain name resolution. Fill in the
record value with your server IP, which is the same as the value of the main domain name tuziang.com
Alibaba Cloud server phpstudy builds multiple websites and configures multiple domain names

success

Well, everything is configured, and it will take effect after the domain name is resolved successfully.

Guess you like

Origin blog.csdn.net/qq_34626094/article/details/112979153