プロジェクト概要#
基づいて fatedier/frp オリジナルの frp 内網透過サーバー frps のワンクリックインストールアンインストールスクリプトと docker イメージ。Linux サーバーや docker などの多様な環境でのインストールデプロイをサポート。
- GitHub stilleshan/frps
- Docker stilleshan/frps
X86 と ARM のための docker イメージサポート
更新#
- 2024-02-25 新バージョンに更新、toml 設定ファイルをサポート。
- 2021-05-31 国内ミラーを更新し、使用を便利にしました。
- 2021-05-31 Linux ワンクリックインストールスクリプトを更新し、X86 と ARM を同時にサポート。
- 2021-05-29
0.36.2
バージョンから docker イメージが X86 と ARM を同時にサポート。
使用#
frps サーバーは設定パラメータが必要なため、本スクリプトはオリジナルの frps.toml です。インストールが完了したら、frps.toml を編集してポート、パスワードなどの関連パラメータを設定し、サービスを再起動してください。また、リポジトリをフォークして frps.toml を自分で変更し、ワンクリックインストールを行うことも非常に便利です。後で frps.toml を自分で設定し、frps のバージョンを調整することもできます。
ワンクリックスクリプト(スクリプトを実行した後、frps.toml ファイルを自分で変更してください。)#
インストール
wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_install.sh && chmod +x frps_linux_install.sh && ./frps_linux_install.sh
# 以下は国内ミラー
wget https://github.ioiox.com/stilleshan/frps/raw/branch/master/frps_linux_install.sh && chmod +x frps_linux_install.sh && ./frps_linux_install.sh
使用
vi /usr/local/frp/frps.toml
# frps.toml 設定を変更
sudo systemctl restart frps
# frps サービスを再起動して有効にします
アンインストール
wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_uninstall.sh && chmod +x frps_linux_uninstall.sh && ./frps_linux_uninstall.sh
# 以下は国内ミラー
wget https://github.ioiox.com/stilleshan/frps/raw/branch/master/frps_linux_uninstall.sh && chmod +x frps_linux_uninstall.sh && ./frps_linux_uninstall.sh
カスタムワンクリックスクリプト(まずこのリポジトリをフォークし、frps.toml ファイルを自分で変更した後にスクリプトを実行してください。)#
- まずこのリポジトリをフォークします
- frps.toml を設定します
- frps_linux_install.sh スクリプトを変更します
- スクリプトのリンクを変更します
- リポジトリを GitHub にプッシュします
frps_linux_install.sh スクリプトの変更#
FRP_VERSION=0.60.0
はオリジナルプロジェクトの最新バージョンに応じて変更できます。
REPO=stilleshan/frps
は fork して自分のリポジトリにしたため、stilleshan
を自分の GitHub アカウント ID に変更する必要があります。
ワンクリックスクリプトの実行#
以下のスクリプトリンクの stilleshan
を自分の GitHub アカウント ID に変更した後、実行してください。
wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_install.sh && chmod +x frps_linux_install.sh && ./frps_linux_install.sh
アンインストールスクリプト#
frps_linux_uninstall.sh アンインストールスクリプトは汎用スクリプトで、直接実行できます。また、上記の方法でリンクを変更してから実行することもできます。
wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_uninstall.sh && chmod +x frps_linux_uninstall.sh && ./frps_linux_uninstall.sh
frps 関連コマンド#
sudo systemctl start frps
# サービスを起動
sudo systemctl enable frps
# 自動起動を設定
sudo systemctl status frps
# 状態を確認
sudo systemctl restart frps
# サービスを再起動
sudo systemctl stop frps
# サービスを停止
docker デプロイ#
frps.toml ファイルのマウント、フォーマット、または設定の誤りによってコンテナが正常に動作せず、ループ再起動するのを避けるために、frps.toml を先に設定してから起動を実行してください。
まず git clone このリポジトリを行い、frps.toml ファイルを正しく設定します。
git clone https://github.com/stilleshan/frps
# このリポジトリを git clone
git clone https://github.ioiox.com/stilleshan/frps
# 国内ミラー
vi /root/frps/frps.toml
# frps.toml ファイルを設定
コンテナを起動
docker run -d --name=frps --restart=always \
--network host \
-v /root/frps/frps.toml:/frp/frps.toml \
stilleshan/frps
上記のコマンド -v マウントのディレクトリは git clone したリポジトリを例にしていますが、任意の場所に手動で frps.toml ファイルを作成し、コマンドのマウントパスを変更することもできます。
サービスが実行中に frps.toml 設定を変更した後は、frps サービスを再起動する必要があります。
vi /root/frps/frps.toml
# frps.toml 設定を変更
docker restart frps
# frps コンテナを再起動して有効にします
設定について
==frps.toml==
bindAddr = "0.0.0.0"
bindPort = 7000
#kcpBindPort = 7000
quicBindPort = 7000
webServer.addr = "0.0.0.0"
webServer.port = 7500
webServer.user = "changeme"
webServer.password = "changeme"
log.to = "./frps.log"
log.level = "info"
log.maxDays = 3
log.disablePrintColor = false
auth.method = "token"
auth.token = "changeme"
allowPorts = [
{ start = 443, end = 5000 }
==frpc.toml==
serverAddr = "changeme"
serverPort = 7000
auth.method = "token"
auth.token = "changeme"
[[proxies]]
name = "FD"
type = "tcp"
localIP = "192.168.100.1"
localPort = 443
remotePort = 443
systemctl コマンドを使用して frps を制御する#
sudo systemctl start frps
# frps を起動
sudo systemctl enable frps
# サーバー起動時に自動的に frps を起動
sudo systemctl status frps
# 状態を確認
sudo systemctl restart frps
# frps を再起動
sudo systemctl stop frps
# frps を停止
この記事は Mix Space によって xLog に同期更新されました
元のリンクは https://taikula.cool/posts/tutorial/frp-fu-wu-da-jian