第一种-通过设置不同的端口来配置
1创建一个目录,作为接口
2设置apche虚拟主机(不用配置虚拟目录映射)
httpd.conf开启虚拟主机配置,接着到httpd-vhosts.conf里面设置
//这里改变端口
DocumentRoot "D:/myblog" //这个就是第一步创建的接口
DirectoryIndex index.html index.htm index.php
Options FollowSymLinks
Allowoverride None
order Allow,deny
Allow from all
DocumentRoot "D:/baidu"
DirectoryIndex index.html index.htm index.php
Options FollowSymLinks
Allowoverride None
order Allow,deny
Allow from all
3-到httpd.conf文件里面修改监听端口
Listen 80
Listen 81
4-到host文件里面修改映射.登录网站时候记得加端口号。
第二种方法:通过ServerName配置
1创建一个目录,作为接口
2设置apche虚拟主机(不用配置虚拟目录映射)
httpd.conf开启虚拟主机配置,接着到httpd-vhosts.conf里面设置
//记得ip必须为*否则不行的
DocumentRoot "D:/myblog" //目录
ServerName www.lengai.com //域名
DirectoryIndex index.html index.htm index.php
Options FollowSymLinks
Allowoverride None
order Allow,deny
Allow from all
DocumentRoot "D:/baidu"
ServerName www.beijing.com
DirectoryIndex index.html index.htm index.php
Options FollowSymLinks
Allowoverride None
order Allow,deny
Allow from all
3重启apache。就可以了,当然要配置hosts
fqj
-
虚拟机
+关注
关注
1文章
968浏览量
30177
发布评论请先 登录
搭建自己的ubuntu系统之创建ubuntu虚拟机
TECS OpenStack资源池虚拟机网络二层地址无法互通的问题处理
hyper 备份,Hyper备份:虚拟机备份与恢复
hyper-v虚拟机,为何需要用hyper-v虚拟机?
hyper cpu,Hyper CPU优化:提升虚拟机性能
hyper-v 备份,hyper-v怎样进行虚拟机的创建
hyper v 删除,怎么样删除hyper-v中的虚拟机?
hyper v 显卡,hyper-v显卡:如何在虚拟机中配置和优化显卡性能
hyper 内存,Hyper内存:如何监控与优化hyper-v虚拟机的内存使用
hyper内存条,hyper-v 添加虚拟机还需要硬盘吗
Ubuntu系统的虚拟机安装步骤 如何在Ubuntu系统上编译软件
Hyper-V创建虚拟机配置IP等网络配置原理(Linux、Windows为例)

关于apache配置多ip虚拟机2种方法的分享
评论