部署php网站时httpd.conf的一些小配置

来源:互联网 发布:淘宝点发布没反应 编辑:程序博客网 时间:2024/06/16 09:34

部署php网站时httpd.conf的一些小配置

上一篇 / 下一篇  2008-11-18 15:25:31 / 个人分类:lamp

查看( 109 ) / 评论( 2 ) / 评分( 0 / 3 )

  全局的首页。

<IfModule dir_module>

    DirectoryIndex   index.html   index.htm   index.php

</IfModule>

 

不同网站的首页

<Directory "D:/appserv/www/test1">

  DirectoryIndex   index.php

</Directory>

 

<Directory "D:/appserv/www/test2">

  DirectoryIndex   default.php

</Directory>

建立虚拟目录
WK0d|8B/N1`0Alias /abc "E:/website"                                                  //"abc"是虚拟目录的名称爱好者博墅"WW6F/JV)H
<Directory "E:/website">                                               //"E:website"是物理路径
O%s1}ue/E4br`5`0        Options Indexes MultiViews爱好者博墅.Z5N*v2fT7}W
        AllowOverride None
vwu F%g5N.u3J0        Order allow,deny
tx0G| x/w0P_~J$tN0        Allow from all
]6| f } ~dVs0        DirectoryIndex  default.php爱好者博墅 eo)h3N L&wH8uS.s
</Directory>

多ip指定不同目录(建立虚拟主机)

<VirtualHost  192.168.1.5>                                                    //这里写要绑定的ip爱好者博墅BD;nt*Vp_S8ku#g
         DocumentRoot D:/appserv/www/webshow1           //这里是绑定到的目录
Ql!lxZ[0         DirectoryIndex index.htm index.html index.php      爱好者博墅3NY)k'B5n/
</VirtualHost>

<VirtualHost  192.168.1.6>爱好者博墅/}B3z c&t Z]q'JB
         DocumentRoot D:/appserv/www/webshow2
9h7aURs6mzrW0         DirectoryIndex index.htm index.html index.php
9M{-vpy0</VirtualHost>

相同ip,不同端口访问不同网站:

Listen:80

Listen:8891

爱好者博墅p7l3n&v.U
NameVirtualHost 192.168.1.2:80

<VirtualHost 192.168.1.2:80>爱好者博墅UO ~jD)@f
 DocumentRoot        ../htdocs/www
m:yyD_0 ServerName             www.******.com爱好者博墅s w Ql(g L3}3d
</VirtualHost>

NameVirtualHost 192.168.1.2:8891

<VirtualHost 192.168.1.2:8891>爱好者博墅:p)_f)jC8h0z(^
 DocumentRoot          ../htdocs/pma
Q4N!s,HN1~']WE0 ServerName               www.******.com
+A'i0Q/y6{q6Vxd0</VirtualHost>


m-E?(o/q+sI0一个ip,多个域名爱好者博墅*H%`/#Vw S+o H5}M
NameVirtualHost *:80
5r~T]LYj0爱好者博墅%q/n4r3w Z
<VirtualHost *:80>
[#D*mR]$`5n0      ServerAdmin webmaster@*.com.cn爱好者博墅f8O"az:CR3DN
      ServerName bbs.*.com.cn爱好者博墅2l wg3^/qC7k-Vd1W
      ServerAlias bbs.*.com.cn爱好者博墅h'];n ]]jn
      DocumentRoot "e:/web"爱好者博墅MVC n n(M
</VirtualHost>爱好者博墅!`5]:kJm
爱好者博墅uIu8@r!L6X~?0i4Um
<VirtualHost *:80>爱好者博墅6J.S ~V!S]3yS{W
        ServerAdmin webmaster@*.com.cn爱好者博墅wz IEc.g
        ServerName blog.*.com.cn爱好者博墅 IZ/V ].J6N S T1l#@+i
        ServerAlias blog.*.com.cn *.blog.*.com.cn爱好者博墅6X/zNbf%|K
        DocumentRoot "e:/web/SupeSite"爱好者博墅p8OeZ)O*CD?"s)WXI
</VirtualHost>

 

参考网站:

http://www.ithov.com/Server/Website/Web/79178.shtml

原创粉丝点击