*****httpd.conf********
#配置虚拟目录
<IfModule dir_module>
DirectoryIndex Default.html index.html index.htm index.php
Alias /Web "\\192.168.10.5\Web"
<Directory \\192.168.10.5\Web>
order allow,deny
Allow from all
</Directory>
</IfModule>******httpd-vhosts.conf**********
#配置虚拟主机
<VirtualHost 192.168.1.203:80>
DocumentRoot "\\192.168.10.5\Web"
DirectoryIndex Default.html my.html index.html index.htm index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>请问红色字体中的路径能用局域网中的共享路径吗?能的话又该怎么设置呢?
#配置虚拟目录
<IfModule dir_module>
DirectoryIndex Default.html index.html index.htm index.php
Alias /Web "\\192.168.10.5\Web"
<Directory \\192.168.10.5\Web>
order allow,deny
Allow from all
</Directory>
</IfModule>******httpd-vhosts.conf**********
#配置虚拟主机
<VirtualHost 192.168.1.203:80>
DocumentRoot "\\192.168.10.5\Web"
DirectoryIndex Default.html my.html index.html index.htm index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>请问红色字体中的路径能用局域网中的共享路径吗?能的话又该怎么设置呢?
解决方案 »
- 上传xls文档,其中一个列的值太长,读取到的变成科学计数法,详细见内容
- 怎样读取php文章中所有的图片
- centos 5.x 下 php 连接不了 mysql 单独访问 mysql 没有问题 高分求解
- php难题。。。高手帮帮忙
- 用preg_match,截取网址,传递参数不成功,请问下药如何修改?
- Apache+PHP如何防止流媒体盗链?
- 调用本类的方法却提示我Call to undefined function..新手求教
- 请教,如何把下面数组用递归算法,显示一棵树?
- js中 设置参数(id ),传值
- 火狐浏览器如何无法调试js
- php 数组的处理 用一个数组的键做宁一个数组的键
- 数据库更新某整数字段最小的一条数据, 怎么写?
你看看吧,狀況類似
Apache HTTP Server安装好后,默认的站点目录位于其安装目录下的htdocs文件夹内,默认首页是该文件夹的index.html文件。比如,我的Apache是安装在C:/wamp/bin/apache/Apache2.2.21内,那么我的Apache的完整的默认站点目录地址就是C:/wamp/bin/apache/Apache2.2.21/htdocs/,默认首页就是C:/wamp/bin/apache/Apache2.2.21/htdocs/index.html。
很多时候,不管是学习、测试,还是想真正的搭建自己的站点,我们可能并不想把自己的网站放在Apache默认的站点目录下,这时,本节的知识将会帮助你解决这个问题。
修改方法:
1、到Apache的安装目录下找到conf文件夹,该文件夹内会httpd.conf这样一个文本文档,它是Apache的配置文件,负责指挥Apache的运行。
2、双击打开httpd.conf这个文本文档,按下键盘上的Ctrl+F组合键查找“DocumentRoot "”(带英文双引号",见图),查找出来之后(仅有一处),将字符串“DocumentRoot”后面双引号内的字符串修改为自己想要设定的网站目录。
如:默认为DocumentRoot "C:/wamp/bin/apache/Apache2.2.21/htdocs",现修改成DocumentRoot "D:/Apache"
图2:查找“DocumentRoot "”字符串
3、完成上述第2步之后,暂不要关闭httpd.conf文件,继续查找,查找“<Directory "”(带英文双引号",见图3),查找到“<Directory "”之后,将第一个“Directory”字符串后面双引号内的字符串修改为自己想要设定的网站目录。
如:默认为<Directory "C:/wamp/bin/apache/Apache2.2.21/htdocs">,现修改成<Directory " D:/Apache">
图3:查找“<Directory "”字符串
4、同时按下键盘上的Ctrl+S组合键保存上述修改,一定记得要停止(STOP)一次Apache服务然后再启动(START),使刚刚的修改生效。二、添加一个Apache的默认站点目录编辑http.conf文件,在文件末尾添加如下几行,其中wly是你的虚拟目录名,E:/Apache是你的真实目录名。
Alias /wly "E:/Apache"
<Directory "E:/Apache">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
保存后重启Apache。
现在有两台服务器,我想在服务器A安装Apache程序,然后在服务器B建立虚拟目录文件夹并共享,再在服务器A的Apache配置文件中将虚拟目录的路径指向服务器B的共享路径。
Alias /wly "E:/Apache" ***"E:/Apache"把这个路径改局域网共享路径***
<Directory "E:/Apache"> ***"E:/Apache"把这个路径改局域网共享路径***
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>