2017 09,22 15:09 |
|
ちょっとハマったので、記載
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hoge/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hoge/.ssh/id_rsa.
Your public key has been saved in /home/hoge/.ssh/id_rsa.pub.
The key fingerprint is:
1c:c8:cf:03:78:18:d6:31:e4:13:a0:83:d9:80:5b:d8 hoge@hogehoge.server
The key's randomart image is:
+--[ RSA 2048]----+
|oo ++=. |
|o=Eo *.+ |
|oo+ o B . |
|. . . * . |
| S |
| . |
| |
| |
| |
+-----------------+
$
$ cat id_rsa.pub >authorized_keys
$ ll
合計 16
-rw-rw-r-- 1 hoge hoge 413 9月 22 11:55 2017 authorized_keys
drwxrwxr-x 2 hoge hoge 4096 9月 22 11:54 2017 back
-rw------- 1 hoge hoge 1675 9月 22 11:55 2017 id_rsa
-rw-r--r-- 1 hoge hoge 413 9月 22 11:55 2017 id_rsa.pub
$
$ chmod 0600 authorized_keys
$
$
$ sftp -oIdentityFile=/home/hoge/.ssh/id_rsa hoge@hogehoge.server
Connecting to hogehoge.server...
The authenticity of host 'hogehoge.server (hogehoge.server)' can't be established.
RSA key fingerprint is 57:e4:19:5f:e3:c0:a9:81:54:9d:9a:bc:8d:68:a4:b0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'hogehoge.server' (RSA) to the list of known hosts.
hoge@hogehoge.server's password:
Permission denied, please try again.
hoge@hogehoge.server's password:
Permission denied, please try again.
hoge@hogehoge.server's password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Couldn't read packet: Connection reset by peer
$
$
$ ll
合計 20
-rw------- 1 hoge hoge 413 9月 22 11:55 2017 authorized_keys
drwxrwxr-x 2 hoge hoge 4096 9月 22 11:54 2017 back
-rw------- 1 hoge hoge 1675 9月 22 11:55 2017 id_rsa
-rw-r--r-- 1 hoge hoge 413 9月 22 11:55 2017 id_rsa.pub
-rw-r--r-- 1 hoge hoge 395 9月 22 11:55 2017 known_hosts
$
$
$ ssh-copy-id hoge@hogehoge.server
hoge@hogehoge.server's password:
Now try logging into the machine, with "ssh 'hoge@hogehoge.server'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
$ ll
合計 20
-rw------- 1 hoge hoge 413 9月 22 11:55 2017 authorized_keys
drwxrwxr-x 2 hoge hoge 4096 9月 22 11:54 2017 back
-rw------- 1 hoge hoge 1675 9月 22 11:55 2017 id_rsa
-rw-r--r-- 1 hoge hoge 413 9月 22 11:55 2017 id_rsa.pub
-rw-r--r-- 1 hoge hoge 395 9月 22 11:55 2017 known_hosts
$
$ ls -ltr
合計 20
drwxrwxr-x 2 hoge hoge 4096 9月 22 11:54 2017 back
-rw-r--r-- 1 hoge hoge 413 9月 22 11:55 2017 id_rsa.pub
-rw------- 1 hoge hoge 1675 9月 22 11:55 2017 id_rsa
-rw------- 1 hoge hoge 413 9月 22 11:55 2017 authorized_keys
-rw-r--r-- 1 hoge hoge 395 9月 22 11:55 2017 known_hosts
$
$
$
$ sftp -oIdentityFile=/home/hoge/.ssh/id_rsa hoge@hogehoge.server
Connecting to hogehoge.server...
sftp> \q
Invalid command.
sftp>
sftp> quit
$
$ 他のサイトでは、id_rsa.pubを接続先のサーバに持っていき、 authorized_keysに、id_rsa.pubの中身を記述とあったけど、これでうまく行かなかった 他の方法でとして、 $ ssh-copy-id hoge@hogehoge.server として、成功 PR |
|
2017 08,23 18:26 |
|
2017 06,12 13:30 |
|
Tomcatのcatalina.outが肥大化していたのでローテーションを行う設定に
しかし、方法がいくつかあるみたい しかも、tomcatのログのパスが異なるので、 自分の環境に合うパスの設定を行ってみました。 /usr/local/tomcat/logs/catalina.out {
missingok
copytruncate
daily
sharedscripts
postrotate
EXT=`date +%Y%m%d`
for f in $1;
do mv $f.1 $f.$EXT;
done
endscript
} ポイントは、copytruncate のようです。 tomcatは、logrotateのsyslogなどのデフォルトの設定をコピーして使用すると、 tomcatがログ・ファイルを掴んだ状態になってしまう とのこと /usr/sbin/logrotate -d /etc/logrotate.d/tomcat で確認 大丈夫そうなので、1度だけど強制に実行をしました。 /usr/sbin/logrotate -f /etc/logrotate.d/tomcat 強制的に実行した際は、問題なし。ちゃんと明日は、ローテーションされているかな? |
|
2017 06,07 17:12 |
|
2017 05,22 17:39 |
|
こいつも嵌りました。。。。
1日で2つの異なる環境をつくるもんじゃないね。。。
まず、gitインストール
$ yum install git
パッケージインストール
$ yum install gcc-c++ glibc-headers openssl-devel readline libyaml-devel readline-devel zlib zlib-devel
rubyインストール
$ git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
$ echo 'export RBENV_ROOT="/usr/local/rbenv"' >> /etc/profile
$ echo 'export PATH="${RBENV_ROOT}/bin:${PATH}"' >> /etc/profile
$ echo 'eval "$(rbenv init -)"' >> /etc/profile
$ source /etc/profile
バージョンの確認
$ rbenv --version
ruby-buildインストール
$ git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
$ rbenv install -l
$ rbenv install -v ヴァージョン
$ rbenv rehash
これで、インストールできず。。。
仕方ないので、
$ wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz
$ tar zxvf ruby-2.3.3.tar.gz
$ cd ruby-2.3.3
$ ./configure
$ make
$ make install
$ gem update --system
で、アップデートをさせました
試しに、プロジェクトを作ってみることに
$ rails new test_ruby
$ rails g controller users index show
これでエラーになったので。。。
$ gem install --no-ri --no-rdoc rails
$ gem install bundler
とやってもダメ
アプリケーション内のGemfileファイルを編集
#gem 'therubyracer', platforms: :ruby となっている部分の下に
gem 'therubyracer' と記述
$ bundle install
$ bundle update
インストールして、アップデートもしてみた
そして、再度実行
$ rails g controller users index show
おぉ~、エラーが消えた!!!
Ruby on Railsの環境作りも面倒。。。
Ruby on Railsは、絶対にすんなり環境構築は出来ないものだと確信をしました。
参考
https://readouble.com/laravel/4.2/ja/quick.html
http://qiita.com/shinyashikis@github/items/3501c5f7f71a8e345c3d
http://qiita.com/kshimadutsu/items/26aff85950fa28fffc09
http://qiita.com/cosuprog/items/2f6bdf6e4119cb20058b
http://krs1.hatenablog.com/entry/2016/05/30/120000 |
|
忍者ブログ [PR] |