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