# サブドメインなしでのインストールが機能しない

**URL:** <https://meta.discourse.org/t/installation-without-subdomain-not-working/241399>\
**Category:** Self-hosting\
**Created:** [2022 年 10 月 9 日午後 1:54 UTC](https://meta.discourse.org/t/installation-without-subdomain-not-working/241399 "2022-10-09T13:54:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)\
**Post date:** [2022 年 10 月 9 日午後 1:54 UTC](https://meta.discourse.org/t/installation-without-subdomain-not-working/241399/1 "2022-10-09T13:54:39Z")

</div>

こんにちは。テスト環境のクリーンなUbuntu 20.04 VMにDiscourseをインストールしようとしています（CentOS Stream 9、Ubuntu 22.04、openSUSE MicroOSでも試しました）。プロジェクトの初期の頃からDiscourseの経験があり、現在、移行を評価しています。その場合、`mydomain.tld` になります（本番ドメインはフォーラムのみで、「forum」という名前が含まれており、そのように広く認識されているため、`discourse.mydomain.tld` は絶対に避けたいです）。サブドメインなしでDiscourseをインストールしようとした最近の試みはすべて失敗しました。6年ほど前にサブドメインなしでDiscourseフォーラムを実行していたので、可能だったと記憶しています。現在、インストールは正常に完了するように見えますが、サイトはロードされません。Ubuntuでは、`http://` を明示的に指定しても、自動的に `https://` に切り替わり、まったくロードされません。CentOSとMicroOSでは、`http://` のNginxウェルカムページがロードされ、`https://` では何もロードされません。

上記のオペレーティングシステムでの私の試みはすべて、Discourseをサブドメイン `discourse.mydomain.tld` にインストールした場合、Let’s Encryptの自動設定を含め、正常に機能します。DNSレコードはドメインレジストラで正しく設定されており、適切なrDNS解決も行われているようです。サーバーのホスト名は `/etc/hosts` で `127.0.1.1 mydomain.tld mydomain` と表示され、`discourse-install` スクリプトはドメイン名の解決チェックで成功します。

以下は `discourse-doctor` の出力です。必要であれば、完全な `discourse-install` ログもあります。

```plaintext
DISCOURSE DOCTOR Sun Oct 9 13:32:47 UTC 2022
OS: Linux mydomain 5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 13:42:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Found containers/app.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=mydomain.tld
SMTP_ADDRESS=mail.mydomain.tld
DEVELOPER_EMAILS=REDACTED
SMTP_PASSWORD=REDACTED
SMTP_PORT=587
SMTP_USER_NAME=admin@mydomain.tld
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1

DOCKER PROCESSES (docker ps -a)

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d6f7f53a81db local_discourse/app \"/sbin/boot\" 10 minutes ago Up 4 minutes 0.0.0.0:80-\u003e80/tcp, :::80-\u003e80/tcp, 0.0.0.0:443-\u003e443/tcp, :::443-\u003e443/tcp app

Discourse container app is running

==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git

No non-official plugins detected.

See https://github.com/discourse/discourse/blob/main/lib/plugin/metadata.rb for the official list.

========================================
Discourse version at mydomain.tld: NOT FOUND
Discourse version at localhost: NOT FOUND

==================== MEMORY INFORMATION ====================
OS: Linux
RAM (MB): 2029

              total used free shared buff/cache available
Mem: 1935 823 547 30 564 934
Swap: 2047 0 2047

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 38G 8.0G 28G 23% /

==================== DISK INFORMATION ====================
Disk /dev/sda: 38.15 GiB, 40961572864 bytes, 80003072 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 6643DB1B-E542-4DE1-A04C-C8EB4DAAD77E

Device Start End Sectors Size Type
/dev/sda1 528384 80003038 79474655 37.9G Linux filesystem
/dev/sda14 2048 4095 2048 1M BIOS boot
/dev/sda15 4096 528383 524288 256M EFI System

Partition table entries are not in disk order.

==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Mail test skipped.

==================== DONE! ====================

```

---

_[View the full topic](https://meta.discourse.org/t/installation-without-subdomain-not-working/241399)._
