Apache2.4 安装

1. 下载Apache

  Apache是一款开源的Web服务软件。我们可以直接到官网上下载到最新的Apache源码。这里我使用的是httpd-2.4.33。官方下载链接:https://www.apachelounge.com/download/

  将下载的httpd-2.4.33-win64-VC15.zip文件进行解压。

2. 配置Apache

2.1 修改ServerRoot

  将ServerRoot修改成解压后的路径,默认值为:ServerRoot "c:/Apache24"

//修改成解压后的路径,这里我的路径是:"E:/Http/Apache/httpd-2.4.33-win64-VC15/Apache24"
ServerRoot "c:/Apache24"	修改成		ServerRoot "E:/Http/Apache/httpd-2.4.33-win64-VC15/Apache24"

2.2 修改DocumentRoot

  将DocumentRoot修改成解压后的相应路径,默认值为:DocumentRoot "c:/Apache24/htdocs"

//修改成解压后的路径,这里我的路径是:"E:\Http\Apache\httpd-2.4.33-win64-VC15\Apache24\htdocs"
DocumentRoot "c:/Apache24/htdocs"	修改成		DocumentRoot "E:\Http\Apache\httpd-2.4.33-win64-VC15\Apache24\htdocs"
	修改成		

2.3 配置服务器域名(非必须)

  你可以选择去配置服务器域名和端口。默认的端口为:80。原型被注释掉,去掉注释。这里我们没有改变服务器域名或端口号。当然也可以根据需要进行指定。

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName www.example.com:80

2.4 修改默认端口号(非必须)

  Apache默认的端口号为80,如果你80端口号已经被占用或想改变默认端口,可以进行此项修改。这里我们没有进行修改。

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the 
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

3. 安装

  打开window命令提示符(管理员):进入到相对路径:httpd-2.4.33-win64-VC15\Apache24\bin中

  运行命令:

httpd.exe -k install

Apache2.4 安装_第1张图片

4. 测试

  在浏览器中输入:http://localhost/,显示:It Works!

5. 启动和关闭

//停止
net stop Apache2.4
//启动
net start Apache2.4

你可能感兴趣的:(MySQL)