HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: /volume1/@appstore/WebStation/ui/help/chs/application_webserv_virtualhost.html
<!DOCTYPE html>
<html class="img-no-display" lang="zh-CN" >
<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>https://<em>NAS 的 IP 地址:443</em></li>
      <li>https://<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> 群组授予访问网站相关文件夹或文件的权限。例如,如果要让 <strong>web</strong> 共享文件夹中的 <strong>sample.htm</strong> 文件可供 Web Station 访问,需要确认 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>用户和群组</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>:&ldquo;NAS 的 IP 地址/~用户名/&rdquo;或&ldquo;NAS 的主机名/~用户名/&rdquo;。例如:
        <ol class="type_lower-alpha">
          <li>192.168.1.1/~ken/</li>
          <li>kenstation/~ken/</li>
        </ol>
      </li>
      <li><strong>域用户</strong>:&ldquo;NAS 的 IP 地址/~域名<span style="color: #ff0000;">%5c</span>用户名/&rdquo;或&ldquo;NAS 的主机名/~域名<span style="color: #ff0000;">%5c</span>用户名/&rdquo;。例如:
        <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>:&ldquo;NAS 的 IP 地址/~用户名@域名/&rdquo;或&ldquo;NAS 的主机名/~用户名@域名/&rdquo;。例如:
        <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(例如&ldquo;http://synotest.com:80&rdquo;),请在<strong>主机名</strong>字段中输入 Synology NAS 的 FQDN(完全限定域名),然后为 URL 至少选择一种端口类型:默认端口(<strong>80</strong> 和 <strong>443</strong>)或自定义端口(<strong>HTTP</strong> 和 <strong>HTTPS</strong>)。</li>
      <li><strong>基于端口</strong>:若要创建基于端口的 URL(例如&ldquo;https://210.61.203.200:443&rdquo;),请至少选择一种端口类型(<strong>HTTP</strong> 或 <strong>HTTPS</strong>),并输入 URL 的端口号。</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(例如&ldquo;http://synotest.com:80&rdquo;),请在<strong>主机名</strong>字段中输入 Synology NAS 的 FQDN(完全限定域名),然后为 URL 至少选择一种端口类型:默认端口(<strong>80</strong> 和 <strong>443</strong>)或自定义端口(<strong>HTTP</strong> 和 <strong>HTTPS</strong>)。</li>
      <li><strong>基于端口</strong>:若要创建基于端口的 URL(例如&ldquo;https://210.61.203.200:443&rdquo;),请至少选择一种端口类型(<strong>HTTP</strong> 或 <strong>HTTPS</strong>),并输入 URL 的端口号。</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 群组授予访问网站相关文件夹或文件的权限。例如,若要让 vhost1 文件夹可供 Web Station 访问,则需确保 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>