phpStudy 虛擬主機

轉載:http://blog.csdn.net/sinat_35861664/article/details/53557574windows

 

windows下配置虛擬主機,實現多域名訪問本地項目目錄



一、Apache配置文件httpd.conf

   找到
   # Virtual hosts 這句前面的#不用去
   #Include conf/extra/httpd-vhosts.conf 去掉本行註釋 #

服務器

二、Apache文件目錄

   conf/extra/http-vhosts.conf
  
   複製添加以下代碼
   
   <VirtualHost _default_:80>
   DocumentRoot "D:\WWW\xxxx"  #項目所在文件目錄
   ServerName ttfj_bj.com         #設置本地訪問網址
   </VirtualHost>

ide

三、 找到hosts文件

    C:\Windows\System32\drivers\etc\hosts
    
    在最後添加以下
    127.0.0.1      xxxx   #設置本地訪問網址 (與上ServerName一致)




 最後重啓Apache服務器




Apache提示You don't have permission to access / on this server問題解決


<Directory />  
    Options FollowSymLinks  
    AllowOverride None  
    Order deny,allow  
    Deny from all  
</Directory></span>  




改成
<Directory />  
    Options Indexes FollowSymLinks  
    AllowOverride None  
</Directory></span>  this

相關文章
相關標籤/搜索