Skip to content

Instantly share code, notes, and snippets.

@stories2
Last active July 9, 2018 08:15
Show Gist options
  • Save stories2/ec21338deb3a8464c534e32773ada56c to your computer and use it in GitHub Desktop.
Save stories2/ec21338deb3a8464c534e32773ada56c to your computer and use it in GitHub Desktop.

Revisions

  1. stories2 revised this gist Jul 9, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -212,5 +212,6 @@ vim /etc/rc.local
    ```
    And type this command
    ```
    source /etc/profile
    forever /home/stories2/Kiosk-Node-Server/index.js &
    ```
  2. stories2 revised this gist Jul 9, 2018. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -75,6 +75,9 @@ node -v
    ```
    sudo npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
    ```
    ```
    npm install forever --global
    ```

    ### Setup env vars
    ```
    @@ -199,4 +202,15 @@ vim /etc/sudoers
    - Type these down below `root ALL=(ALL:ALL) ALL`
    ```
    <USER ID> ALL=(ALL:ALL) ALL
    ```

    ## Startup autorun backend server program

    ### Setup startup file
    ```
    vim /etc/rc.local
    ```
    And type this command
    ```
    forever /home/stories2/Kiosk-Node-Server/index.js &
    ```
  3. stories2 revised this gist Jul 9, 2018. No changes.
  4. stories2 revised this gist Jul 9, 2018. No changes.
  5. stories2 revised this gist Jul 9, 2018. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -185,4 +185,18 @@ allow_writeable_chroot=YES
    ### Restart FTP
    ```
    systemctl restart vsftpd
    ```

    ## Add new user
    ```
    adduser <USER ID>
    ```

    ### Set user can use super user permission
    ```
    vim /etc/sudoers
    ```
    - Type these down below `root ALL=(ALL:ALL) ALL`
    ```
    <USER ID> ALL=(ALL:ALL) ALL
    ```
  6. stories2 revised this gist Jul 9, 2018. 1 changed file with 30 additions and 0 deletions.
    30 changes: 30 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -156,3 +156,33 @@ apt-get install xinetd telnetd
    ufw allow <PORT NUMBER>
    ```

    ## Install FTP

    ### Install FTP
    ```
    apt-get update
    apt-get install vsftpd
    ```

    ### Backup conf
    ```
    cp /etc/vsftpd.conf /etc/vsftpd.conf.orig
    ```

    ### Edit conf
    ```
    vim /etc/vsftpd.conf
    ```

    #### Edit conf
    ```
    #write_enable=YES --> write_enable=YES
    #chroot_local_user=YES --> chroot_local_user=YES
    #utf8_filesystem=YES --> utf8_filesystem=YES
    allow_writeable_chroot=YES
    ```

    ### Restart FTP
    ```
    systemctl restart vsftpd
    ```
  7. stories2 revised this gist Jul 9, 2018. 1 changed file with 25 additions and 0 deletions.
    25 changes: 25 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -131,3 +131,28 @@ flush privileges;
    ```

    ## Install telnet

    ### Install telnet
    ```
    apt-get install telnet
    apt-get install xinetd telnetd
    ```

    ### Check telnet status
    ```
    /etc/init.d/xinetd status
    ```

    ### Restart telnet
    ```
    /etc/init.d/xinetd restart
    ```

    ## Setup ufw
    - [Reference](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04)

    ### Allow specific port
    ```
    ufw allow <PORT NUMBER>
    ```

  8. stories2 revised this gist Jul 9, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion installGuide.md
    Original file line number Diff line number Diff line change
    @@ -124,7 +124,10 @@ bind-address = 127.0.0.1 --> bind-address = 0.0.0.0
    ```

    #### Add permission to user
    - [Reference](http://link2me.tistory.com/431)
    ```
    grant all privileges on *.* to root@'%' identified by <PASSWORD>;
    flush privileges;
    ```
    ```

    ## Install telnet
  9. stories2 revised this gist Jul 9, 2018. 1 changed file with 53 additions and 0 deletions.
    53 changes: 53 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -74,4 +74,57 @@ node -v
    ### Install dependencies
    ```
    sudo npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
    ```

    ### Setup env vars
    ```
    vim /etc/profile
    ```

    #### Write env vars
    - Goto bottom and type these
    ```
    export PAPERTRAIL_API_TOKEN=<TOKEN>
    export PUSH_SERVER_PRIVATE_KEY=<PRIVATE KEY>
    export PUSH_SERVER_PUBLIC_KEY=<PUBLIC KEY>
    ```

    ### Update env vars
    ```
    source /etc/profile
    ```

    ### Test Run backend program
    ```
    node index.js
    ```

    ## Install Mysql 5.7

    ### Install Mysql
    ```
    apt-get update
    apt-get install mysql-server=5.7.22-0ubuntu0.16.04.1
    mysql_secure_installation
    ```

    ### Check is Mysql process running
    ```
    systemctl status mysql.service
    ```

    ### Setup enable remote access
    ```
    vim /etc/mysql/mysql.conf.d/mysqld.cnf
    ```

    #### Edit conf
    ```
    bind-address = 127.0.0.1 --> bind-address = 0.0.0.0
    ```

    #### Add permission to user
    ```
    grant all privileges on *.* to root@'%' identified by <PASSWORD>;
    flush privileges;
    ```
  10. stories2 revised this gist Jul 9, 2018. 1 changed file with 36 additions and 0 deletions.
    36 changes: 36 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -38,4 +38,40 @@ ssh <USER ID>@<SERVER IP ADDRESS>
    #### Example
    ```
    sssh [email protected]
    ```

    ### Install latest npm, nodejs
    ```
    apt-get update
    apt-get install nodejs
    apt-get install npm
    ```

    ### Check npm version
    ```
    npm -v
    ```

    ### Check node js version
    ```
    nodejs -v
    ```

    ### Install specific version of node
    ```
    wget https://nodejs.org/dist/v6.11.5/node-v6.11.5-linux-x64.tar.gz
    mkdir -p /opt/nodejs
    tar -xvzf node-v6.11.5-linux-x64.tar.gz -C /opt/nodejs/
    cd /opt/nodejs/
    mv node-v6.11.5-linux-x64 6.11.5
    ln -s 6.11.5 current
    ln -s /opt/nodejs/current/bin/node /bin/node
    node -v
    ```

    ## Server Program setting

    ### Install dependencies
    ```
    sudo npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
    ```
  11. stories2 revised this gist Jul 9, 2018. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,30 @@ apt-get upgrade
    ```
    netstat -ntlp | sshd
    service ssh status
    ```

    ### Install sshd service
    ```
    apt-get install openssh-server
    ```

    ### Restart sshd service
    ```
    service ssh restart
    service ssh status
    ```

    ### Check process TCP network status
    ```
    netstat -nap | grep tcp
    ```

    ### How to connect to server using ssh
    ```
    ssh <USER ID>@<SERVER IP ADDRESS>
    ```

    #### Example
    ```
    sssh [email protected]
    ```
  12. stories2 revised this gist Jul 9, 2018. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,14 @@
    ### Check network
    ```ifconfig -a```
    ### Check update & install upgrade
    ```apt-get update
    apt-get upgrade```

    ```
    apt-get update
    apt-get upgrade
    ```

    ### Check is ssh installed
    ```netstat -ntlp | sshd
    service ssh status```
    ```
    netstat -ntlp | sshd
    service ssh status
    ```
  13. stories2 revised this gist Jul 9, 2018. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,10 @@
    ## After boot
    ### Check network
    `ifconfig -a`
    ```ifconfig -a```
    ### Check update & install upgrade
    `apt-get update`
    `apt-get upgrade`
    ```apt-get update
    apt-get upgrade```
    ### Check is ssh installed
    ```netstat -ntlp | sshd
    service ssh status```
  14. stories2 created this gist Jul 9, 2018.
    6 changes: 6 additions & 0 deletions installGuide.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    ## After boot
    ### Check network
    `ifconfig -a`
    ### Check update & install upgrade
    `apt-get update`
    `apt-get upgrade`