Home  >  Article  >  Operation and Maintenance  >  Steps to configure multi-site and multiple domain names in phpStudy

Steps to configure multi-site and multiple domain names in phpStudy

步履不停
步履不停Original
2019-06-10 14:20:028722browse

Steps to configure multi-site and multiple domain names in phpStudy

First, open the site domain name management. The configuration is as follows. You can set the website domain name and directory yourself. Reset the port to one other than 80. Then add it first and then save it.

Steps to configure multi-site and multiple domain names in phpStudy

Open the configuration file vhosts, and you will see the addition of port 801

Steps to configure multi-site and multiple domain names in phpStudy

In the configuration file http. conf, add a new port number after 80

Steps to configure multi-site and multiple domain names in phpStudy

and then configure it in the hosts file, 127.0.0.1 www.aaa.com

Steps to configure multi-site and multiple domain names in phpStudy

Then again, Mader GG, forbidden appears, 403, no access rights.

After a lot of effort, I finally found the solution. I will copy the content of the solution first, and finally attach the address of the original article.

First step

Add under the hosts file under C:\Windows\System32\drivers\etc (do not add the # sign in front, it is a comment)

Steps to configure multi-site and multiple domain names in phpStudy

The second step

Find the httpd.conf file under Apache and open it, remove the

Steps to configure multi-site and multiple domain names in phpStudy

in front of line 171

#The third step

In the apache configuration file vhosts.conf, configure the following content

Steps to configure multi-site and multiple domain names in phpStudy

Just restart Apache. . . . The domain name is assigned. .

There is another problem at this time

Steps to configure multi-site and multiple domain names in phpStudy

The browser displays a page like this

But when you enter www.test.com/index .php, you can access the index.php program

You need to write the full path. . . . How to break. . .

Comment out the 18 lines in the third step or add (plus sign) in front of the two words after options and then restart Apache to directly access www.test.com

This The problem is solved! ! ! !

There is another problem at this time

You can’t see the folders in index.php directly. . . I skipped it directly, so what?

No problem, just go and visit.

Open httpd.conf at this time, comment out line 251, and the problem will be solved (sometimes you don’t need to comment out, it depends on your own situation)

It seems to be a static website Annotations are required, but not for dynamic websites.

Steps to configure multi-site and multiple domain names in phpStudy

Add another sentence and bring the port when accessing, such as: http://www.aaa.com:801/

Okay, happy programming

Recommended tutorial: phpStudy quick entry video tutorial

The above is the detailed content of Steps to configure multi-site and multiple domain names in phpStudy. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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