最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Apache建立虚拟目录几个例子
时间:2022-06-30 18:02:33 编辑:袖梨 来源:一聚教程网
进入httpd.conf
在节点:
增加
Alias /php "E:/localhost/test"
其中 php是你想要访问的虚拟目录,E:/localhost/test为物理路径
因为Apache默认的不能访问的,所以要加一个配置。
我们就在后面接着加:
| 代码如下 | 复制代码 |
|
|
|
保存后,重新启动apache
例子
| 代码如下 | 复制代码 |
|
Alias /3DModelProject "E:/3DModelProject"
Alias /109ChemistrySharedFolder "E:/109ChemistrySharedFolder"
|
|
设置默认页面
方法1 设置全局的:
| 代码如下 | 复制代码 |
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml default.php |
|
方法2 针对某一目录可以这么设置:
| 代码如下 | 复制代码 |
|
Alias /anstyla "E:/anstyla/src/web" |
|
除了上面办法我们还有一个配置方法比较方便了,我们在apache配置文件httpd.conf找到
#Include conf/extra/httpd-vhosts.conf
我们把前面的#去掉
Include conf/extra/httpd-vhosts.conf
然后再把我们的网站目录直接写到这里httpd-vhosts.conf文件中。
| 代码如下 | 复制代码 |
|
|
|
最后重启动apache就可以了哦。
相关文章
- 巨神军师蜀国核心阵容是什么 12-10
- 阿凡达潘多拉边境萌芽守护者全收集攻略 菌丝网络位置大全 12-10
- 夜幕之下提线人队伍如何搭配 12-10
- 阿凡达潘多拉边境怎么收武器 武器收回按键介绍 12-10
- 阿凡达潘多拉边境数据采集站位置全收集攻略 12-10
- 暗喻幻想全角色介绍 全人物图鉴一览 12-10