Apache配置文件
Apache的配置文件默认路径是“/etc/httpd/conf/httpd.conf”,编辑该文件就能够修改Apache的配置
一、设置网页主目录,参数DocumentRoot就是网页存放的主目录。打开配置文件httpd.conf,查找DocumentRoot(大约292行)
[root@localhost ~]# gedit /etc/httpd/conf/httpd.conf
# 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 "/var/www/html" //当前默认是在"/var/www/html"目录下,全部的网页必须放在这里
二、设置链接端口,经过参数listen来设置链接的端口,默认80.(大约136行)
[root@localhost ~]# gedit /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 <VirtualHost>
# 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 80html