Nginx Install 记录

Posted 仅供记录,日常灌水

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx Install 记录相关的知识,希望对你有一定的参考价值。

一、安装编译工具及库文件

 yum -y install gcc

yum -y install gcc-c++

yum -y install zlib;

yum -y install pcre-devel

yum -y install openssl openssl-devel

 

二、下载安装包

wget -c https://nginx.org/download/nginx-1.10.3.tar.gz
tar -zxvfnginx-1.10.3.tar.gz

cd nginx-1.8.0

设置编译路径为 /usr/local/nginx

 ./configure --prefix=/usr/local/nginx

三、编译安装

make 

make install

 

启动Nginx,执行以下命令:

./nginx -s reload

error:

-bash: ./nginx: No such file or directory

执行

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

四、设置开机启动

systemctl status nginx
Error:Unit nginx.service could not be found.

Solution:

[ISSUE] [Centos] Centos Start Nginx Show: Failed to start nginx.service:unit not found 

service nginx start
Starting nginx (via systemctl): [ OK ]

以上是关于Nginx Install 记录的主要内容,如果未能解决你的问题,请参考以下文章

install Nginx iptables

Nginx install

nginx install

Ubuntu Server 21.04 Install A key deployment Install Nginx

Ubuntu Server 21.04 Install A key deployment Install Nginx

docker nginx install