# HW06 安裝LNMP ## 安裝LNMP ## 1.安裝nginx sudo apt update sudo apt upgrade    下載ngnix sudo apt install nginx  查看版本 nginx -v  啟動Nginx服務 sudo systemctl start nginx 查看服務狀態: sudo systemctl status nginx  輸入網址: http://YOUR_IP/index.nginx-debian.html 確認有沒有Welcome to nginx ! 在瀏覽器輸入10.7.200.95檢查有沒有安裝成功,看到以下畫面就是成功安裝 ()  ## **2.安裝mariadb** 安裝mariadb: $sudo apt install mariadb-server mariadb-client  啟動mariadb: $sudo systemctl start mariadb 設定開機啟動mariadb: $sudo systemctl enable mariadb 檢查是否安裝成功: $sudo mysql  # 安装php 安装php: $sudo apt install php8.1-cli php8.1-common php8.1-mysqlnd php8.1-fpm  啟動php: $sudo systemctl start php8.1-fpm 設定開機啟動php: $sudo systemctl enable php8.1-fpm  修改nginx配置以支持php(改成如下圖): $sudo nano /etc/nginx/sites-enabled/default  重啟nginx: sudo systemctl restart nginx 在瀏覽器輸入10.7.200.95/phpinfo.php,看到以下畫面就是成功安裝 結果圖: 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up