最新下载
热门教程
- 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就可以了哦。
相关文章
- 奥比岛梦想国度卡死闪退有哪些解决方法 04-30
- DNF手游骨戒在哪个位置 04-30
- 回望羊驼:当利空成为短暂的财富密码 04-30
- 为什么每个 Web3 项目都逃不过 DEX? 04-30
- HashKey Exchange 虚拟资产保险覆盖规模登顶全球第一 04-30
- HTX DeepThink:冲上$95,000后,等待比特币的是什么? 04-30