IT 筆記:在 Windows 10 Home WSL 安裝 LAMP


LAMP是Linux系統上的網站架設組合,「L」表示「Linux」作業系統,「A」表示「Apache」網頁伺服器,「M」表示「MySQL」資料庫,「P」表示「PHP」程式語言,上一集介紹了在windows 10 home安裝 WSL,今次介紹在WSL系統之上安裝LAMP的方法。

輸入指令:sudo apt-get update,先將系統更新到最新版本。

輸入指令:sudo apt-get install lamp-server^  ,安裝LAMP Server。


使用root權限編輯主apache服務器配置文件 ;

 sudo nano /etc/apache2/apache2.conf

在 /etc/apache2/apache2.conf 中添加以下2行:

Servername localhost
AcceptFilter http none

貯存 apache2.conf 文件

使用root權限,輸入指令:$ sudo /etc/init.d/apache2 start;重新啟動 apache2。


使用瀏覽器訪問測試頁面
http:// localhost或http://127.0.0.1


看到預設網頁,就表示Apache2 Server已經安裝成功了!


在/var/www/html創建新的「info.php」檔案 




使用瀏覽器訪問測試頁面

http:// localhost/info.php 或 http://127.0.0.1/info.php


如果成功的話,會看到php安裝的資訊。


詢問 mysql 狀況:sudo service mysql status
如果顯示的信息是: * MySQL is stopped.
那麼輸入指令開始啟用MySQLsudo service mysql start
顯示MySQL已經啟用 * Starting MySQL database server mysqld
使用 root 登錄 mysql :sudo mysql -u root

MySQL prompt >, 輸入指令: show databases;



看見數據庫的顯示,到這裡就設定完成了!

Comments

Popular posts from this blog

旅遊筆記 : 吉隆坡前往檳城交通方式及網上購買馬來西亞KTM火車票教學

旅遊筆記 : 馬來西亞電動 Platinum ETS 列車初體驗

閒遊深水灣、淺水灣觀無敵海景,順走赤柱古道訪老虎坑、獅子坑古石橋尋歷史。