LoginSignup
0
0

More than 1 year has passed since last update.

APIリリースの手順(2)

Posted at

Teratermを用いてプロジェクトのリリースを行う

1. Teratermのインストール

 ① zipファイルをダウンロードし、解凍する。
 ② 「ttermpro」を開く。
 ③ 言語設定より始まり、Teraterm セットアップウィザード通りに手中を進めていく。

 インストール先はドライブなどに設定する。(今回はDドライブに設置。)

 「コンポ―ネメント」の」選択画面では、デフォルト値のまま「次へ」をクリックする。

 全て選択し終えるとインストールを開始する。

2. Teratermの起動

 ・ Host             :接続先ホストのアドレス(ドメイン名もしくはIPアドレス)
 ・ Service         :SSH
 ・ TCP port#    :22
 ・ SSH version :SSH2

 最初の接続時はホスト認証の確認を促されるため、「続行」をクリックし、先へ進む。

 接続先のユーザー名とパスワードを入力し、「OK」をクリックする。

 ・ User name  :Linuxのユーザ名(仮:userName)
 ・ Passphrase  :Linuxのパスワード(設定している場合入力)

  RSA/DSA/ECDSA/ED25519 の秘密キーを設定している場合は、
 「Use RSA/DSA/ECDSA/ED25519 key to log in」へ入力

Teraterm
Last login: Sun Jul 24 23:50:19 2022 from ip-172-16-1-201.ap-northeast-1.compute.internal

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
48 package(s) needed for security, out of 81 available
Run "sudo yum update" to apply all updates.
[xxxxxxx@ip-172-16-10-120 ~]$
[xxxxxxx@ip-172-16-10-120 ~]$ cd /var/sample
[xxxxxxx@ip-172-16-10-120 var]$ cd ./sample
[xxxxxxx@ip-172-16-10-120 sample]$ sudo mkdir 20220725
[xxxxxxx@ip-172-16-10-120 sample]$ sudo chown userName /var/sample/20220725
[xxxxxxx@ip-172-16-10-120 sample]$ cd ./20220725
[xxxxxxx@ip-172-16-10-120 20220725]$ ls
sample-0.0.1.jar
[xxxxxxx@ip-172-16-10-120 20220725]$ ps -ef | grep java
userName 1023     1  0 Mar03 ?        00:08:44 java -jar wms-0.0.1.jar
userName 6885 20325  0 07:53 pts/0    00:00:00 grep ⁻⁻color=auto java
[xxxxxxx@ip-172-16-10-120 20220725]$ kill 6885
[xxxxxxx@ip-172-16-10-120 20220725]$ nohup java -jar sample-0.0.1.jar > log.txt 2> error.txt < /dev/null &

Linuxコマンドを実行していく。
cd /var/sample
cd ./sample ・・・フォルダを見つける
sudo mkdir 20220725 ・・・ファイルを作成
sudo chown userName /var/sample/20220725 ・・・権限を付与
cd ./20220725 ・・・フォルダを見つける
ps -ef | grep java ・・・APIの動作を停止
kill プロセスID (上記では「プロセスID = 6885」) ・・・選択したAPIを終了
nohup java -jar sample-0.0.1.jar > log.txt 2> error.txt < /dev/null &
  ・・・再度APIを起動

最後に、開発環境のURLページを開き、APIに接続出来ているか確認を行う。

おわりに

簡易的に書き示してしまっているので、より具体的にLinuxコマンドの意味等を知りたい場合は、別途調べてみてください!

参考

・New Connectionの詳細:https://ttssh2.osdn.jp/manual/4/ja/menu/file-new.html
・Teraterm起動手順:https://eng-entrance.com/teraterm-install
・Linuxコマンド集:https://eng-entrance.com/linux-command-ps
 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0