apache安装与配置
安装步骤
双击下载的文件进行安装,出现Apache HTTP Server 2.2 - Installation Wizard的安装向导。首先是欢迎页。

点击【Next】,出现协议页License Agreement。

同意协议,选择I accept the terms in the license agreement后,点击【Next】,出现Read This First页。

请仔细阅读协议,点击【Next】,出现Server Information。
- Network Domain——本台服务器的域名;
- Server Name——本台服务器的名字;
- Administrator's Email Address——服务器的管理员的邮件地址,当系统出现问题时提供给访问者。
以上信息无效也可以。- for All Users, on port 80, as a Service -- Recommended.——为系统所有用户安装,使用默认的80端口,作为系统服务自动启动。
- only for the Current User, on Port 8080, when started Manually.——仅为当前用户安装,使用8080端口,需要手动启动。

填写相应信息如下
- Network Domain——localhost;
- Server Name——localhost;
- Administrator's Email Address——填自己的随便一个邮箱就行;
- 选择for All Users, on port 80, as a Service -- Recommended.

点击【Next】,进入安装选项。
- Typical——典型安装;
- Custom——自定义安装。

选择Custom自定义安装后,点击【Next】,进入自定义安装,可以选择安装内容及安装位置。

单击Apache HTTP Server 2.2.25后选择This ferture, and all subfeatures, will be installed on local hard drive。
然后根据自己的磁盘安装情况选择安装路径。

点击【Next】,出现准备安装页。

确认无误后点击【Next】,开始Apache的安装。

等待安装完成之后,显示安装完成的提示。

点击【Finish】,完成Apache的安装。
Apache测试
安装完成Apache服务器后,需要进行一个测试是否可以使用。
安装完成后在【通知区域】(默认在右下角)有如下图标,就是Apache的服务器的图标。

左键点击图标,如下图所示,【start】显示为灰色,证明已经启动了服务。

如果Apache没有启动,则显示如下。

打开浏览器输入127.0.0.1,如果显示 It works!,恭喜你,一切都成功了。

配置文件
进入刚才安装的apache项目路径,在conf目录下找到httpd文件,用文本编辑器打开。全局搜索DocumentRoot
和<Directory>
,大概位置在180行和200行左右,将其配置为自己web项目路径,如下图:

修改完成后,重启apache,然后访问localhost即可~