第一種-通過設置不同的端口來配置
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文章
931瀏覽量
28367
發布評論請先 登錄
相關推薦
Hyper-V創建虛擬機配置IP等網絡配置原理(Linux、Windows為例)

虛擬化數據恢復——Hyper-V虛擬機數據恢復案例

虛擬機數據恢復—異常斷電導致XenServer虛擬機不可用的數據恢復案例

什么是虛擬機?什么是虛擬化?
創建ubuntu虛擬機
虛擬機數據恢復—KVM虛擬機被誤刪除的數據恢復案例

什么是虛擬機?虛擬機真的那么好用嗎?

【鴻蒙】(一)Vmware虛擬機和Ubuntu安裝

評論