nginx安装部署
一、nginx源码下载
源码包:nginx-1.15.12.tar.gz
源码包下载:wget http://nginx.org/download/nginx-1.15.12.tar.gz -P /usr/src
二、nginx安装
yum -y install gcc pcre-devel zlib-devel cd /usr/src tar xf nginx-1.15.12.tar.gz cd nginx-1.15.12 ./configure —prefix=/usr/local/nginx 配置目的: 1)检查环境 是否 满足安装条件 依赖解决 2)指定安装方式 配置文件 命令文件 各种文件放哪里 开启模块功能【内置模块 三方模块】 3)指定软件安装在那里
make -j4 make install
三、nginx相关目录
nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/sbin/nginx" nginx modules path: "/usr/local/nginx/modules" nginx configuration prefix: "/usr/local/nginx/conf" nginx configuration file: "/usr/local/nginx/conf/nginx.conf" nginx pid file: "/usr/local/nginx/logs/nginx.pid" nginx error log file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log"
四、nginx启动管理
配置文件测试:/usr/local/nginx/sbin/nginx -t Nginx启动:/usr/local/nginx/sbin/nginx Nginx关闭:killall –s QUIT nginx
五、nginx测试
netstat –ntpl lsof -i :80 elinks http://IP
测试页面内容