资讯专栏INFORMATION COLUMN

前端 CentOS7 新服配置参考

ky0ncheng / 2091人阅读

摘要:我自己搭服务器的偏好是,每次开新服都要执行一遍环境配置,步骤繁多难免遗漏,总是发现缺东西了再去安装。编辑,启用以下几行然后重启服务启动和它的朋友们最后,需要在的配置中添加一行像这样下面是一些个人喜好,装个。

我自己搭服务器的偏好是 CentOS,每次开新服都要执行一遍环境配置,步骤繁多难免遗漏,总是发现缺东西了再去安装。备个忘,再不烦恼。

本文介绍的组件包括:git, nginx, nodejs, fishshell,环境是 DigitalOcean 的 CentOS 7 镜像(6就不管了,初建服务器你还不用最新版是何居心?)。

小安利下,我的DigitalOcean 推荐链接,注册即得10美元(推荐双方都有),开服愉快!

CentOS 新服务器

首先安装 epel-release,各种软件包都依赖于这个软件源

$ yum update -y
$ yum install -y epel-release
$ yum install -y git
一点安全措施

启用 SSH 密钥登陆。编辑 ~/.ssh/authorized_keys,添加自己的公钥进去。

禁用密码登陆。编辑 /etc/ssh/sshd_config,启用以下几行:

PubkeyAuthentication            yes
AuthorizedKeyFile               .ssh/authorized_keys
PasswordAuthentication          no
ChallengeResponseAuthentication no

然后重启 sshd 服务:

$ service sshd reload

https://www.liberiangeek.net/2014/07/enable-ssh-key-logon-disable-password-password-less-logon-centos/
http://serverfault.com/questions/285800/how-to-disable-ssh-login-with-password-for-some-users
http://askubuntu.com/questions/387892/how-to-deny-root-ssh-login-require-ssh-key-for-user

nginx 启动!
$ yum install nginx -y

http://www.rackspace.com/knowledge_center/article/centos-adding-an-nginx-init-script

Node 和它的朋友们
$ yum install nodejs -y
$ curl https://www.npmjs.com/install.sh | sh
$ npm install -g n pm2

最后,需要在 ghost 的 nginx 配置中添加一行 client_max_body_size 10G; 像这样:

server {
    listen       80;
    server_name  ~b(log)*.amio.us$;

    client_max_body_size 256M;
    
    # ...
}
Oh-my-fish!

下面是一些个人喜好,装个 fish shell。

$ yum install yum-utils
$ yum-config-manager --add-repo http://fishshell.com/files/linux/RedHat_RHEL-6/fish.release:2.repo
# CentOS 7 用这个地址:
# http://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish:release:2.repo
$ yum install fish -y

# 把默认 shell 改为 fish
$ chsh -s /usr/bin/fish

如果 fish 报告错误:
fish: Tried to print invalid wide character string

则编辑此文件:

$ vim /etc/sysconfig/i18n
# 把其中的 LANG=C 改为 LANG=en_GB.UTF-8

http://serverfault.com/questions/275403/how-do-i-change-my-locale-to-utf-8-in-centos

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/17406.html

相关文章

  • 前端 CentOS7 新服配置参考

    摘要:我自己搭服务器的偏好是,每次开新服都要执行一遍环境配置,步骤繁多难免遗漏,总是发现缺东西了再去安装。编辑,启用以下几行然后重启服务启动和它的朋友们最后,需要在的配置中添加一行像这样下面是一些个人喜好,装个。 我自己搭服务器的偏好是 CentOS,每次开新服都要执行一遍环境配置,步骤繁多难免遗漏,总是发现缺东西了再去安装。备个忘,再不烦恼。 本文介绍的组件包括:git, nginx, n...

    junfeng777 评论0 收藏0
  • 浅谈滚服游戏如果实现一键合服

    摘要:而滚服游戏则一般会设计游戏在线上限,比如,达到上限则新开一组服务器,并引导用户进入新区。这就导致了新服一开,玩家即蜂拥而至,争先恐后练级升装备,以求最快速进入排行榜前列,如果努力一番发现落后了,可能就只能坐等下一个新服。 原文地址-石匠的Blog:http://www.bugclosed.com/post/12 背景 近几年的游戏行业中,出现了各种各样的滚服游戏,包括页游,手游,H5游...

    UnixAgain 评论0 收藏0
  • centos7安装nginx并配置web前端环境。

    摘要:安装启动修改路径配置,,我自己的项目放到了下。之后把打包好的前端项目放到配置的目录下就。 1.安装nginx ~sudo yum install nginx showImg(https://segmentfault.com/img/bVbcUsW?w=650&h=68); 2.启动nginx ~ systemctl start nginx 3.修改nginx路径配置,/etc/ngin...

    YorkChen 评论0 收藏0

发表评论

0条评论

ky0ncheng

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<