企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
1. 在usr/local下建好nginx文件夹,下载好nginx-1.9.9.tar.gz压缩文件. nginx下载地址:[https://nginx.org/download/](https://nginx.org/download/) 2. 安装编译工具及库文件 ``` yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel pcre-devel ``` 3. 下载解压nginx ``` cd /usr/local/ngin // wget https://nginx.org/download/nginx-1.18.0.tar.gz #下载(有了就不用下载) tar -zxvf nginx-1.18.0.tar.gz #解压 ``` 4. 进入安装包目录 ``` cd nginx\-1.9.9 ``` 5. 编译安装nginx,默认安装到 /usr/local/nginx中 ~~~ //编译 ./configure --prefix=/usr/local/nginx //安装 make && make install ~~~ 6. 查看nginx.conf配置是否正确 ~~~javascript /usr/local/nginx/sbin/nginx -t [root@localhost sbin]# /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 //代表成功 ~~~ 7. 启动后查看进程/查看端口 ``` ps -ef|grep nginx #查询进程号 netstat -ntlp #查看端口 ```