`
gcgmh
  • 浏览: 348668 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

apache的配置参数

    博客分类:
  • PHP
阅读更多
一、DocumentRoot "/www/"
  DocumentRoot定义这个服务器对外发布的超文本文档存放的路径,客户程序请求的UR L就被映射为这个目录下的网页文件。这个目录下的子目录,以及使用
符号连接指出的文件和目录都能被浏览器访问,只是要在URL上使用同样的相对目录名。

二、ServerName new.host.name:80

三、DirectoryIndex:添加默认首页:
DirectoryIndex index.php index.php3 index.htm index.html

四:添加解析PHP的MIME类型:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

五、绑定多域名:

NameVirtualHost 192.168.11.11

<VirtualHost 192.168.11.11>

DocumentRoot /var/www/html/avnads

ServerName www.avnads.cn

</VirtualHost>

<VirtualHost 192.168.11.11>

DocumentRoot /var/www/html/britepic

ServerName www.britepic.org

</VirtualHost>

注意,以上www.avnads.cn和www.britepic.org最好设置为一些互联网上没有的域名!

重启httpd服务!

在客户端设置一下host文件:

192.168.11.11 www.avnads.cn

192.168.11.11 www.britepic.org

保存后,就可以打开浏览器访问www.avnads.cn和www.britepic.org了。







分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics