1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| vim /etc/yum.repos.d/nginx.repo [nginx] name=nginx repository baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=0 enabled=1 # # rpm -ivh https://mirrors.ustc.edu.cn/epel/epel-release-latest-7.noarch.rpm ------------------------------------------------------------------------------------ rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm //此命令安装后也会自建一个叫nginx.repo的源 yum repolist yum info nginx yum install nginx ------------------------------------------------------------------------------------ yum install epel-release -y #
注:nginx配置文件默认没有配色,使用下面方法解决 mkdir -pv ~/.vim/syntax cd ~/.vim/syntax wget http://www.vim.org/scripts/download_script.php?src_id=14376 -O nginx.vim vim ~/.vim/filetype.vim au BufRead,BufNewFile /etc/nginx/* set ft=nginx #
|