HEX
Server: Apache/2.4.63 (Unix)
System: Linux Synopilou92 4.4.302+ #72806 SMP Mon Jul 21 23:16:00 CST 2025 x86_64
User: pilou92 (1026)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /volume1/@appstore/WebStation/ui/help/cht/application_webserv_virtualhost.html
<!DOCTYPE html>
<html class="img-no-display" lang="zh-TW" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link href="../../../../help/help.css" type="text/css" rel="stylesheet"  />
<link href="../../../../help/scrollbar/flexcroll.css" type="text/css" rel="stylesheet"  />
<script type="text/javascript" src="../../../../help/scrollbar/flexcroll.js"></script>
<script type="text/javascript" src="../../../../help/scrollbar/initFlexcroll.js"></script>
</head>
<body><h1><a id="x_anchor_id27f4a129eb"></a>網頁入口</h1>
<p><strong>網頁入口</strong>頁面讓您能夠集中管理網頁服務的各項入口。本文將引導您管理預設網頁入口、個人網站、別名入口。</p>

<h2><a id="x_anchor_idfaeadd0939"></a>預設入口</h2>
<p>Web Station 安裝後將自動產生帶有預設 URL (網址) 的網頁入口。</p>

<h4><a id="x_anchor_id9a1a065a9f"></a>若要管理預設入口:</h4>
<ol class="type_lower-decimal">
  <li>前往<strong>網頁服務</strong>頁面。</li>
  <li>在<strong>預設服務</strong>區塊下,選取<strong>預設服務</strong>並按一下<strong>編輯</strong>。</li>
  <li>根據您的需求進行以下設定:<ul>
      <li><strong>HTTP 後端伺服器</strong>:從下拉式選單中選擇網頁伺服器的類型。</li>
      <li><strong>PHP</strong>:從下拉式選單中選擇 PHP 設定檔。您可以在<strong>指令碼語言設定</strong> &gt; <strong>PHP</strong> 中新增 PHP 設定檔。</li>
    </ul>
  </li>
  <li>按一下<strong>套用</strong>。</li>
  <li>預設網頁入口的 URL 格式範例如下:<ul>
      <li>http://<em>NAS 的 IP 位址:80</em></li>
      <li>http://<em>NAS 的網域名稱:80</em></li>
      <li>http://<em>NAS 的 IP 位址:443</em></li>
      <li>http://<em>NAS 的網域名稱:443</em></li>
    </ul>
  </li>
</ol>
<div class="section">
<h4><a id="x_anchor_idfc9d3df613"></a>注意:</h4>
<ul>
<li class="note_item"><a id="x_anchor_idfaed8cf1ef"></a>Web Station 使用 <strong>http</strong> 群組來執行任務。<strong>http</strong> 群組預設擁有 <strong>web</strong> 及 <strong>web_packages</strong> 共用資料夾的讀取權限。若要讓 Web Station 正常運作,請依據需求調整 <strong>http</strong> 群組存取網站相關資料夾或檔案的權限。例如:如果您想讓使用者透過 Web Station 存取 <strong>web</strong> 共用資料夾中的 <strong>sample.htm</strong> 檔案,您須確認 http 群組對於 <strong>web</strong> 共用資料夾及 <strong>sample.htm</strong> 檔案具有足夠的讀寫權限。</li>
<li class="note_item"><a id="x_anchor_id343c8792a2"></a>網站首頁檔案應命名為 <strong>index.htm</strong>、<strong>index.html</strong> 或 <strong>index.php</strong>。</li>
<li class="note_item"><a id="x_anchor_idcc1710677d"></a>當您使用 PHP mail() 功能,系統會自動擷取並使用<strong>控制台</strong> &gt; <strong>通知設定</strong> &gt; <strong>電子郵件</strong>頁面的 SMTP 伺服器資訊。請確認您已啟用電子郵件通知並輸入正確的 SMTP 伺服器資訊。</li>
<li class="note_item"><a id="x_anchor_id1c2fac759a"></a>Web Station 有兩種預設的共用資料夾:
  <ul>
<li class="note_item"><a id="x_anchor_ida94e84c8a5"></a><strong>web_packages</strong>:已安裝的第三方套件檔案 (例如:phpMyAdmin) 會儲存於此共用資料夾中。</li>
<li class="note_item"><a id="x_anchor_id185a1beaec"></a><strong>web</strong>:架設網站的檔案儲存於此共用資料夾中。</li>
  </ul>
</li>
<li class="note_item"><a id="x_anchor_id02f0aac22a"></a><strong>web</strong> 共用資料夾的實際路徑為 <strong>/volume1/web</strong>。有些應用程式會要求使用者在設定檔設定這個路徑。</li>
<li class="note_item"><a id="x_anchor_idb8f8ae20f3"></a><strong>blog</strong>、<strong>photo</strong>、<strong>photosrc</strong>、<strong>webdefault</strong> 為系統保留的資料夾名稱且無法為 Web Station 所用。請勿在 web 共用資料夾內以這些名稱命名資料夾。</li>
<li class="note_item"><a id="x_anchor_idab80dd102a"></a>若要自訂錯誤頁面,請執行下列任一操作:
  <ul>
    <li class="note_item"><a id="x_anchor_idc3219ebcf5"></a>前往<strong>錯誤頁面設定</strong> &gt; <strong>預設設定檔</strong> &gt; <strong>預設錯誤頁面設定檔</strong>,並參閱<a href="https://kb.synology.com/DSM/help/WebStation/application_webserv_errorpage" target="_blank" rel="noopener noreferrer nofollow">錯誤頁面設定</a>了解操作步驟。</li>
    <li class="note_item"><a id="x_anchor_id096a599f5b"></a>建立名稱為 <strong>missing.html</strong>、<strong>missing.htm</strong> 或 <strong>missing.php</strong> 的檔案並放置到 Synology NAS 的 <strong>web</strong> 共用資料夾。</li>
  </ul>
</li>
</ul>
</div>


<h4><a id="x_anchor_idd9f1fe686d"></a>若要啟用個人網站:</h4>
<p>Web Station 可讓本機使用者、網域使用者及 LDAP 使用者建立個人網站。</p>
<p><strong>在開始之前:</strong></p>
<ul>
  <li>啟用<strong>使用者家目錄</strong>。此選項可在以下路徑找到:<ul>
      <li>針對本地使用者:<strong>控制台</strong> &gt; <strong>使用者 &amp; 群組</strong> &gt; <strong>進階設定</strong></li>
      <li>針對網域使用者:<strong>控制台</strong> &gt; <strong>網域 / LDAP</strong> &gt; <strong>網域使用者</strong></li>
      <li>針對 LDAP 使用者:<strong>控制台</strong> &gt; <strong>網域 / LDAP</strong> &gt; <strong>LDAP 使用者</strong></li>
    </ul>
  </li>
  <li>安裝並啟用至少一個 <strong>Apache HTTP Server</strong> 版本。您可以於<strong>套件中心</strong>下載這些套件。</li>
</ul>
<ol class="type_lower-decimal">
  <li>前往<strong>網頁服務</strong>頁面。</li>
  <li>在<strong>預設服務</strong>區塊下,選取<strong>預設服務</strong>並按一下<strong>編輯</strong>。</li>
  <li>勾選<strong>啟用個人網站</strong>核取方塊,接著,位於各使用者的家目錄內將自動建立名為 <strong>www</strong> 的資料夾。</li>
  <li>依您的需求進行下列設定,然後按一下<strong>儲存</strong>:<ul>
      <li><strong>HTTP 後端伺服器</strong>:從下拉式選單中選擇網頁伺服器的類型。</li>
      <li><strong>PHP</strong>:從下拉式選單中選擇 PHP 設定檔。您可以在<strong>指令碼語言設定</strong> &gt; <strong>PHP</strong> 中新增 PHP 設定檔。</li>
    </ul>
  </li>
  <li>上傳網頁相關檔案至 <strong>www</strong> 資料夾。</li>
  <li>確定已給予特定使用者或群組上傳檔案足夠的存取權限。</li>
  <li>完成上述步驟後,每位使用者將擁有一個獨一無二的網址,如下所示:<ul>
      <li><strong>本地使用者</strong>:「NAS 的 IP 位址/~使用者名稱/」或「NAS 的主機名稱/~使用者名稱/」。範例如下:<ol class="type_lower-alpha">
          <li>192.168.1.1/~ken/</li>
          <li>kenstation/~ken/</li>
        </ol>
      </li>
      <li><strong>網域使用者</strong>:「NAS 的 IP 位址/~網域名稱<span style="color: #ff0000;">%5c</span>使用者名稱/」或「NAS 的主機名稱/~網域名稱<span style="color: #ff0000;">%5c</span>使用者名稱/」。範例如下:<ol class="type_lower-alpha">
          <li>192.168.1.1/~synology.local<span style="color: #ff0000;">%5c</span>ken/</li>
          <li>kenstation/~synology.local<span style="color: #ff0000;">%5c</span>ken/</li>
        </ol>
      </li>
      <li><strong>LDAP 使用者</strong>:「NAS 的 IP 位址/~使用者名稱@網域名稱/」或「NAS 的主機名稱/~使用者名稱@網域名稱/」。範例如下:<ol class="type_lower-alpha">
          <li>192.168.1.1/~ken@synology.local/</li>
          <li>kenstation/~ken@synology.local/</li>
        </ol>
      </li>
    </ul>
  </li>
