跳至主內容區

XOOPS輕鬆架

:::

主內容區域

選擇後會自動跳轉頁面

8. 安裝Nginx(非必須)

  1. 安裝
    apt install nginx

     

  2. 觀看狀態
    systemctl status nginx

     

  3. 若有 nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument 的錯誤
    mkdir /etc/systemd/system/nginx.service.d
    printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
    systemctl daemon-reload
    systemctl restart nginx 

     

  4. 手動啟動
    systemctl start nginx

     

  5. 自動啟動
    systemctl enable nginx

     

  6. 查看版本
    nginx -v

     

  7. 檢查設定是否正確
    nginx -t

     

  8. 在網頁目錄建立預設網頁:
    vi /var/www/html/index.html

     

  9. index.html的內容為
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
        網頁已開通!
    </body>
    </html>

     

  10. 可開啟瀏覽器,輸入IP,試試是否OK。
    http://網址或IP/

     

選擇後會自動跳轉頁面

:::

左邊區域內容

書籍目錄

展開 | 闔起

快速登入


右邊區域內容

請掃此 QR Code 可連至此頁面

計數器

今天: 1185118511851185
昨天: 2944294429442944
總計: 9493812949381294938129493812949381294938129493812

頁尾區域