欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > centos安装nginx

centos安装nginx

2025/9/23 1:29:29 来源:https://blog.csdn.net/qq_62408075/article/details/147625316  浏览:    关键词:centos安装nginx

下载

下载nginx  nginx: download

安装 

上传到服务器并解压

tar -zxvf nginx-1.28.0.tar.gz

配置nginx

./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module

 发现报错,提示要加上这个参数,添加这个参数重新执行

./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module --without-http_rewrite_module

 

执行还是报错,提示没有openSSL依赖,下面安装依赖

sudo yum install openssl-devel

再次执行

./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module --without-http_rewrite_module

make #编译

sudo make install #安装

 

查看配置

安装好后会在/opt下面生成nginx文件夹

配置文件和页面文件都在这边

 

启动

查看配置端口 是/opt/nginx下面的

sudo /opt/nginx/sbin/nginx

查看页面 ip:80

停止

sudo /opt/nginx/sbin/nginx -s stop

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词