本文為博主手寫總結(jié)性文章,如若涉及版權(quán)問題蒲列,請與博主聯(lián)系。
1.終端輸入
????????開啟apache: sudo apachectl start
????????重啟apache: sudo apachectl restart
????????關(guān)閉apache: sudo apachectl stop
2.mac機,前往Apache服務(wù)器的文件路徑:
????????路徑寫法1:???? /資源庫/WebServer/Documents/
????????路徑寫法2:????????/Library/WebServer/Documents/
????????注:對文件進行操作需要密碼(電腦的密碼)
3.HTTP測試路徑
????????http://127.0.0.1/文件名稱
????????注:1,文件名稱需要帶后綴
? ? ? ????????? 2,127.0.0.1是指本地。
????????????????例如:在電腦A中設(shè)置Apache语淘,在電腦A中訪問電腦A的Apache,127.0.0.1就可以使用删性。
? ? ? ? ? ? ? ? ????????????在電腦A中設(shè)置Apache,在電腦B中訪問電腦A的Apache焕窝,127.0.0.1就不能使用蹬挺。
? ? ? ? ?????????3,此方法生成的是http不是https,蘋果設(shè)備目前大多http不在默認(rèn)支持它掂,需要手動設(shè)置巴帮。
? ? ? ? ? ? ? ? ? ? 解決辦法:在info.plist文件中,找到或者添加NSAppTransportSecurity字典,將NSAllowsArbitraryLoads設(shè)置為YES虐秋。
? ? ? ? ? ????? 4,將IP換成電腦當(dāng)前IP(注意固定IP和聯(lián)網(wǎng)之后的網(wǎng)絡(luò)IP也局勢WIFI)地址榕茧,這樣只要是在同一局域網(wǎng)中將可以相互訪問。