Slideshow CK

NoraGatewayダッシュボードのインストール方法

NoraGateway v0.1.4a以降で使用可能な簡易ダッシュボードのインストール方法(@Linux)

このチュートリアルは、既設のNoraGatewayが動作していることを前提に説明します

 

kdk.ddns.net JARL DSTARネットワーク向け自動応答NoraGatewayダッシュボード:http://kdk.ddns.net:8080/ 

 

1. NoraGateway.xmlを編集

NoraGateway.xml最後尾付近の<WebRemoteControlService内enableをtrueに変更します

	<!--
		Webダッシュボードサービス(v0.1.4a以降)
		※有効にする場合には、enable="true"として下さい
		
		
	-->
	<WebRemoteControlService enable="true" port="3000" context="/nora" />
	
</NoraGateway>

 

2. /opt/NoraGateway/dashboard/js/config.jsを編集

serverAddressに、ダッシュボードを表示するクライアントデバイスから見たときのIPアドレスを設定します

const serverAddress = "192.168.???.???";

const context = "/nora";

const lastHeardLimit = 20;

 

3. nginxのインストール

sudo apt install nginx

と入力し、nginxをインストールします

 

4. /etc/nginx/sites-available/defaultを編集

sudo vi /etc/nginx/sites-available/default

と入力し、下記の通りdefaultファイルを編集します

  1. server {の直上
        upstream nora {
            server localhost:3000;
        }
    
        map $http_upgrade $connection_upgrade {
            default upgrade;
            ''      close;
        }
    
    server {​
  2. root
    root /opt/NoraGateway/dashboard;​
  3. location / { ........ }の直下
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to displaying a 404.
                    try_files $uri $uri/ =404;
            }
    
            location /nora/ {
                proxy_pass http://nora;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
            }​
  4. 上記3項目を追加・編集すると下記のようになります
    ##
    # You should look at the following URL's in order to grasp a solid understanding
    # of Nginx configuration files in order to fully unleash the power of Nginx.
    # http://wiki.nginx.org/Pitfalls
    # http://wiki.nginx.org/QuickStart
    # http://wiki.nginx.org/Configuration
    #
    # Generally, you will want to move this file somewhere, and start with a clean
    # file but keep this around for reference. Or just disable in sites-enabled.
    #
    # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
    ##
    
    # Default server configuration
    #
    
        upstream nora {
            server localhost:3000;
        }
    
        map $http_upgrade $connection_upgrade {
            default upgrade;
            ''      close;
        }
    
    server {
            listen 80 default_server;
            listen [::]:80 default_server;
    
            # SSL configuration
            #
            # listen 443 ssl default_server;
            # listen [::]:443 ssl default_server;
            #
            # Note: You should disable gzip for SSL traffic.
            # See: https://bugs.debian.org/773332
            #
            # Read up on ssl_ciphers to ensure a secure configuration.
            # See: https://bugs.debian.org/765782
            #
            # Self signed certs generated by the ssl-cert package
            # Don't use them in a production server!
            #
            # include snippets/snakeoil.conf;
    
            root /opt/NoraGateway/dashboard;
    
            # Add index.php to the list if you are using PHP
            index index.html index.htm index.nginx-debian.html;
    
            server_name _;
    
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to displaying a 404.
                    try_files $uri $uri/ =404;
            }
    
            location /nora/ {
                proxy_pass http://nora;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
            }
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            #location ~ \.php$ {
            #       include snippets/fastcgi-php.conf;
            #
            #       # With php7.0-cgi alone:
            #       fastcgi_pass 127.0.0.1:9000;
            #       # With php7.0-fpm:
            #       fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            #}
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /\.ht {
            #       deny all;
            #}
    }
    
    
    # Virtual Host configuration for example.com
    #
    # You can move that to a different file under sites-available/ and symlink that
    # to sites-enabled/ to enable it.
    #
    #server {
    #       listen 80;
    #       listen [::]:80;
    #
    #       server_name example.com;
    #
    #       root /var/www/example.com;
    #       index index.html;
    #
    #       location / {
    #               try_files $uri $uri/ =404;
    #       }
    #}​

5. nginxのリロード

sudo systemctl reload nginx.service

と入力し、設定変更を反映します

 

6. NoraGatewayの起動

自動起動を設定している場合には、再起動を行って下さい

自動起動を設定していない場合には、/opt/NoraGateway/start.shを実行して下さい

 

7. ダッシュボードにアクセスを試行

外部のデバイスなどから、

http://nginxが動作していデバイスのIPアドレス

にアクセスを行い、正常に動作しているか確認を行います