Nginx简介与安装

什么是nginx

Nginx是一个高性能的HTTP和反向代理服务器,同时还是IMAP/POP3/SMTP代理服务器,该程序由俄罗斯Rambler.ru站点开发,Nginx因为性能稳定、低系统资源消耗而闻名,近几年Nginx在国内已经成炙热化状态,比如像腾讯、网易、51CTO、迅雷、当当网、51、人人网等诸多大型网站都已经使用Nginx来做Web服务器,所以我们要学会运用Nginx还是非常有必要的

nginx源码包安装

1、上传nginx源码包,解压并改名
[[email protected] ~]# ls
nginx-1.18.0.tar.gz
[[email protected] ~]# tar xf nginx-1.18.0.tar.gz
[[email protected] ~]# mv nginx-1.18.0 nginx
进入源码包目录
[[email protected] ~]# cd nginx

2、安装相应依赖
[[email protected] nginx]# yum -y install gcc pcre-devel openssl-devel

3、配置:根据自己需求配置(默认安装目录:/usr/local/nginx)
在这里,我选择默认安装:直接指向如下命令即可
[[email protected] nginx]# ./configure

4、编译并安装
[[email protected] nginx]# make && make install

5、启动优化(默认启动命令:/usr/local/nginx/sbin/nginx)
[[email protected] nginx]# ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/nginx
之后直接执行:nginx即可启动
[[email protected] nginx]# nginx
Nginx(源码安装)
6、浏览器访问测试
Nginx(源码安装)

相关文章: