鈍足ランナーのIT日記

走るのが好きな5流のITエンジニアのブログ。

趣味の範囲は広いけど、どれも中途半端なクソブロガー楽しめるWebアプリを作ってあっと言わせたい。サーバーサイドPerl(Mojolicious)、クライアントサイドVue.js。Arduinoにも触手を伸ばす予定。

モニターオーディオのトールボーイスピーカーがほしい

狙っているのはモニターオーディオBronzeシリーズ。

大きさがそんなに大きくないのがいい感じです。

名前 BR5 BX5 Bronze5
発売 2006年11月 2010年7月 2015年7月

発売周期は4〜5年程度。そう考えると、次のモデルは2019年あたりか。
まだまだバーゲンセールになるには時間がかかりそうです。

現在、新品で一番やすいのが税込で83,106円



Mojolicousアプリのリリース手順

毎回忘れてしまうので、一回まとめておく。環境等は自分向けなので、個人的な備忘録です。

nginx.confの編集

/usr/local/nginx/conf/nginx.conf

    upstream laundry {
         server 127.0.0.1:8016;
    }

    server {
        listen 80;
        server_name side-business.biz;
        #index index.html;
        root /home/your_username/laundry/laundry_web/public;
        access_log  /var/log/laundry.access.log  main;

        location @proxy {

            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_pass http://laundry;
        }

        location / {
            try_files $uri   @proxy;
        }
    }
supervisorctl restart nginx
||

* Mojolicousアプリのリリース

/etc/supervisord.dへlaundry.confを作成

|text|
[program:laundry]
user=hoge
command=/home/hoge/laundry/laundry_web/run
directory=/home/hoge/laundry/laundry_web
redirect_stderr=true
stdout_logfile=/var/log/supervisord/laundry.log
stdout_logfile_maxbytes = 5MB
stderr_logfile=/var/log/supervisord/laundry.err
stderr_logfile_maxbytes = 5MB
stdout_logfile_backups = 5
autorestart = true
startsecs = 5

CentOS6 にPostgreSQL9.6+PostGIS2.3を導入する

さて、手順を備忘録としてまとめていく。

CentOS 6 に PostgreSQL 9.x を yum インストールする手順 | WEB ARCH LABO

インストールとサービスの起動まで

$ sudo yum -y localinstall http://yum.postgresql.org/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm
$ sudo yum list postgresql*

sslエラーとなったので、一旦リポジトリを無効化

$ sudo vi /etc/yum.repos.d/pgdg-96-centos.repo 
#[pgdg96]の編集して、enabled=0へ編集
#enabled=0

久々にログインしたサーバでyumしたらepel接続でsslエラーが出たので対応 - Qiita

こちらを参照してnssを更新後、再度、pgdg96を有効化

$ sudo yum -y install postgresql96-server postgresql96-devel
$ sudo  service postgresql-9.6 initdb
$ sudo chkconfig postgresql-9.6 on
$ sudo service postgresql-9.6 start

サーバの起動まで出来ました

データベースの作成とユーザの設定

UbuntuでPostgreSQLを使ってみよう (2) — Let's Postgres

$ sudo passwd postgres
$ su - postgres
$ createdb test
$ create user hoge
$ psql -d test
test=#  create role hoge with login;
test=#  ¥q
$ exit
$ su - hoge
$ psql -d test   # hogeユーザでログイン可能になる

PostGISのインストール

$ sudo yum list postgis*
$ sudo yum --enablerepo=epel -y install postgis2_96 postgis2_96-client

postgis環境設定など

ユーザの作成

su - postgres
create user hoge -P   #db ユーザを作成する OSユーザと合わせる
psql -d test
test=# create extension postgis;
ERROR:  ライブラリ"/usr/pgsql-9.6/lib/rtpostgis-2.3.so"をロードできませんでした: libhdf5.so.6: 共有オブジェクトファイルを開けません: そのようなファイルやディレクトリはありません

so.7は存在するようなので

postgresql - Postgres create POSTGIS extension error with CentOS 6 - Stack Overflow

$ cd /usr/lib64
$ sudo ln -s libhdf5_hl.so.7 libhdf5_hl.so.6
$ sudo ln -s libhdf5.so.7 libhdf5.so.6

再度実行見事できた。

su - postgres
psql -d test    
test=# create extension posts;
CREATE EXTENSION
test=# SELECT PostGIS_full_version();
                                                                       postgis_f
ull_version                                                                     
  
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
 POSTGIS="2.3.0 r15146" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.8.0, 6 March 
2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.6" LIBJSON="0.11" RASTE
R
(1)