1.首先,若有如下URL:
http://222.31.76.209/test.php
其中222.31.76.209是服务器的IP,但其并非指向服务器的根目录,而是一个相对路径,具体所指目录要在/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"
所以这里的http://222.31.76.209/test.php实际指的是服务器中的/var/www/html/test.php。这一点一定要清楚,否则总以为传到了服务器相应文件夹下,通过URL却无法访问到~