$ sudo nano /etc/systemd/network/wired.network
GNU nano 2.2.6 File: /etc/systemd/network/wired.network
[Match] Name=eth0 [Network] #DHCP=yes DHCP=no Address=10.0.0.10/24 Gateway=10.0.0.1[Ctrl]+[o]?[Enter]?[Ctrl]+[x]で保存・終了します。
$ cd /lib/systemd/system $ sudo mv dhcpcd.service dhcpcd.service.org $ cd # homeに戻るコマンドでも分かるようにユニットファイルの保存されている場所は /lib/systemd/system と /etc/systemd/system の2ヶ所ですが、 ユーザ作成用としては後者です。 そして、ユーザ作成用の /etc 内の方が優先されます。
$ sudo update-rc.d dhcpcd remove私の場合、これで再起動してみたところ相変わらず dhcpcd が起動していました。($ ps -eで確認)そこで、スクリプト自体を移動させてみました。
$ sudo mv /etc/init.d/dhcpcd /home/piこれで立ち上がらなくする事が出来ました。
$ sudo systemctl stop networking.service $ sudo systemctl disable networking.service
$ sudo systemctl is-enabled systemd-networkd.service disable $ sudo systemctl enable systemd-networkd.service
$ sudo reboot
| ポート | プロトコル | 概 要 |
|---|---|---|
| 80 | TCP | http ダッシュボード用WEBの参照 httpsの場合 443 |
| 10001 | UDP | XLX本体とのJSONインターフェース |
| 10002 | UDP | XLXインターリンク(Peer to Peer) |
| 22又は 変更したポート | TCP | セキュリティ上、リモートによる支援が必要な場合のみとする |
| 20001 | UDP | DPlus プロトコル用 |
| 30001 | UDP | DExtra プロトコル用 |
| 30051 | UDP | DCS プロトコル用 |
$ sudo apt-get install git git-core $ sudo apt-get install php # php パッケージ(apache2が含まれます。2018年現在 PHP7)
$ git clone https://github.com/LX3JL/xlxd.git
$ cd xlxd/src/ $ sudo make $ sudo make clean $ sudo make install $ cdインストール先は /xlxd です。
$ sudo cp xlxd/scripts/xlxd /etc/init.d/ $ sudo nano /etc/init.d/xlxd
GNU nano 2.2.6 File: /etc/init.d/xlxd
:
:
# change below settings according to your system
NAME="xlxd"
DAEMON="/xlxd/xlxd"
ARGUMENTS="XLX047 10.0.0.10 127.0.0.1"
PIDFILE="/var/log/xlxd.pid"
USER=root
GROUP=root
:
:
「XLX047」の部分は、欲しい番号が使われていないのを確認の上、記入します。先取方式ですが正式登録(後述の自動認証)されねばなりません。
また、その後のIPアドレスは前者が上記ネットワークの設定で固定したアドレス、後者がAMBE Serverのアドレスで使用しない時でも127.0.0.1にします。
[Ctrl]+[o]?[Enter]?[Ctrl]+[x]で保存・終了します。$ sudo nano /etc/systemd/system/xlxd.service
GNU nano 2.2.6 File: /etc/systemd/system/xlxd.service
[Unit]
Description=XLX Reflector Daemon by LC1IQ
After=systemd-networkd.service
# ネットワーク設定の違いにより自動起動しない時試してください。
# After=network.target
# After=networking.service
[Service]
Type=forking
ExecStart=/etc/init.d/xlxd start
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Ctrl]+[o]?[Enter]?[Ctrl]+[x]で保存・終了します。$ sudo systemctl enable xlxd.serviceこれで、再起動すれば自動起動してくれるはずですが、まだ重要な環境設定が終わっていませんので、後で再起動する事になります。
$ sudo cp -r ~/xlxd/dashboard/* /var/www/html/ $ sudo rm /var/www/html/index.html
$ sudo mkdir /callhome $ sudo chmod 777 /callhome $ sudo chmod +r /var/log/messages
$ sudo nano /var/www/html/pgs/config.inc.php
GNU nano 2.2.6 File: /var/www/html/pgs/config.inc.php
<?php /* Possible values for IPModus HideIP ShowFullIP ShowLast1ByteOfIP ShowLast2ByteOfIP ShowLast3ByteOfIP */ $Service = array(); $CallingHome = array(); $PageOptions = array(); $PageOptions['ContactEmail'] = 'xlx047@todo.vc'; // 管理者用メールアドレス $PageOptions['DashboardVersion'] = '2.3.9'; // Dashboard Version $PageOptions['PageRefreshActive'] = true; // WEBのリフレッシュをする(true)/しない(false) $PageOptions['PageRefreshDelay'] = '10000'; // 10秒に1回 $PageOptions['RepeatersPage'] = array(); $PageOptions['RepeatersPage']['LimitTo'] = 99; // 接続可能なリピータ数の上限 $PageOptions['RepeatersPage']['IPModus'] = 'ShowLast1ByteOfIP'; // IPアドレスを右1桁のみ表示(標準:すべて表示) $PageOptions['RepeatersPage']['MasqueradeCharacter'] = '*'; // 隠す部分の代替え文字指定 $PageOptions['PeerPage'] = array(); $PageOptions['PeerPage']['LimitTo'] = 99; // 接続可能なピア数の上限 $PageOptions['PeerPage']['IPModus'] = 'ShowLast1ByteOfIP'; // IPアドレスを右1桁のみ表示(標準:すべて表示) $PageOptions['PeerPage']['MasqueradeCharacter'] = '*'; // 隠す部分の代替え文字指定 $PageOptions['LastHeardPage']['LimitTo'] = 39; // ラストハードの表示行数を指定(規定値40行) $PageOptions['ModuleNames'] = array(); // Module nomination 変更しています $PageOptions['ModuleNames']['A'] = 'Int\'l Peers'; $PageOptions['ModuleNames']['B'] = 'JA Room'; $PageOptions['ModuleNames']['C'] = 'JA Peers'; $PageOptions['ModuleNames']['D'] = ''; $PageOptions['MetaDescription'] = 'XLX is a D-Star Reflector System for Ham Radio Operators.'; $PageOptions['MetaKeywords'] = 'Ham Radio, D-Star, XReflector, XLX, XRF, DCS, REF, '; $PageOptions['MetaAuthor'] = 'LX1IQ'; $PageOptions['MetaRevisit'] = 'After 30 Days'; // この5項目は SEO 対策なので変更しない。 $PageOptions['MetaRobots'] = 'index,follow'; $PageOptions['UserPage']['ShowFilter'] = true; // ユーザページのフィルタ記入枠を表示又は消去(false)します $PageOptions['Traffic']['Show'] = true; // ネットワークトラフィックのメニューを表示又は消去(false) $Service['PIDFile'] = '/var/log/xlxd.pid'; $Service['XMLFile'] = '/var/log/xlxd.xml'; $CallingHome['Active'] = true; // ここをtrueにしないと接続不可 $CallingHome['MyDashBoardURL'] = 'http://xlx047.ddns.net'; // dashboard url $CallingHome['ServerURL'] = 'http://xlxapi.rlx.lu/api.php'; // 変更厳禁 $CallingHome['PushDelay'] = 600; // push delay in seconds $CallingHome['Country'] = "JAPAN"; // 国名又はエリア名 $CallingHome['Comment'] = "Hosted by 'Day After Day D*Star Network'. Now Testing on Jessie 4.4.13-v7+ RPi2."; // コメント最大100文字 $CallingHome['HashFile'] = "/callhome/callinghome.php"; // /tmp/から/callhome/に変更 $CallingHome['OverrideIPAddress'] = ""; // 設定不要 $CallingHome['InterlinkFile'] = "/xlxd/xlxd.interlink"; // インターリンク設定ファイルの場所 $VNStat['Interfaces'] = array(); $VNStat['Interfaces'][0]['Name'] = 'eth0'; // ネットワークトラフィックを測定するインターフェース名(Wi-Fi: wlan0など) $VNStat['Interfaces'][0]['Address'] = 'eth0'; $VNStat['Binary'] = '/usr/bin/vnstat'; /* include an extra config file for people who dont like to mess with shipped config.ing.php this makes updating dashboard from git a little bit easier */ if (file_exists("../config.inc.php")) { include ("../config.inc.php"); } ?>赤い文字の部分が今回、変更・追加した部分です。
$ ps -e | grep xlxd 29227 ? 08:56:50 xlxdプロセス番号と共に上のように表示されれば起動しています。もし起動していない時は
$ sudo /etc/init.d/xlxd startとしてみて、もし立ち上がれば /etc/systemd/system/xlxd.service に問題があるかも知れません。
$ ps -e | grep apache2 1356 ? 00:00:02 apache2 1359 ? 00:10:01 apache2 1362 ? 00:10:15 apache2 1456 ? 00:10:07 apache2 1457 ? 00:09:48 apache2 4624 ? 00:01:08 apache2 4674 ? 00:01:22 apache2 4675 ? 00:01:18 apache2 4676 ? 00:01:07 apache2 4700 ? 00:01:00 apache2 5008 ? 00:00:12 apache2apache2 が立ち上がっている事が分かります。それでも表示しない場合は、WEB公開用のディレクトリー指定が違っているかも知れません。 今回のシナリオどおりにインストールを行うと、公開ディレクトリーの指定を変更する必要は無いはずですが、チェックしてみます。 実際に index.php の存在している公開フォルダは /var/www/html です。
$ sudo nano /etc/apache2/sites-available/000-default.conf
GNU nano 2.2.6 File: /etc/apache2/sites-available/000-default.conf
[Ctrl]+[o]?[Enter]?[Ctrl]+[x]で保存・終了します。# The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html : :
$ sudo nano /var/www/html/pgs/users.php44行目・・・
GNU nano 2.2.6 File: /var/www/html/pgs/users.php
<td width="150">'.@date("Y.m.d H:i", $Reflector->Stations[$i]->GetLastHeardTime()).'</td>
d.m.Y となっているのを Y.m.d に変更するだけです。大文字/小文字は意味がありますので注意してください。
これを、repeaters.php、peers.php にも施します。