Apache配置虚拟目录,以及各种操作
apache配置虚拟目录:
打开并创建虚拟目录的步骤如下:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
去掉conf/http.conf文件中:
#Include conf/extra/httpd-vhosts.conf
前面的"#" (实际上是去掉注释) ,
若果想要配置多个虚拟目录的话,在httpd.conf中搜索“ NameVirtualHost ” ,如果没有的话加上一句:NameVirtualHost *:80
NameVirtualHost *:80
#NameVirtualHost localhost:8001
<VirtualHost *:80>
ServerName *
DocumentRoot "E:/APMserv/APMServ5.2.6/www/htdocs"
<Directory "E:/APMserv/APMServ5.2.6/www/htdocs">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
然后若conf下面没有extra/http-vhosts.conf这个文件则创建,最后在里面添加如下代码:
<VirtualHost *:80>
ServerAdmin zhangpengdzs@adsit.cn
DocumentRoot "E:\APMserv\APMServ5.2.6\www\htdocs\php\WeiXinApp\LivingartistApp\www"
ServerName my.phpwxapp.com
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "E:\APMserv\APMServ5.2.6\www\htdocs\php\WeiXinApp\LivingartistApp\www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin zhangpengdzs@adsit.cn
DocumentRoot "E:\APMserv\APMServ5.2.6\www\htdocs\solomo\www\test\php"
ServerName my.phptest.com
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "E:\APMserv\APMServ5.2.6\www\htdocs\solomo\www\test\php">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
表示添加了 my.phpwxapp.com 和 my.phptest.com 两个虚拟域名,最后在 系统C盘下面找到hosts文件,
在里面添加:
127.0.0.1 my.phpwxapp.com
127.0.0.1 my.phptest.com
最后重启Apache服务应该就可以了。
Apache多站点多IP配置:http://blog.chinaunix.net/uid-18933439-id-2808715.html
posted on 2014-02-21 18:35 andydaopeng 阅读(602) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)