Ngrok: Armbian: Difference between revisions
Created page with "==Instalasi== apt update apt -y install snapd snap install ngrok atau (yang penulis gunakan untuk Linux ARM64) wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm64.tgz tar -xvf ngrok-v3-stable-linux-arm64.tgz ==Running== Jika di install menggunakan snap /snap/bin/ngrok authtoken <your_auth_token> /snap/bin/ngrok help /snap/bin/ngrok http 80 Contoh2 lain ngrok http 80 # secure public URL for port 80 web server ngrok..." |
No edit summary |
||
Line 1: | Line 1: | ||
==Instalasi== | ==Instalasi== | ||
atau (yang penulis gunakan untuk Linux ARM64) | |||
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm64.tgz | |||
tar -xvf ngrok-v3-stable-linux-arm64.tgz | |||
pastikan sudah ada file ngrok dengan perintah | |||
ls | |||
kemudian pindahkan file ngrok ke /usr/bin | |||
mv ngrok /usr/bin | |||
Instalasi lain dapat dilakukan seprti ini : | |||
apt update | apt update | ||
Line 5: | Line 21: | ||
snap install ngrok | snap install ngrok | ||
==Pembuatan fail yml== | |||
ngrok authtoken "isi_token_disini" | |||
akan muncul hasilnya seperti ini | |||
Authtoken saved to configuration file: /root/.config/ngrok/ngrok.yml | |||
==Menambahkan Script (Berikut adalah Contoh)== | |||
Script ini sesuai kebutuhan masing-masing, letakkan di bawah baris terakhir pada file yml | |||
tunnels: | |||
ssh: | |||
proto: tcp | |||
addr: localhost:22 | |||
host_header: localhost:22 | |||
web: | |||
proto: http | |||
addr: localhost:8080 | |||
host_header: localhost:808 | |||
==Membuat script autorun== | |||
berjalan secara otomatis jika server di restart | |||
[Unit] | |||
Description=ngrok | |||
After=network.target | |||
[Service] | |||
ExecStart=ngrok start --all --config /root/.config/ngrok/ngrok.yml | |||
ExecReload=/bin/kill -HUP $MAINPID | |||
KillMode=process | |||
IgnoreSIGPIPE=true | |||
Restart=always | |||
RestartSec=3 | |||
Type=simple | |||
[Install] | |||
WantedBy=multi-user.target | |||
==Running== | ==Running== | ||
systemctl enable ngrok.service | |||
Untuk start | |||
systemctl start ngrok.service | |||
Untuk Stop | |||
systemctl stop ngrok.service | |||
==Running yg lain== | |||
Jika di install menggunakan snap | Jika di install menggunakan snap | ||
Revision as of 04:23, 5 March 2023
Instalasi
atau (yang penulis gunakan untuk Linux ARM64)
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm64.tgz tar -xvf ngrok-v3-stable-linux-arm64.tgz
pastikan sudah ada file ngrok dengan perintah
ls
kemudian pindahkan file ngrok ke /usr/bin
mv ngrok /usr/bin
Instalasi lain dapat dilakukan seprti ini :
apt update apt -y install snapd snap install ngrok
Pembuatan fail yml
ngrok authtoken "isi_token_disini"
akan muncul hasilnya seperti ini
Authtoken saved to configuration file: /root/.config/ngrok/ngrok.yml
Menambahkan Script (Berikut adalah Contoh)
Script ini sesuai kebutuhan masing-masing, letakkan di bawah baris terakhir pada file yml
tunnels:
ssh: proto: tcp addr: localhost:22 host_header: localhost:22 web: proto: http addr: localhost:8080 host_header: localhost:808
Membuat script autorun
berjalan secara otomatis jika server di restart
[Unit] Description=ngrok After=network.target
[Service] ExecStart=ngrok start --all --config /root/.config/ngrok/ngrok.yml ExecReload=/bin/kill -HUP $MAINPID KillMode=process IgnoreSIGPIPE=true Restart=always RestartSec=3 Type=simple
[Install] WantedBy=multi-user.target
Running
systemctl enable ngrok.service
Untuk start
systemctl start ngrok.service
Untuk Stop
systemctl stop ngrok.service
Running yg lain
Jika di install menggunakan snap
/snap/bin/ngrok authtoken <your_auth_token> /snap/bin/ngrok help /snap/bin/ngrok http 80
Contoh2 lain
ngrok http 80 # secure public URL for port 80 web server ngrok http -subdomain=baz 8080 # port 8080 available at baz.ngrok.io ngrok http foo.dev:80 # tunnel to host:port instead of localhost ngrok http https://localhost # expose a local https server ngrok tcp 22 # tunnel arbitrary TCP traffic to port 22 ngrok tls -hostname=foo.com 443 # TLS traffic for foo.com to port 443 ngrok start foo bar baz # start tunnels from the configuration file
Referensi