○RAWGraphsの画面
ブラウザでhttp://<仮想マシンのアドレス>:4000にアクセスします。
○構築方法
以下のVagrantfileを使用して、RAWGraphsがインストールされた仮想マシン(CentOS 8.1)を構築できます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-8.1"
config.vm.hostname = "co81rawgraph"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co81rawgraph"
vbox.gui = true
vbox.cpus = 2
vbox.memory = 4096
end
config.vm.network "private_network", ip: "192.168.55.101", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
dnf -y install langpacks-ja
localectl set-locale LANG=ja_JP.UTF-8
dnf install -y epel-release
dnf check-update
dnf -y update
timedatectl set-timezone Asia/Tokyo
# install curl/git/python3
dnf -y install curl git python3
mkdir -p /opt/rawgraph
cd /opt/rawgraph
# install nodejs11
curl -sL https://rpm.nodesource.com/setup_11.x | bash -
dnf -y install nodejs
node -v
# install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
export NVM_DIR="/root/.nvm"
source /root/.bashrc
nvm --version
# install bower
npm install -g bower
bower -v
#bower init --allow-root
# install rawgraphs
git clone https://github.com/densitydesign/raw.git
cd raw
bower install --allow-root
cp js/analytics.sample.js js/analytics.js
# register as a service
cat << EOF > /etc/systemd/system/rawgraph.service
[Unit]
Description=rawgraph
[Service]
Type=simple
ExecStart=/usr/bin/python3 -m http.server 4000
WorkingDirectory=/opt/rawgraph/raw
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable rawgraph
sudo systemctl start rawgraph
SHELL
end
0 件のコメント:
コメントを投稿