wamp配置本地多站点。
2024-08-30 08:32:40
'
进入C:\wamp64\wamp64\bin\apache\apache2.4.37\conf\http.conf
首先确保httpd-vhosts.conf扩展文件引入进来了,部分版本默认是不引入 (Include conf/extra/httpd-vhosts.conf前面有#代表没有引入,把#去掉)
进入C:\wamp64\wamp64\bin\apache\apache2.4.37\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost.xyz #ServerName即是要添加的域名,在本例中也就是localhost.xyz ,如果别人访问这个域名,那么将被Apache自动解析到${INSTALL_DIR}/www
这个目录下,也就是本例中的DocumentRoot所指定的目录。
#ServerName(必须) 一定要是域名,可以百度域名格式(如果不是域名格式记得在URL后面加个/也可以)
ServerAlias localhost.com #Alias的中文意思就是别名,这里就相当于给localhost.xyz起个别名为localhost.com,可以是别的域名
#ServerAlias(非必须)一定要是域名,可以百度域名格式(如果不是域名格式记得在URL后面加个/也可以)
DocumentRoot "${INSTALL_DIR}/www" #站点根目录(必须)${INSTALL_DIR}/www替换成你的站点根目录
<Directory "${INSTALL_DIR}/www/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>
创建站点目录
创建你的站点目录
进入http-vhosts.conf
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost> # </VirtualHost>
<VirtualHost *:80>
ServerName text1.co //域名配置为text1.co
ServerAlias localhost.cn //域名别称为localhost.cn 访问localhost.cn等于访问text1.co
DocumentRoot "C:\wamp64\Demo\text1" //站点根目录为C:\wamp64\Demo\text1
<Directory "C:\wamp64\Demo\text1">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost> <VirtualHost *:80>
ServerName text2.co
ServerAlias localhost
DocumentRoot "C:\wamp64\Demo\text2"
<Directory "C:\wamp64\Demo\text2">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
打开浏览器,访问localhost.cn
原因:站点默认为index.php,用t1.php没有权限()
新建一个
写入
浏览器重新打开
成功了
e:/www/team
最新文章
- 【笔记】js parentsNode,lastChild,appendChild,insertBefore,nextSibling的意义及运用
- 在Spring tools suite中使用git 共享项目
- 【海岛帝国系列赛】No.2 海岛帝国:“落汤鸡”市的黑帮危机
- 设置myeclipse自动生成的author等注释
- Eclipse使用git最简易流程
- php生成雪花图像(不美观请见谅)
- [Swift]LeetCode236. 二叉树的最近公共祖先 | Lowest Common Ancestor of a Binary Tree
- L&#39;opzione di luce del puntatore laser
- LOJ 2991 「THUSC 2016」补退选——trie+线段树合并或vector
- BASIC GIT WORKFLOW
- 选择困难症的福音——团队Scrum冲刺阶段-Day 3
- SC-FDM和OFDM的区别
- 小程序通过用户授权获取手机号之getPhoneNumber
- 超人前传第一至十季/全集Smallville迅雷下载
- 让Orchard支持多个Layout
- 【ARM】AD转换器
- 在chrome中的source找不到自己写的js时处理方法
- ubuntu14.04 安装mono
- Ubuntu 下 chromium浏览器的标签乱码
- Lotus迁移到Exchange 2010 POC 之Domino Server的配置!
热门文章
- 最短路径算法总结(floyd,dijkstra,bellman-ford)
- Codeforces 1304F2 Animal Observation (hard version) 代码(dp滑动窗口线段树区间更新优化)
- python 3 可迭代对象与迭代器
- 5G三大应用场景
- CodeForces 1144A
- centos8 常用软件
- localStorage存、取数组
- 判断是否网络连通 .net Ping
- 2级迁移类Q201-Oracle RAC 到单机RMAN迁移(同字节序)非公
- 智能手机中下一次被消灭的部件是电话卡和TF卡