</ol>
<div class="section">
<h4><a id="x_anchor_idfc9d3df613"></a>注意:</h4>
<ul>
<li class="note_item"><a id="x_anchor_id6f69ad8f2b"></a>若要為個人網站自訂錯誤頁面:
  <ol>
<li class="note_item"><a id="x_anchor_ide5820c4d7a"></a>將錯誤頁面存成 <strong>missing.html</strong>、<strong>missing.htm</strong> 或 <strong>missing.php</strong>。</li>
<li class="note_item"><a id="x_anchor_ide98622188f"></a>上傳至 <strong>www</strong> 資料夾。</li>
</ol>
</li>
<li class="note_item"><a id="x_anchor_id6b15acbf36"></a>本機使用者僅允許存取以下資料:
  <ul>
    <li class="note_item"><a id="x_anchor_idf092874fcb"></a>使用者自己的家目錄 (<strong>home</strong> 共用資料夾)</li>
    <li class="note_item"><a id="x_anchor_idfc513f0400"></a>/var/tmp</li>
    <li class="note_item"><a id="x_anchor_idd42b9c57d2"></a>/tmp</li>
    <li class="note_item"><a id="x_anchor_id44704d109d"></a>/volumeX/@tmp</li>
  </ul>
</li>
</ul>
</div>


