Apache does not provide installation packages for Windows, but they have links to third parties on their official website, and we can find binary packages for Windows on those third-party websites.
We'll go in. Download a 64-bit,
After downloading, we extract the downloaded compressed files to any directory, this machine is as follows:
Then we open the Conf folder under the HTTPD.CONF, modify the following line, the Svroot modified to the above path
Then open the Administrator's Command line window execution, Apache path self-modification:(here to pay attention to command output information, there is a hint error please modify, otherwise the service will not start)
C:\Users\ASUS\Apache24\bin\httpd.exe-k Install "Apache2.4"-F "C:\Users\ASUS\Apache24\conf\httpd.conf"
After executing the above command, we installed the Apache service, next, open the ApacheMonitor.exe in the bin directory.
If the icon in the taskbar is not green, right-click the icon, select Open Services, and then locate Apache2.4, right-click the line, and select Start.
And then it's OK.
In addition, we can set Apachemonitor boot start (self-search)
Add PHP Parsing: Add the following configuration at the top of the httpd.conf file:
AddHandler application/x-httpd-php. Phpaddtype application/x-httpd-php. php. Htmlloadmodule php7_module "C:\Users\ Asus\php-7.1.13\php7apache2_4.dll "Phpinidir" C:\Users\ASUS\php-7.1.13 "
The above C:\Users\ASUS\php-7.1.13 is the PHP installation directory of this machine, please change it yourself
Modify the following lines: entry file add index.php
<ifmodule dir_module> directoryindex index.php index.html</ifmodule>
Then restart Apache.
Attached: Apache2.4 Example Vhost configuration:
<virtualhost *:80> ServerAdmin [email protected] documentroot "C:\Users\ASUS\project\test1" ServerName test1.local serveralias test1.local errorlog "Logs/test1.local-error.log" Customlog " logs/ Test1.local-access.log "Common <directory c:\users\asus\project\test1>options Followsymlinksallowoverride Nonerequire All granted</directory></virtualhost>
Windows installs Apache service and adds PHP parsing