Project

General

Profile

Actions

機能 #17

open

xserver vps

Added by keiji ono 6 months ago. Updated 5 months ago.

Status:
新規
Priority:
通常
Assignee:
-
Start date:
12/20/2025
Due date:
% Done:

0%

Estimated time:

Description

r.jetelina/d.jetelinaのvpsをhostinger->xserverへ


Files

xserverssh.tar (10 KB) xserverssh.tar keiji ono, 01/14/2026 11:16 AM
getredminedump.sh (89 Bytes) getredminedump.sh keiji ono, 01/14/2026 11:23 AM
Actions #1

Updated by keiji ono 6 months ago

x_ssh_key.pemは~/.ssh配下にある

ssh: ssh -i x_ssh_key.pem
down: scp :~/g_jetelina.tar.gz .
up: scp -i x_ssh_key.pem /home/onoke/d_site/redmine_jetelina.dump :~/

xserver panel
/sada..1ateru..0
https://secure.xserver.ne.jp/xapanel/login/xvps

Actions #2

Updated by keiji ono 6 months ago

redmine ssl

<VirtualHost r.jetelina.org:443>
        ServerName r.jetelina.org
        ServerAdmin webmaster@localhost

        #DocumentRoot /var/www/html
        DocumentRoot /var/lib/redmine/public
        ・
        SSLEngine on
        ・
        SSLCertificateFile      /etc/ssl/certs/certificate.crt
        SSLCertificateKeyFile   /etc/ssl/private/private.key
        ・
        SSLCertificateChainFile /etc/ssl/certs/ca_bundle.crt
        ・
</VirtualHost>

Actions #3

Updated by keiji ono 6 months ago

xserver vpsをr.jetelina.orgに紐付ける

hostingerのdnsで"r.jetelina.org"のドメインdnsにxserverを追記する

CNAME    www    0    r.jetelina.org    14400     <- これが要るかどうかは不明
CNAME    r    0    r.jetelina.org    14400     <-    〃
A    @    0    162.43.6.34    14400    

xserver側ではdns設定は不要

Actions #4

Updated by keiji ono 6 months ago

xserver vpsは無料なので4日毎に利用期限更新が必要。
毎週月・金にやることにする

トップページ → サーバ → 右はじの":"から「契約情報」選択 → ”利用期限”の”更新する”ボタンをクリック

Actions #5

Updated by keiji ono 6 months ago

redmineのバックアップは毎日3時にcron実行されて /root/redmine_dump/redmine.dump となる

root@x162-43-6-34:~/redmine_dump# crontab -l
0 3 * * * /root/redmine_dump/backup.sh

backup.sh
sudo -u postgres pg_dump redmine > /root/redmine_dump/redmine.dump     <- 一行だけ

このdumpファイルをローカルにcronでダウンロードしようとするがローカルでcronがうまく動かない。
なのでとりあえずssh4xserver.shを実行する時には同時にダウンロードをするようにしておいて、あとは気づいたときにダウンロードすることにする。

dumpファイルダウンロードスクリプト
getredminedump.sh
scp -i /home/onoke/.ssh/x_ssh_key.pem root@162.43.6.34:/root/redmine_dump/redmine.dump .

ssh4xserver.sh
./getredminedump.sh
ssh -i ~/.ssh/x_ssh_key.pem root@162.43.6.34

Actions #6

Updated by keiji ono 6 months ago

info and script of ssh

Actions #7

Updated by keiji ono 6 months ago

download redmine dump file

Actions #8

Updated by keiji ono 5 months ago

r.jetelina.orgのssl証明書

次回の期限切れ時にはcertbotによる自動取得が行われるらしいが、本当かなぁ。

20206/2/2にlet's encryptに変更した。
ref: https://chee-s.net/%E3%80%90ubuntu-24-04%E5%AF%BE%E5%BF%9C%E3%80%91lets-encrypt%E3%81%A7%E7%84%A1%E6%96%99ssl%E8%A8%BC%E6%98%8E%E6%9B%B8%E3%82%92%E5%B0%8E%E5%85%A5%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%82%92

certbotをapt installしてから
root@x162-43-6-34:~# which certbot
/usr/bin/certbot

certbot実行時には80portを使うので一旦apacheを止める必要があるみたい。
root@x162-43-6-34:~# sudo systemctl stop apache2
root@x162-43-6-34:~# sudo certbot certonly --standalone -d r.jetelina.org
  ・
  ・
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/r.jetelina.org/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/r.jetelina.org/privkey.pem
This certificate expires on 2026-05-02.

その後、/etc/sslのcertsとprivateに取得された*.pemファイルをコピー。
/etc/apache2/sites-enabled/default-ssl.confのSSLCertificate*が該当*.pemになっていることを確認してapache2を再起動する。
        SSLCertificateFile      /etc/ssl/certs/fullchain.pem
        SSLCertificateKeyFile   /etc/ssl/private/privkey.pem

>sudo systemctl start apache2
Actions

Also available in: Atom PDF