閱讀858 返回首頁    go 阿裏雲 go 技術社區[雲棲]


在Apache設置虛擬機

在Apache設置虛擬機


1、在httpd.conf裏麵講一下語句前的#去掉
# Virtual hosts
Include conf/extra/httpd-vhosts.conf


2、在httpd.conf裏麵添加端口監聽
Listen 12345


3、在httpd-vhosts.conf增加虛擬機配置
<VirtualHost 127.0.0.1:12345>
DocumentRoot "D:\codes\php\mxt"
ServerName *:12345
    <Directory "D:\codes\php\mxt">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>


4、如果虛擬機配置ServerName ,必須在係統hosts文件中添加指定,如:127.0.0.1


hl95test。
 <VirtualHost *:8088>
     ServerName hl95test
     DocumentRoot D:/codes/php/mxt
     <Directory D:/codes/php/mxt>
         DirectoryIndex index.php
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>
 </VirtualHost>


注:hosts文件路徑C:\Windows\System32\drivers\etc

最後更新:2017-04-03 12:56:21

  上一篇:go 天氣查詢帶折線圖
  下一篇:go Microsoft Visual Studio與Firefly 一直提示加載項目,更新源碼狀態問題