php host-v

來源:互聯網
上載者:User

標籤:

一.修改httpd.conf

把#include conf/extra/httpd-vhost.conf前面的#去掉,意思是讓httpd.conf檔案包含http-vhost.conf這個設定檔。

尋找httpd.conf中的ServerName,如果ServerName的設定不是網域名稱www.abc.com的話,那麼改為ServerNamewww.abc.com,如果要使用ssl之類的東西,那麼改為SreverNamewww.abc.com:80;就是加了個連接埠。

 

二.修改httpd-vhosts.conf(Apache\conf\extra目錄下)

在最後添加如下代碼:         (註:視實際情況而變)

Eg.

<VirtualHost *:80>

 DocumentRoot "D:/Apache/htdocs/kohana/"             (註:虛擬機器主機路徑)

 ServerName ko3.cn                                                             (註:網域名稱)

 #DirectoryIndex index.php

 <Directory "D:/Apache/htdocs/kohana/">                  

Options FollowSymLinks
AllowOverride All
Order Deny,Allow
Allow from all
DirectoryIndex index.html index.php index.htm

  </Directory>

</VirtualHost>

 

三.對網域名稱進行強制解析轉向到我們的虛擬目錄

開啟C:\WINDOWS\system32\drivers\etc檔案夾下的hosts檔案,在最後添加上自己的本地地址localhost或者自己的ip

Eg.在C:\WINDOWS\system32\drivers\etc目錄下的hosts中的

127.0.0.1       localhost  後面添加

127.0.0.1       ko3.cn phpmyadmin.cn (兩個網域名稱,中間空格隔開)

(註:新增內容視實際情況而變)

 

httpd -k install -n "name"  建立服務

httpd.exe -w -n "name" -k start

php host-v

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.