This article mainly introduces the detailed installation and configuration tutorial of Windows Apache2.4 VC9 (ApacheHaus). Friends in need can refer to
1, Apache download
Select a version and click Download
##Click File For Microsoft Windows Since Apache HTTP Server is not officially A binary (executable) distribution is provided, so we choose the version compiled by some contributors. We choose the first ApacheHausClick ApacheHaus to enter the download page Choose one of the versions. If your Windows has not installed the corresponding VC environment, select the corresponding VCRedistribute version to download and install. I chose Apache 2.4VC9 version because the VC9 environment is already installed on my computer. Click on a version in the first line under JumpLinks to download the corresponding compressed package. 2, configure one of Apache--httpd.confAfter decompressing, enter the Apache22 (the last two digits may be different) folder, and use a text editor (ultraedit is recommended) to open the conf file Find the ServerRoot option in the httpd.conf configuration file in the folder , set the Apache directory, about line 35, change it to the folder of your Apache program, for example:ServerRoot "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22"
DocumentRoot "F:/"
<Directory "F:/"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory>
ScriptAlias /cgi-bin/ "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/cgi-bin"
<Directory "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory>
3, configure Apache 2--ssl configuration
If you start the service like this, the following message dialog will generally appear Box: PromptWindows cannot start Apache2.2 on the local computer. For more information, consult the system log files. If this is a non-Microsoft service, please contact the vendor and refer to the specific server error code 1. Determine the cause of this problem: Right-click the computer, click Manage->Windows Log->Applications, the following is displayed<VirtualHost _default_:443> SSLEngine on ServerName localhost:443 SSLCertificateFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/server.crt SSLCertificateKeyFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/server.key DocumentRoot F:/ # openssl req -new > server.csr # openssl rsa -in privkey.pem -out server.key # openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 2048 <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "/Apache22/cgi-bin"> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-5]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/logs/ssl_request.log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" </virtualhost>
<VirtualHost *:443> SSLEngine on ServerName serverone.tld:443 SSLCertificateFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/serverone.crt SSLCertificateKeyFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/serverone.key DocumentRoot F:/ # openssl req -new > serverone.csr # openssl rsa -in privkey.pem -out serverone.key # openssl x509 -in serverone.csr -out serverone.crt -req -signkey serverone.key -days 2048 <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "/Apache22/cgi-bin"> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-5]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/logs/ssl_request.log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=HTTPS </virtualhost>
<VirtualHost *:443> SSLEngine on ServerName servertwo.tld:443 SSLCertificateFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/servertwo.crt SSLCertificateKeyFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/servertwo.key DocumentRoot F:/ # openssl req -new > servertwo.csr # openssl rsa -in privkey.pem -out servertwo.key # openssl x509 -in servertwo.csr -out servertwo.crt -req -signkey servertwo.key -days 2048 <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "/Apache22/cgi-bin"> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-5]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/ssl_request.log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" </virtualhost>
As an administratorEnter the bin folder under the Apache program folder and enter httpd -k install to complete the installation of the Apache service.
Then double-click ApacheMonitor.exe in the bin directory, click start on the right to start the server, if normal, as shown below: Test it:5, others
Uninstall Apache HTTP Server:
Enter the bin directory as an administrator and use httpd -k uninstall to remove the service
Using the httpd -w -n "Apache2" -k start command to start the server can display the logs during the startup process to facilitate error analysis.
The above is the detailed content of Detailed explanation of Windows Apache2.4 VC9 (ApacheHaus) installation tutorial. For more information, please follow other related articles on the PHP Chinese website!