About Windows cannot start Apache2 (phpstudy) in the local calculator _linux

Source: Internet
Author: User
Tags error code
After Baidu, see the same shoes hint to modify the \phpstudy\apache2\conf\ in the httpd.conf file, the code is as follows

Copy Code code 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: As a result of the code conflict problem, please change the above double title number to a single title number

When you restart Apache after adding the above code at the bottom of the httpd.conf file, prompt the following:

Windows cannot start Apache2 on the local calculator. For more information, check the system event log. If this is a non-Microsoft service, contact your service manufacturer and refer to the specific service error code 1.
It's a bitter force. I thought it was a computer problem and I reinstalled the phpstudy. After reinstalling, you can start Apache, but this problem occurs again after you add the above code. At this point, I thought there was something wrong with the code you added. After I deleted a restart of manual labor, there was a major discovery:

After deleting the "allowoverride All" code, Apache can be restarted and the domain name is open. I did not study the use of this code, only know that after the deletion can be used.

phpstudy a virtual host with multiple domain names configured locally

After starting Apache2, another problem was encountered: multiple sites could not be opened, prompting 403 error.

I checked on one line of code that was not commented out in the httpd.conf file. After checking and comparing with the online tutorials, I found a problem:

#Include conf/extra/httpd-vhosts.conf the annotation symbol "#" in front of this code is not deleted. The purpose of this code is to open the Httpd-vhosts virtual host file. Once this step is complete, restart Apache so that you can completely open each local domain address.

Note: After modifying the httpd.conf file, you also need to modify the Hosts file to add the local virtual domain name (the reason and in the space DNS resolution to IP is a truth).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.