腾讯云centos7.4 全新环境部署流程

yum update
yum install git vim openssl build-essential wget curl
访问 https://github.com/creationix/nvm 找到第一个命令行
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
此时nvm安装已完成,重新登陆,用nvm ls 确认安装成功
nvm install v10.11.0 #安装nodejs
nvm use v10.11.0
访问https://www.yarnpkg.com/zh-Hans/docs/install#centos-stable 找到第一个命令行
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
yum install yarn
访问http://npm.taobao.org/ 找到命令行
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install pm2 -g

cd /home/
cd http_923/
cd 913/
pm2 start server.js

安装nginx:http://nginx.org/en/linux_packages.html
sudo service apache2 stop

root@VM_0_9_centos ~]# ls
[root@VM_0_9_centos ~]# cd /etc/yum.repos.d/
[root@VM_0_9_centos yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Sources.repo  yarn.repo
CentOS-CR.repo    CentOS-Epel.repo       CentOS-Media.repo      CentOS-Vault.repo
[root@VM_0_9_centos yum.repos.d]# vim nginx.repo
[root@VM_0_9_centos yum.repos.d]# cat nginx.repo 
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
[root@VM_0_9_centos yum.repos.d]# yum install nginx
腾讯云centos7.4 全新环境部署流程_第1张图片
image.png

103 2018-12-10 17:21:24 cd /etc/nginx/
104 2018-12-10 17:21:24 ls
105 2018-12-10 17:21:50 cd conf.d
106 2018-12-10 17:21:51 ls
107 2018-12-10 17:22:15 cp default.conf ./defaultconf.BAK
108 2018-12-10 17:22:17 ls
109 2018-12-10 17:22:28 vim default.conf
110 2018-12-10 17:23:37 cp default.conf 913.conf
111 2018-12-10 17:23:41 vim 913.conf
修改为如下:

server {
    listen       80;
    server_name  llhacker.com;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location / {
    proxy_pass http://localhost:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       # root   /usr/share/nginx/html;
       # index  index.html index.htm;
    }

112 2018-12-10 17:26:15 nginx -s reload
反代理成功!
服务器部署完毕。

1    nvm install v10.11.0
    2  nvm use v10.11.0
    3  nvm alias default v10.11.0
    4  node -v
    5  brew install yarn
    6  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
    7  sudo yum install yarn
    8  yarn --version
    9  npm install vue-cli pm2
   10  ls
   11  pm2
   12  rm -r node_modules/ package-lock.json 
   13  rm -rf node_modules/ package-lock.json 
   14  ls
   15  npm install vue-cli pm2 -g
   16  ls
   17  pm2
   18  cd /etc/yum.repos.d/
   19  ls
   20  vim nginx.repo
   21  yum install nginx
   22  ls
   23  cd /etc/nginx
   24  ls
   25  cp -r conf.d conf.d.BAK
   26  cp -r nginx.conf  nginx.conf.BAK
   27  cd conf.d
   28  ls
   29  cat default.conf 
   30  ls
   31  cp default.conf /opt/backup/nginx/default.conf
   32  cd ..
   33  ls
   34  cp nginx.conf /opt/backup/nginx/nginx.conf
   35  ls
   36  cd conf.d
   37  ls
   38  vim default.conf 
   39  cp default.conf default
   40  vim default.conf
   41  ls
   42  rm default.conf 
   43  ls
   44  cd ..
   45  ls
   46  mkdir cert
   47  ls
   48  cd conf.d
   49  ls
   50  vim main.conf 
   51  nginx -s reload
   52  nginx
   53  nginx -t
   54  ls
   55  vim main.conf 
   56  cd ..
   57  ls
   58  vim nginx.conf
   59  ls
   60  nginx -t
   61  ngins -s quit
   62  nginx -s reload
   63  ls
   64  cd cert
   65  ls
   66  cat 1537463077946.
   67  cat 1537463077946.key 
   68  ls
   69  cd ..
   70  ls
   71  cd conf.d
   72  ls
   73  vim main.conf 
   74  cd ..
   75  vim nginx.conf
   76  ls
   77  vim nginx.conf
   78  nginx -s quit
   79  nginx
   80  nginx -s reload
   81  ls
   82  cd conf.d
   83  ls
   84  vim main.conf 
   85  ls
   86  cd ..
   87  ls
   88  cd ..
   89  cd /home/http_923/913/
   90  ls
   91  pm2 start server.js 
   92  ls
   93  yum upgrade
   94  curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
   95  cd /opt
   96  ls
   97  mkdir backup
   98  cd backup/
   99  mkdir nginx
  100  ls
  101  cd nginx
  102  cd ..
  103  cd /home/http_923/913/
  104  ls
  105  pm2 start server.js 
  106  nginx
  107  iptable
  108  iptables
  109  iptables -h
  110  iptables -F
  111  iptables -s
  112  iptables -S
  113  cd /etc/nginx
  114  ls
  115  mkdir sites-available
  116  vim nginx.conf
  117  cp conf.d/main.conf sites-available/main.conf
  118  cd conf.d
  119  ls
  120  mv main.conf main.bak
  121  ls
  122  nginx -s quit
  123  nginx 
  124  nginx -s reload
  125  nginx 
  126  nginx
  127  ls
  128  nginx -t
  129  ps 
  130  top
  131  ps -ef|grep nginx
  132  kill -QUIT 23682 23697 23706
  133  ls
  134  ps -ef|grep nginx
  135  cd ..
  136  ls
  137  vim nginx.conf
  138  nginx
  139  ps -ax | grep nginx
  140  ls
  141  iptables -L
  142  iptables -h
  143  iptables -S
  144  iptalbles -L -n -v
  145  iptables -L -n -v
  146  iptables -L -v
  147  iptables -S -n -v
  148  iptables -L -n --line-numbers
  149  more /etc/sysconfig/iptables
  150  netstat -ntlp
  151  ls
  152  cd bx
  153  mkdir bx
  154  cd bx
  155  ls
  156  git clone https://github.com/bitcoin/bitcoin.git
  157  git clone https://gitee.com/herolf4c/bitcoin.git
  158  git tag
  159  ls
  160  cd bitcoin/
  161  git tag
  162  git status
  163  ls
  164  ./autogen.sh
  165  yum install autoconf
  166  ./autogen.sh
  167  ls
  168  sh autogen.sh
  169  ls
  170  more README.md 
  171  cd ..
  172  ls
  173  cd bitcoin/
  174  ls
  175  cd ..
  176  ls

你可能感兴趣的:(腾讯云centos7.4 全新环境部署流程)