windows Apache伺服器簡單配置虛擬網域名稱(轉載)

來源:互聯網
上載者:User

標籤:原創   .so   errorlog   from   apache服務   denied   doc   example   地址   

1、找到apache目錄下的conf下的extra下的httpd-vhosts.conf虛擬機器主機設定檔將下面的代碼複製粘貼到最下面: #<VirtualHost *:80>
#    ServerAdmin [email protected]
#    DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
#    ServerName dummy-host2.example.com
#    ErrorLog "logs/dummy-host2.example.com-error.log"
#    CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost> 編輯成如下代碼:<VirtualHost *:80>
    DocumentRoot "F:\project"
    ServerName www.thinkphp.com
</VirtualHost> DocumentRoot後面的是項目的根目錄(我的項目目錄就在這個檔案夾下);ServerName後面的是虛擬網域名稱,在瀏覽器中訪問時的網域名稱(自己定義): 2、找到Apache目錄下的conf目錄下的httpd.conf檔案 (1)開啟找到檔案中的#Include conf/extra/httpd-vhosts.conf,去掉前面的#(2)找到#LoadModule rewrite_module modules/mod_rewrite.so,去掉前面的#3、設定存取權限(1)找到代碼:<Directory />

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

</Directory>在 Deny from all前面加上#(#是注釋,就是允許所有人訪問)(2)如果是Apache2.4:找到:<Directory />
    AllowOverride none
    Require all denied
</Directory>改成如下:<Directory />
    AllowOverride none
    Require all granted
</Directory> 4.修改C盤Windows的host檔案:目錄是:C:\Windows\System32\drivers\etc\host在下面添加一行(剛剛設定的虛擬網域名稱):127.0.0.1  www.thinkphp.com 原文地址:http://blog.csdn.net/iloveyougirls/article/details/54463668支援原創!

windows Apache伺服器簡單配置虛擬網域名稱(轉載)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.