发布于 2016-02-05 12:23:32 | 613 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

Apache Web服务器

Apache是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件。


Apache虚拟目录和默认首页的设置,用apache做服务器的朋友必须要懂的。
虚拟目录
1.找到"conf/httpd.conf" 文件
2.在节点:<IfModule alias_module>里增加
Alias /aidd2008 "D:/php/web/aidd2008"
其中 aidd2008 是你想要访问的虚拟目录; D:/php/web/aidd2008 为物理路径,以[/]代替[\]"
我们就在</IfModule>后面接着加:
 
<Directory "D:/php/web/aidd2008"> 
Options Indexes MultiViews 
AllowOverride None 
Order allow,deny 
Allow from all 
</Directory> 

(*)aidd2008 为虚拟目录名称,一般不用在名称后加"/",若加入,每次都要在虚拟目录后输入"/"才能访问网站

 
Alias /gt "D:/PHP/gt" 
<Directory "D:/PHP/gt"> 
  <IfModule php5_module> 
    <Files "index.php"> 
      php_admin_flag safe_mode off 
    </Files> 
  </IfModule> 
  AllowOverride AuthConfig 
  Order allow,deny 
  Allow from all 
</Directory> 


3.重启Apache

设置默认页面
方法1 设置全局的:
 
<IfModule dir_module> 
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml default.php 
</IfModule> 

方法2 针对某一目录可以这么设置:
 
Alias /aidd2008 "D:/php/web/aidd2008" 
<Directory "D:/php/web/aidd2008"> 
Options Indexes MultiViews 
AllowOverride None 
Order allow,deny 
Allow from all 
DirectoryIndex default.php 
</Directory> 



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务