步骤三 打开主配置文件并加以修改 [root@localhost ~]#vi
/etc/httpd/conf/httpd.conf
#
# Listen: Allows you to bind Apache to specific IP addresses
and/or
# ports, in addition to 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
(0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Listen
8888 #添加端口号8888
Listen 6666
#
# DirectoryIndex: sets the file that Apache will serve if a
directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver
content-
# negotiated documents. The MultiViews Option can be used for
the
# same purpose, but it is much slower.
#
DirectoryIndex index.html
index.html.var apache.html #指定主目录
# AccessFileName: The name of the file to look for in each
directory
# for additional configuration directives. See also the
AllowOverride
# directive.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost
container.
# The first VirtualHost section is used for requests without a
known
# server name.
#
#
# DocumentRoot
/www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog
logs/dummy-host.example.com-error_log
# CustomLog
logs/dummy-host.example.com-access_log common
# #IP-besed
DocumentRoot
/var/www #虚拟目录路径
路径