第一種-通過設(shè)置不同的端口來配置
1創(chuàng)建一個(gè)目錄,作為接口
2設(shè)置apche虛擬主機(jī)(不用配置虛擬目錄映射)
httpd.conf開啟虛擬主機(jī)配置,接著到httpd-vhosts.conf里面設(shè)置
//這里改變端口
DocumentRoot "D:/myblog" //這個(gè)就是第一步創(chuàng)建的接口
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文件里面修改監(jiān)聽端口
Listen 80
Listen 81
4-到host文件里面修改映射.登錄網(wǎng)站時(shí)候記得加端口號(hào)。
第二種方法:通過ServerName配置
1創(chuàng)建一個(gè)目錄,作為接口
2設(shè)置apche虛擬主機(jī)(不用配置虛擬目錄映射)
httpd.conf開啟虛擬主機(jī)配置,接著到httpd-vhosts.conf里面設(shè)置
//記得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。就可以了,當(dāng)然要配置hosts
fqj
-
虛擬機(jī)
+關(guān)注
關(guān)注
1文章
962瀏覽量
29076
發(fā)布評(píng)論請(qǐng)先 登錄
hyper 備份,Hyper備份:虛擬機(jī)備份與恢復(fù)

hyper v 上網(wǎng),Hyper-V上網(wǎng):虛擬機(jī)網(wǎng)絡(luò)配置

hyper v 顯卡,hyper-v顯卡:如何在虛擬機(jī)中配置和優(yōu)化顯卡性能

Hyper-V創(chuàng)建虛擬機(jī)配置IP等網(wǎng)絡(luò)配置原理(Linux、Windows為例)

RK3588 SDK入門之虛擬機(jī)配置篇

虛擬化數(shù)據(jù)恢復(fù)—XenServer虛擬機(jī)數(shù)據(jù)恢復(fù)案例

虛擬化數(shù)據(jù)恢復(fù)——Hyper-V虛擬機(jī)數(shù)據(jù)恢復(fù)案例

虛擬機(jī)數(shù)據(jù)恢復(fù)—異常斷電導(dǎo)致XenServer虛擬機(jī)不可用的數(shù)據(jù)恢復(fù)案例

虛擬化數(shù)據(jù)恢復(fù)—異常斷電導(dǎo)致VMware虛擬機(jī)文件丟失的數(shù)據(jù)恢復(fù)案例

虛擬化數(shù)據(jù)恢復(fù)—EXSI虛擬機(jī)誤還原快照如何恢復(fù)數(shù)據(jù)?

什么是虛擬機(jī)?什么是虛擬化?
創(chuàng)建ubuntu虛擬機(jī)
虛擬機(jī)數(shù)據(jù)恢復(fù)—KVM虛擬機(jī)被誤刪除的數(shù)據(jù)恢復(fù)案例

什么是虛擬機(jī)?虛擬機(jī)真的那么好用嗎?

評(píng)論