After Baidu, the httpd. conf file in \ phpStudy \ Apache2 \ conf \ is prompted to be modified. The Code is as follows:
Copy codeThe Code is as follows: <VirtualHost *: 80>
ServerAdmin webmaster@163.com
DocumentRoot "D: \ www"
ServerName ymywz.com
Options Indexes FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all
</VirtualHost>
Note: Due to code conflicts, please change the above double book name number to a single book name number
After you add the above Code at the bottom of the httpd. conf file and restart Apache, the following message is displayed:
Windows cannot start Apache2. For more information, see System Event Logs. If this is a non-Microsoft Service, contact the service provider and refer to service error code 1.
I thought it was a computer problem and I re-installed phpstudy. Apache can be started after the installation is re-installed, but this problem occurs again after the above Code is re-added. At this point, I think there is a problem with the added code. After I deleted a manual reboot, I found that:
After deleting the code "AllowOverride All", Apache can restart and the domain name is opened. I have not studied the usage of this Code. I only know that it can be used after deletion ······
Phpstudy local virtual host with multiple domain names
After starting Apache2, another problem occurs: the multi-site cannot be opened and the error 403 is displayed.
I checked against a line of uncommented code in the httpd. conf file. After checking and comparing with online tutorials, we found a problem:
# Include conf/extra/httpd-vhosts.conf the annotator "#" in front of this Code is not deleted. The purpose of this Code is to enable the httpd-vhosts VM file. After this step is completed, restart Apache to completely open the local domain names.
Note: After modifying the httpd. conf file, you also need to modify the hosts file to add a local virtual domain name (the principle is to resolve the domain name dns to the IP address in the space ).