Last active
September 7, 2015 00:55
-
-
Save tokida/d50f54decf3dd0511459 to your computer and use it in GitHub Desktop.
NODE-RED on Ubuntu for SoftLayer Virtual Machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#======================================================================= | |
# node-red for ubuntu@SoftLayer | |
# | |
#======================================================================= | |
sudo apt-get update | |
sudo apt-get upgrade | |
# Install Util | |
sudo apt-get install git -y | |
sudo apt-get install curl -y | |
# Install SoftLayer Command line Interface | |
sudo apt-get install python-pip -y | |
pip install softlayer | |
# Japanese Locale | |
sudo apt-get install -y language-pack-ja-base language-pack-ja | |
update-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja" | |
source /etc/default/locale | |
# Japan TimeZone | |
cp -p /usr/share/zoneinfo/Asia/Tokyo /etc/localtime | |
echo "Asia/Tokyo" > /etc/timezone | |
# Please make sure to set SSH-KEY | |
sed -ri 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config | |
sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config | |
sed -ri 's/#PermitEmptyPasswords no/PermitEmptyPasswords yes/g' /etc/ssh/sshd_config | |
#--------------------------------- | |
# get User_data | |
# curl -k https://api.service.softlayer.com/rest/v3/SoftLayer_Resource_Metadata/getUserMetadata > ~/userMetadata.txt | |
# apt-get install -y apache2 | |
#---------------------------------- | |
# add package node-red | |
# http://nodered.org/docs/getting-started/installation.html | |
sudo apt-get install nodejs npm -y | |
ln -s /usr/bin/nodejs /usr/bin/node | |
npm install -g node-red | |
mkdir /root/.node-red | |
cp -p /usr/local/lib/node_modules/node-red/settings.js /root/.node-red/ | |
sed -ri 's\//httpAdminAuth\httpAdminAuth\g' /root/.node-red/settings.js #default "user"'s password "password" | |
## password generate | |
#cd /usr/local/lib/node_modules/node-red | |
#node -e "console.log(require('bcryptjs').hashSync(process.argv[1], 8));" password | |
## start node-red from pm2 | |
npm install -g pm2 | |
pm2 start `which node-red` | |
pm2 show 0 | |
# npm install -g node-red-admin | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment