远程连接Linux (Ubuntu配置SSH服务) 端口22
安装OpenSSH
Ubuntu缺省没有安装SSH Server,使用以下命令安装:
sudo apt-get install openssh-server openssh-client
不过Ubuntu缺省已经安装了ssh client。
配置完成后重起:
sudo /etc/init.d/ssh restart
windows 客户端用putty连接命令shell模式
1、开始的安装依赖
sudo apt-get install git vim openssh build-essential libssh-dev wget curl
2、安装nvm nodejs版本管理
https://github.com/creationix/nvm/blob/master/README.md
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
or
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
3、停用自带Apache服务
sudo service apache2 stop
update-rc.d -f apache2 remove
sudo apt-get remove apache2
4、升级包列表
sudo apt-get update
5、安装nginx
sudo apt-get install nginx
nginx -v #查看nginx版本
6、修改nginx配置
cd /etc/nginx/conf.d
sudo vi www-angular-site.conf
upstream www {
server 127.0.0.1:3000;
}
server{
listen 80;
server_name www.angular.site;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Porxy true;
proxy_pass http://www;
proxy_redirect off;
}
}
重启nginx
nginx restart
7、安装yarn vue-cli pm2
8、安装mongodb数据库
mongodb配置文件路径
vi /etc/mongod.conf
启动mongodb
sudo service mongod start