我在Web上做了一个PHP+SQLServer的系统,现在打开首页必须输入IP地址+首页文件,如
210 .29.30.32\index.php,如我只输入IP地址,客户端可看见服务器上的php文件,安全性太差, 而我现在想直接输入IP地址即可打开首页,但不知如何实现,请Help

解决方案 »

  1.   

    在httpd.conf文件修改<Directory />模块,将browsable选项去掉。
    然后加上
    DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.cgi给你个例子看:
    <Directory />
     Options FollowSymLinks
     AllowOverride None
    </Directory><Directory "/usr/local/ag/VVServer/wwwroot">
        Options None
        AllowOverride None    Order allow,deny
        Allow from all    php_value include_path /usr/local/ag/VVServer/phpinc:/usr/local/ag/VVServer/phplib
        php_value auto_prepend_file prepend.php3
        php_value magic_quotes-gpc Off
    </Directory>DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.cgi
      

  2.   

    还有一个很简单的方法:先在“ 站点属性 ”中 “文档” 里“启用默认文档”,添加index.php(inde.htm ·······),
    并将其提前;再将主页目录下你想要显示的主页文件命名位index.php (index.html ······