第七步:配置Apache。
1、 进入Apache所在目录,找到打开Apache2\conf\httpd.conf文件,查找以下内容:
# If your host doesn''t have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName 127.0.0.1:8080
【提示】如果你需要改服务器的IP,则修改上面红色代码即可(修改127.0.0.1为你服务器IP地址并确认web端口
2、 继续查找以下内容:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "D:/apache2/htdocs"
【提示】如果你想改变放置运行JSP文件的目录,就将上面红色的代码修改为: DocumentRoot "盘符:/路径",注意,要使用"/"而不是"\"。
3、 最后查找下面内容:
#Listen 12.34.56.78:80
Listen 8080
【提示】如果你想修改Apache的监听端口,就在这里进行。
OK,到这里就算完成了。因为简单的说来,配置Apache就是配置httpd.conf文件。如果你想进行更详细深入的配置,请自行查阅相关文章,这里不再一一列举。