Skip to content

Instantly share code, notes, and snippets.

@llccing
Last active November 8, 2017 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save llccing/0672ec29bd3e0daecff6d6ab749d4aad to your computer and use it in GitHub Desktop.
Save llccing/0672ec29bd3e0daecff6d6ab749d4aad to your computer and use it in GitHub Desktop.

斥巨资买了一台服务器,剩下的就是折腾了。

1. 配置git

2. 配置vim

3. 安装node环境

4. 安装nginx

5. 域名解析

@llccing
Copy link
Author

llccing commented Nov 8, 2017

1. git环境配置

默认的环境已经配置好了, 我们要做的就是设置ssh,然后添加到github或者码云上即可。

2. 配置vim

开始时,使用别人用的配置文件,后期使用熟练后,可以考虑自己写。

github排名比较靠前的配置文件

优点:中文配置文件,方便查看
缺点:可能功能上相对较少,但是对于项目开发可用,或许需要装vue.js插件

优点:插件多而全,使用文档写的比较清晰。

缺点:界面效果看着非常累,可能是因为我是Windows的原因。

总的来看,还是用中文的,毕竟界面看着非常舒服,界面舒服就已经算很大一部分事了,心情愉悦,才能提高生产力不是。

3. 安装node环境

apt install nodejs

apt install npm 

npm insatll n stable

// 这一步没有生效,npm -v后,输出的版本还是原来的版本。
npm install npm -g

4. 安装nginx

apt-get update

// 出现提示直接yes即可
apt-get install nginx

// 查看状态,显示绿色,就是成功,访问ip即可,默认是80端口,所以是直接打开一个nginx 欢迎页面
systemctl status nginx

这样nginx的安装就成功了,具体使用单讲。

编辑一个nginx的目录文件

// 随便改点内容即可,nginx会自动生效,实际部署时,
// 会将静态资源都部署(自动构建)到该目录下,当然或者改变nginx的目录即可。

vim /var/www/html/index.nginx-debian.html

配置文件

// 默认配置文件
vim /etc/nginx/sites-available/default

常用命令

// 查看状态,绿色表示启动了
systemctl status nginx

systemctl stop nginx

systemctl start nginx

systemctl restart nginx

// 重载比较有用
systemctl reload nginx

5. 域名解析

可能我的理解偏差,意思就是IP对应上域名。

刚买的,新鲜出炉域名 llccing.cn , 可以试试水了。

具体就是设置

  • 记录类型:A记录
  • 记录值为ECS的IP地址
  • 主机记录为@,表示llccing.cn这个域名

然后这个解析就设置完了,剩下的其他记录如何使用,可以先了解下这个记录类型有几种,区别是什么

感谢:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment