centos安装nginx

双十一期间,买了个阿里云服务器以作学习使用。先安装好putty和filezilla,并配置好IP。接下来就要安装nginx.
Nginx的性能要比Apache高出很多倍,如果不使用PHP作服务语言,建议安装Nginx作web服务器。
1、启动putty,输入阿里云IP地址
centos安装nginx
2、查看Nginx是否已经安装,及版本号
yum list | grep nginx
3、centOS自带的yum版本是比较低的,需要重新配置yum源 vim 。 cd /etc/yum.repos.d/nginx.repo,输入以下内容
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
4、安装Nginx
yum install nginx
5、安装好,nginx -v 就可以查看安装的最新版本
默认配置目录:/etc/nginx/conf.d/
默认html资源目录:/usr/share/nginx/html
(1)在default.conf对nginx进行配置,建议了解一些linux命令。 vi default.conf
centos安装nginx
centos安装nginx
(2)在filezilla中上传文件,比如vue打包后将index.html和static 拖拽到html的资源目录。
centos安装nginx