Apache 建立虚拟目录和设置默认页面
2008-04-21 03:43
609 查看
1.找到"conf/httpd.conf" 文件
2.在httpd.conf里面加了如下语句
Alias /anstyla "E:/anstyla/src/web"
<Directory "E:/anstyla/src/web">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
在此模块下建立虚拟目录,Alias /虚拟目录名称/ "虚拟目录路径,以[/]代替[/]"
例如:Alias /admin "D:/web/admin/"
(*)/admin 为虚拟目录名称,一般不用在名称后加"/",若加入,每次都要在虚拟目录后输入"/"才能访问网站;D:/web/admin/ 为虚拟目录的物理路径.
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 /anstyla "E:/anstyla/src/web"
<Directory "E:/anstyla/src/web">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex default.php
</Directory>
=====================================================
Apache 用的少,怎么设置虚拟目录和默认页面老是忘了,今天记下先.
2.在httpd.conf里面加了如下语句
Alias /anstyla "E:/anstyla/src/web"
<Directory "E:/anstyla/src/web">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
在此模块下建立虚拟目录,Alias /虚拟目录名称/ "虚拟目录路径,以[/]代替[/]"
例如:Alias /admin "D:/web/admin/"
(*)/admin 为虚拟目录名称,一般不用在名称后加"/",若加入,每次都要在虚拟目录后输入"/"才能访问网站;D:/web/admin/ 为虚拟目录的物理路径.
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 /anstyla "E:/anstyla/src/web"
<Directory "E:/anstyla/src/web">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex default.php
</Directory>
=====================================================
Apache 用的少,怎么设置虚拟目录和默认页面老是忘了,今天记下先.
相关文章推荐
- Apache 建立虚拟目录和设置默认页面
- Apache 建立虚拟目录和设置默认页面
- Apache 创建虚拟主机目录和设置默认访问页面
- Apache 虚拟目录和默认首页的设置
- Apache服务器虚拟主机设置问题-如何使通过IP访问为默认的apache页面 <转载>
- 解决配置apache虚拟主机后,只能进入欢迎页面(默认欢迎页面),不能进入虚拟主机目录页面
- Apache虚拟目录和默认首页的设置
- 在apache中设置访问目录后进入的默认页面为index.php
- apache中设置访问目录默认页面为index.php
- 在apache-httpd 部署php 中设置访问目录后进入的默认页面为index.php
- Apache httpd.conf相关知识点--默认的开始页面、目录权限、虚拟主机
- 在apache中设置访问目录后进入的默认页面为index.php
- Apache 虚拟目录和默认首页的设置
- apache中设置访问目录后进入的默认页面为index.php
- Apache虚拟目录和默认首页的设置
- 在apache中设置访问目录后进入的默认页面为index.php
- Apache 虚拟目录和默认首页的设置
- 目录权限Apache httpd.conf相关知识点--默认的开始页面、目录权限、虚拟主机
- apache配置rewrite后,根目录启用.htaccess,总是跳转到apache默认欢迎页面。