kouga
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # やったこと3 ## テストサーバー初期化 初期アカウント id:ubuntu pw:tomarunasusume55 共通アカウント id:Maquinista pw:tomarunasusume 各自アカウント作成 ## NextcloudのYAMLファイル書いた mariadbのバージョンを10.5に制限したのは最新版を入れるとエラーでセットアップが完了しなかったから ```dockerfile= version: '3' volumes: nextcloud: db: services: db: image: mariadb:10.5 restart: always command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW volumes: - db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_PASSWORD=root - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud app: image: nextcloud restart: always ports: - "8000:80" depends_on: - db volumes: - nextcloud:/var/www/html environment: - MYSQL_HOST=db:3306 - MYSQL_DATABASE=nextcloud - MYSQL_USER=root - MYSQL_PASSWORD=root networks: default: external: name: 'https-portal_nw' ``` portは8000:80 ## https-portalのymlを書いた ```dockerfile= version: '3' services: https-portal: image: steveltn/https-portal:1 container_name: https-portal ports: - '80:80' - '443:443' environment: # STAGE:を省略するとデフォルトでstaging(オレオレ証明書) STAGE: 'production' DOMAINS: 'nextcloud.kouga.info -> http://kouga.info:8000' FORCE_RENWE: 'false' WEBSOCKET: 'true' CLIENT_MAX_BODY_SIZE: 0 restart: always networks: - https-portal_nw volumes: - ./docker/https-portal:/var/lib/https-portal volumes: https-portal-data: # Recommended, to avoid re-signing when upgrading HTTPS-PORTAL networks: https-portal_nw: external: true ``` ## dockerのインストール ``` sudo apt update sudo aot upgrade -y sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg \ lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo \ "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io ``` ↓のInstall using the repositoryとInstall Docker Engineをやったかんじ [URL](https://docs.docker.com/engine/install/ubuntu/) ## docker compose のインストール ``` sudo curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose ``` 確認 ``` docker-compose -v docker-compose version 1.29.1, build c34c88b2 ``` ## ネットワークの作成 ``` docker network create https-portal_nw ``` ## docker-compose up ## crowiの構築 公式をcloneしてきて最新のバージョン(やった当時はv1.7.9)がタグ付けされたコミットにチェックアウトしてdocker-compose upをやった ``` git clone https://github.com/crowi/crowi.git git chekcout ff6e721646d842d5779e539d764837ee2b1e0876 docker-compose -f docker-compose.development.yml up ``` 3000番ポートでアクセスしようとしたけどできなかった (elastic_searchのコンテナはexitedになってた) masterブランチでdocker-compose upをしたが同様にだめっぽかった ### やったこと8/19 - elastic searchのコンテナを立ち上げるときにerror(137)が起きてた - →メモリ不足 - ymlの中でメモリの制限をかけてupしてみた。8mまで下げたらelastic searchのコンテナが落ちなくなった - けど、そこまで下げるとelastic searchがまともに動かないと思うのでいったん他のサービス(nextcloud)のコンテナを落としてみてメモリ制限を256mにしたところ、別のエラーがでてelastic searchのコンテナは立ち上がらなかった ```bash npm WARN lifecycle crowi@1.7.8~postinstall: cannot run in wd crowi@1.7.8 npm run build (wd=/crowi) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/nodemon/node_modules/fsevents): ``` elastic searchのコンテナを立ち上げることはできたが3000にアクセスできない ### のもさんにymlファイルもらった 所々-とか+とかあるが、-は削除、+は追加のマーク。 ```dockerfile= version: '3' services: crowi: build: context: . args: NODE_ENV: development tty: true environment: DEBUG: "crowi:*" MONGO_URI: mongodb://mongodb:27017/crowi REDIS_URL: redis://redis:6379/crowi ELASTICSEARCH_URI: elasticsearch:9200/ - PLANTUML_URI: //localhost:8080 + PLANTUML_URI: http://www.plantuml.com/plantuml/ FILE_UPLOAD: local PASSWORD_SEED: **** SECRET_TOKEN: **** MATHJAX: 1 volumes: - ./:/crowi - /crowi/node_modules ports: - 3000:3000 links: - mongodb - elasticsearch - redis - - plantuml command: bash -c "npm install && npm run dev" mongodb: image: mongo:3.6.3 volumes: - ./data/mongodb:/data/db restart: unless-stopped ports: - 27017:27017 elasticsearch: build: context: ./elasticsearch environment: bootstrap.memory_lock: "true" discovery.type: single-node xpack.graph.enabled: "false" xpack.ml.enabled: "false" xpack.monitoring.enabled: "false" xpack.security.enabled: "false" xpack.watcher.enabled: "false" ulimits: memlock: soft: -1 hard: -1 volumes: - ./data/elasticsearch:/usr/share/elasticsearch/data ports: - 9200:9200 redis: image: redis:4.0.8 restart: unless-stopped ports: - 6379:6379 - plantuml: - image: plantuml/plantuml-server:latest - restart: unless-stopped - ports: - - 8080:8080 ``` ### やったこと9/2 - [のもさんのwikiの記事](https://maquiwiki.rogiken.org/user/15-nomo/blog/2021/08/20/crowi_v1.7.9)にあるymlファイルを用いてcrowiのコンテナを立ち上げた - chownコマンドで ./data/elasticsearch の所有権を実行者に渡したうえでコンテナを一旦破棄して再度ビルドした - docker ps コマンドでelasticsearch含めて立ち上がっているのを確認した - `chown 1000:1000 ./data/elasticsearch` - ユーザIDがuid=1000(ubuntu) - http://kouga.info:3000 でアクセスすることができない - サーバ内に入った状態で```curl http://localhost:3000``` とコマンドを入力すると反応するのでおそらくサーバ上で立ち上がってはいるはず ⇒ポート開放してできた ### セットアップやった ![](https://i.imgur.com/QLTEtMd.png) ユーザ名:admin メールアドレス:tokyotech.maquinista@gmail.com パスワード:tomarunasusume ### https化,サブドメイン化やったけど... - https-portalのdocker-composeの一行を修正 ```dockerfile= DOMAINS: 'nextcloud.kouga.info -> http://kouga.info:8000, maquiwiki.kouga.info -> http://kouga.info:3000' ``` - crowiのdocker-composeにネットワーク周りの設定を最後の行に追加 ```dockerfile= networks: default: external: name: 'https-portal_nw' ``` - crowiのコンテナを立ち上げてからhttps-portalのコンテナを立ち上げた - なぜかうまくいかなかった - **症状** - サイトにアクセスできない - curl http://localhost:3000ってやると`curl: (56) Recv failure: Connection reset by peer`ってでる - ただコンテナは立ち上がってる模様... ## nextcloud ```dockerfile= version: '3' volumes: nextcloud: db: services: db: image: mariadb restart: always command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW volumes: - db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_PASSWORD=nextcloud - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud app: image: nextcloud restart: always ports: - "8000:80" links: - db volumes: - nextcloud:/var/www/html environment: - MYSQL_HOST=db - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_PASSWORD=root networks: default: external: name: 'https-portal_nw' ``` ``` サーバーは要求を完了できませんでした。 再びこのようなことが起こった場合は、以下の技術情報をサーバー管理者に送ってください。 詳細は、サーバーのログを確認してください。 技術詳細 リモートアドレス: 122.133.108.38 リクエスト ID: WjIb0J5GUq6xqyahJk3l ``` ## 9/16 Crowiとか - docker image lsで確認してみると意味不明なイメージが大量生成されていた ![](https://i.imgur.com/FtMoxa8.png) - `docker rmi <image ID>` - `docker volume prune`で未使用のvolumeを全削除 - crowiのイメージ作成時のエラーメッセージ `docker-compose build` ``` npm WARN notice [SECURITY] npm has the following vulnerabilities: 4 low. Go here for more details: https://www.npmjs.com/advisories?search=npm&version=5.10.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info. (node:7) Warning: a promise was created in a handler at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/tarball.js:39:25 but was not returned from it, see http://goo.gl/rRqMUw ``` imageの作成に失敗している ### 次やること - iwasaki - ymlの理解できてないところを理解するorエラーメッセージを読み解く - volumeに名前つけて名前なしのボリュームが発生しないようにする - kouga - volume image の削除をしたうえでhttps portalのボリュームに名前を付けて最初から起動してみる - nono - crowiのコンテナ立ち上げ再挑戦 - nextcloudが立ち上がったら本番環境のセットアップ

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully