1、下载nginx1.7.4
#注:下载地址:http://nginx.org/download/nginx-1.7.4.tar.gz
2、安装
#注:默认安装到/usr/local/nginx
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
#注:下载地址:http://nginx.org/download/nginx-1.7.4.tar.gz
wget -c http://nginx.org/download/nginx-1.7.4.tar.gz2、安装
#注:默认安装到/usr/local/nginx
tar -zxvf nginx-1.7.4.tar.gz
cd nginx-1.7.4
./configure make && make install #注:会出来一堆东西
3、运行
/usr/local/nginx/sbin/nginx
#注:nginx默认使用80端口,若是80端口被占用,修改/usr/local/nginx/conf/nginx.conf里的
server {
listen 80; #我这边改为8081
#查看nginx是否正常
[root@aaa nginx-1.2.4]# /usr/local/nginx/sbin/nginx -t出现如下代码:nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
安装成功!
本文提供了一步一步的指南来下载、安装并运行nginx 1.7.4版本。包括如何下载软件包,安装过程,以及如何解决端口冲突问题。最后通过检查日志确认nginx是否正确运行。
354

被折叠的 条评论
为什么被折叠?



