Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server setup #32

Open
bvssvni opened this issue Nov 23, 2015 · 0 comments

Comments

@bvssvni
Copy link
Member

commented Nov 23, 2015

Set up a Droplet on DigitalOcean.com (10$ bonus).
Ubuntu 14.04.3 x64
Recommend setting up a SSH public key (link to instructions on Droplet setup page).

How to use Vim:
    I - edit mode
    ESC - view mode
    :wq - save and exit

These instructions assume you know how to use Vim.
# - remote (SSH)
$ - local (Terminal)

Addd a user with administrator privileges:
# ssh root@<ip>
# adduser <myname>
# gpasswd -a <myname> sudo
# su - <myname>
# mkdir .ssh
# chmod 700 .ssh
# vim .ssh/authorized_keys

Copy public key into the `authorized_keys` file.
$ cat ~/.ssh/id_rsa.pub
# <hit I to goto insert mode>
# <paste in the text with Ctrl+V>
# <press ESC, type ':wq', ENTER>

Test the user login through another Terminal window:
# ssh <myname>@<ip>

Disable root login to improve security, using root login Terminal window.
Make sure to test the user login first!
# vim /etc/ssh/sshd_config
# <find line with 'PermitRootLogin yes'>
# <hit I to goto insert mode>
# <change 'yes' to 'no'>
# <hit ESC, type ':wq', ENTER>
# service ssh restart
# exit

Install Rust, clone the Pluto repo and install packages:
# curl -sSf https://static.rust-lang.org/rustup.sh | sh
# sudo apt-get install git
# git clone https://github.com/PistonDevelopers/pluto
# sudo apt-get install pkg-config
# sudo apt-get install gcc
# sudo apt-get install libssl-dev

Change the ip address in the source to your Droplet's ip address:
# cd pluto
# vim src/main.rs
# <hit I to goto insert mode>
# <Change 'localhost' to your Droplet's ip address, change port to 80>
# <press ESC, type ':wq', ENTER>

Run the website (requires sudo because of port 80):
# sudo cargo run --release

Run the website even when not connected through SSH:
# sudo nohup cargo run --release &

Kill process:
# ps aux | grep pluto
# kill <pid>

Restart:
# sudo shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.