標籤: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