It's a pity, but it's my memorandum because I always forget it: point_up: I separate images and display them using symbolic links. I'm glad if you can use it as a reference. Please point out any mistakes! !!
① Create .ssh / config ② Create a symbolic link
ssh connection ↓ Create symbolic links ↓ Delete symbolic link
Since it is troublesome to enter SSH commands, it is set for each server. I learned from my seniors in the field that I have no timeout setting.
$ cd ~/.ssh
$ vi config
Host *
ServerAliveInterval 30
ServerAliveCountMax 5
TCPKeepAlive yes
### Connect Setting Name ###
Host sample_w1
HostName 0.0.0.1
Port 22
User hoge
IdentityFile sample.pem
After completing the settings, continue.
Create a symbolic link for the server / var / sample_api / public </ code>.
$ ssh sample_w1
[hoge@sample_w1 ~]$ ls /var/sample_api/public
fonts img index.html js
[hoge@sample_w1 ~]$cd project
[hoge@sample_w1 ~]$ ln -s /var/sample_api/public sample_api
[hoge@sample_w1 ~]$ ll
drwxrwsr-x 1 hoge team 0 January 1 13:54 .
drwxrwsr-x 1 hoge team 0 January 1 13:54 ..
lrwxrwxrwx 1 hoge team 0 January 1 13:55 sample_api -> /var/sample_api/public/
[hoge@sample_w1 ~]$ unlink sample_api
[hoge@sample_w1 ~]$ ls -a
. ..
Please note that the rm </ code> command should not delete the entity ...
https://qiita.com/colorrabbit/items/2e99304bd92201261c60 https://www.atmarkit.co.jp/ait/articles/1605/30/news022.html https://qiita.com/passol78/items/2ad123e39efeb1a5286b
Recommended Posts