apache 2.2安裝

來源:互聯網
上載者:User

標籤:http   os   檔案   io   art   html   ar   htm   

       下載apache2.2 http server,安裝next,見到set type,選擇custom類型安裝,change改變安裝路徑,next到finsh安裝完成,預設80連接埠,開啟瀏覽器http://localhost,show view "it works !"成功安裝。

 

  配置環境變數,在path變數編輯結尾加上E:\PHP\PHP Server\bin;指向bin目錄。

  啟動服務:httpd -k start[shutdown][rstart]  

  查看工作端口:netstat -anb

 

 

打安裝目錄,例如:E:\PHP\PHP Server\conf,在conf目錄下可修改httpd.conf設定檔,修改連接埠,檔案存放路徑。

變更檔存放目錄例如:開啟httpd.conf設定檔,找到<IfModule dir_module> tag 在後面增加如下:

#配置虛擬目錄
<IfModule dir_module>
#預設首頁
DirectoryIndex index.html index.htm index.php
#映射網站的別名
Alias /myphp "E:/myphp"
<Directory E:/myphp>
#存取權限配置
Order allow,deny
</Directory>
</IfModule>

並且注釋#DocumentRoot "E:/PHP/PHP Server/htdocs"

 

 

 

 

配置虛擬機器主機

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

去掉注釋,並打httpd-vhosts.conf檔案,增加如下:

<VirtualHost 127.0.0.1:80>
DocumentRoot "E:/myphp"
DirectoryIndex index.html index.htm index.php
<Directory />

options FollowSymLinks

Allowoverride None

Order allow,deny
Allow from all
</Directory>
</VirtualHost>   

 增加本地區名映射:

開啟目錄:C:\Windows\System32\drivers\etc

下的hosts檔案,增加

127.0.0.1      www.myphp.com

 

聯繫我們

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