Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 伺服器技術 >> 關於伺服器

Linux VPS 綁定域名快速入門:vhost.sh 腳本一鍵操作

編輯:關於伺服器

前置條件

  • 已解析域名 A 記錄指向 VPS IP
  • 擁有 SSH root 存取權限

操作步驟

  1. SSH 登入 VPS
  2. 執行:/root/vhost.sh
  3. 依提示輸入:
Please input domain: yourdomain.com
Please input the directory for the domain: /home/wwwroot/yourdomain.com
Allow Rewrite rule? (y/n) y
Please input the rewrite programme: wordpress  # 選擇預設規則或自訂
Allow access log? (y/n) y

腳本自動完成

  • 建立網站目錄與權限
  • 生成 Nginx/Apache 虛擬主機配置
  • 寫入 Rewrite 規則
  • 重載 Web 服務

後續部署

上傳程式碼至 /home/wwwroot/yourdomain.com,配置資料庫連線,安裝即可。

參考延伸

  • IIS 域名綁定圖解
  • Apache 域名綁定虛擬主機配置
Copyright © Windows教程網 All Rights Reserved