编程技术分享平台

网站首页 > 技术教程 正文

nginx安装(nginx安装指定路径)

xnh888 2024-09-30 04:30:38 技术教程 27 ℃ 0 评论

操作系统:centos 7.9

下载

官网下载:http://nginx.org/en/download.html

wget -c http://nginx.org/download/nginx-1.22.0.tar.gz 

安装依赖

yum install -y gcc-gcc++ pcre pcre-devel zlib zlib-devel openssl openssl-devel

安装

tar -zxvf nginx-1.22.0.tar.gz -C /opt
cd /opt/nginx-1.22.0
//开启ngx_http_ssl_module模块
./configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module
make & make install


配置

vi /opt/nginx/conf/nginx.conf

配置端口
listen       80;

启动&重启

/opt/nginx/sbin/nginx 开启
/opt/nginx/sbin/nginx -s stop 停止   
/opt/nginx/sbin/nginx -s reload  //重新加载配置文件



参考链接

http://nginx.org/en/download.html

https://blog.csdn.net/sinat_27933301/article/details/104958330

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表