markdown 预备Linux ubuntu服务器或Digital ocean droplet

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 预备Linux ubuntu服务器或Digital ocean droplet相关的知识,希望对你有一定的参考价值。

### For Accessing any server in gitbash
```
ssh userName@hostAddress
```
### Then enter the password

### Install update
```
sudo apt-get update
```
### Install node js for Node and Node Package Manager
```
 curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
```

```
sudo apt-get install -y nodejs     
```

### Cheack Node Version 
```
node --version
```

```
npm --version
```
### Install Mysql server to your server
```
sudo apt-get update
sudo apt-get install mysql-server
```
For more: https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/

## Getting SSH key From server And add this to Github so that server can access github private file as well
```
ssh-keygen -t rsa -C "mti.tareq3@gmail.com"
```
## Now copy the id_rsa.pub key to your github 

Showing hidden folder
```
ls -a
```

Getting into ssh folder
```
cd .ssh
```
reading id_rsa.pub
```
cat id_rsa.pub
```

### now clone any repo to your server home dir
```
git clone git@github.com:heroku/node-js-sample.git
```

## For starting any nodejs server

inside into the repository cloned dir
```
npm install
```
for starting node app
```  
npm start
```

### When app server will run it will show the port using for that server use this for get into server

```
192.168.0.5:5000
```

### For providing support while server should be running and need any upgrade we will use pm2 in node

Installing as global pack
```
sudo npm install pm2 -g
```

starting server using pm2
```
pm2 start index.js/app.js/server.js
```
## For more:
https://www.youtube.com/watch?v=RE2PLyFqCzE

https://scotch.io/tutorials/deploying-a-node-app-to-digital-ocean

以上是关于markdown 预备Linux ubuntu服务器或Digital ocean droplet的主要内容,如果未能解决你的问题,请参考以下文章

20165211 预备作业3 Linux安装与学习

20165310 预备作业3 Linux安装及学习

20165327 预备作业3 Linux安装及学习

20165318 预备作业3 Linux安装及学习

20165336 预备作业3 Linux安装及学习

20165230 预备作业3 Linux安装及学习