Last night, I was obsessive-compulsive and felt that my computer was very messy, so I reinstalled my system and took this opportunity to install a standalone development environment for PHP, which had previously been the integrated environment Wampserver.
You can't download the Apache server installation package on the official Apache website, only the Apache source code, which needs to be recompiled in VC++ and configured with a lot of stuff (a million horses are going through... ). So instead of using this method, you can find the Apache installer directly on the internet, here I used the 64-bit Apache HTTP server version 2.4 msi installer.
Once the installation is complete, let's test to see if Apache is installed successfully. Open your browser and type localhost, or 127.0.0.1 in the address bar, and also the ipv4 address on your own computer, all three inputs are possible. see that It works！ Then the installation is successful.
Change the default site location
above， We visit localhost time， What is used is Apache Installation directory hit the target htdocs Inside the folder index.html documents， this onehtdocs The folder is also known as Apache The default site location of the。 In the usual development， It's definitely not convenient to put it in this folder， Here's how we'll modify it。 It's also easy to modify， turn Apache Installation directory hit the target conf folder under the httpd.conf documents， modify DocumentRoot The back path because of Where you want to host your website， Immediately after the same modification below Directory The path in is the same as above. Remember to restart the Apache server each time you modify the Apache configuration file httpd.conf for the changes to take effect. In the new site location, we can create a new html file to test if the changes are successful.