<h2><a id="x_anchor_id650a768e47"></a>自訂入口</h2>
<h4><a id="x_anchor_id67649e004f"></a>若要建立網頁服務入口:</h4>
<p>您可以 Web Station 透過為第三方網頁服務套件建立自訂入口 (例如:phpMyAdmin、WordPress、MediaWiki)</p>
<ol class="type_lower-decimal">
  <li>前往<strong>網頁入口</strong>頁面並按一下<strong>新增</strong>。</li>
  <li>選擇<strong>網頁服務入口</strong>。</li>
  <li>選擇一個服務。</li>
  <li>選擇入口類型:<ol class="type_lower-alpha">
      <li><strong>網址名稱對應</strong>:若要建立對應網址名稱的 URL (例如:「http://synotest.com:80」),請在<strong>網主機名稱</strong>欄位輸入 Synology NAS 的 FQDN (完整網域名稱),並選擇至少一種連接埠類型:預設連接埠 (<strong>80</strong> 及 <strong>443</strong>) 或自訂連接埠 (<strong>HTTP</strong> 及 <strong>HTTPS</strong>)。</li>
      <li><strong>連接埠對應</strong>:若要建立對應連接埠的 URL (例如:「https://210.61.203.200:443」),請選擇至少一種類型的連接埠 (<strong>HTTP</strong> 及 <strong>HTTPS</strong>),並輸入連接埠編號。</li>
      <li><strong>別名入口</strong>:您亦可為第三方網頁服務套件指派所謂別名的替代 URL。</li>
    </ol>
  </li>
  <li>若您想要強制網頁瀏覽器透過 HTTPS 連線參訪您的套件伺服器,請勾選 <strong>HTTPS 設定的</strong> 的 <strong>HSTS</strong> 核取方塊。</li>
  <li>從<strong>存取控制設定檔</strong>的下拉式選單中選擇設定檔。您可以在<strong>控制台</strong> &gt; <strong>登入入口</strong> &gt; <strong>進階</strong>中新增存取控制設定檔。</li>
  <li>從<strong>錯誤頁面設定檔</strong>的下拉式選單中選擇設定檔。您可以在<strong>錯誤頁面設定</strong>的頁面內新增錯誤頁面設定檔。</li>
  <li>按一下<strong>新增</strong>以完成設定。預設連結將出現在<strong>網頁入口</strong>頁面的入口清單。</li>
</ol>
<h4><a id="x_anchor_id42a7064a3a"></a>若要建立預設伺服器增設入口:</h4>
<p>透過 Web Station,您可以為預設的網頁伺服器增設入口,並且自訂該入口的主機名稱及連接埠。</p>
<ol class="type_lower-decimal">
  <li>前往<strong>網頁入口</strong>頁面並按一下<strong>新增</strong>。</li>
  <li>選擇<strong>預設伺服器增設入口</strong>。</li>
  <li>選擇入口類型:<ol class="type_lower-alpha">
      <li><strong>網址名稱對應</strong>:若要建立對應網址名稱的 URL (例如:「http://synotest.com:80」),請在<strong>網主機名稱</strong>欄位輸入 Synology NAS 的 FQDN (完整網域名稱),並選擇至少一種連接埠類型:預設連接埠 (<strong>80</strong> 及 <strong>443</strong>) 或自訂連接埠 (<strong>HTTP</strong> 及 <strong>HTTPS</strong>)。</li>
      <li><strong>連接埠對應</strong>:若要建立對應連接埠的 URL (例如:「https://210.61.203.200:443」),請選擇至少一種類型的連接埠 (<strong>HTTP</strong> 及 <strong>HTTPS</strong>),並輸入連接埠編號。</li>
    </ol>
  </li>
  <li>若您想要強制網頁瀏覽器透過 HTTPS 連線參訪您的虛擬主機,請勾選 <strong>HTTPS 設定的</strong> 的 <strong>HSTS</strong> 核取方塊。</li>
  <li>按一下<strong>新增</strong>以完成設定。預設連結將出現在<strong>網頁入口</strong>頁面的入口清單。</li>
</ol>

<div class="section">
<h4><a id="x_anchor_idfc9d3df613"></a>注意:</h4>
<ul>
<li class="note_item"><a id="x_anchor_idc6e578911d"></a>Web Station 使用 http 群組來執行任務,以取得較佳的彈性與安全性。若要讓 Web Station 正常運作,請依據需求調整 http 群組存取網站相關資料夾或檔案的權限。例如:如果您想讓使用者透過 Web Station 存取 vhost1 資料夾,您必須確認 http 群組對於 vhost1 資料夾具有足夠的讀寫權限。</li>
<li class="note_item"><a id="x_anchor_id75d60e6a36"></a>為了確保已安裝的第三方網頁服務套件能夠正常運作,http 群組對 web_packages 共用資料夾的存取權限須設為唯讀。</li>
<li class="note_item"><a id="x_anchor_id201d4b44cc"></a>設定檔案存取權限的主要目的是讓 Web Station 能正常運作。下列資料夾會存放網站相關檔案,請勿將敏感資訊儲存於其中:
  <ul>
    <li class="note_item"><a id="x_anchor_iddc9fbd8d96"></a><strong>Web</strong> 共用資料夾</li>
    <li class="note_item"><a id="x_anchor_id1428c7df4a"></a><strong>web_packages</strong> 共用資料夾</li>
    <li class="note_item"><a id="x_anchor_idf8667b42ff"></a>虛擬主機的主目錄</li>
  </ul>
</li>
<li class="note_item"><a id="x_anchor_idc6eaab5479"></a>入口清單的預設連結遵循以下規則:
<ul>
<li class="note_item"><a id="x_anchor_id0af787ea4e"></a>當預設連接埠 (80 及 443) 與自訂連接埠皆啟用時,預設連結將以連接埠 443 (HTTPS) 結尾。</li>
<li class="note_item"><a id="x_anchor_idcf7dfd046a"></a>當只有自訂連接埠啟用時,預設連結將以 HTTPS 的自訂連接埠結尾。</li>
</ul>
</li>
</ul>
</div></body>
</html>