Linux服务器部署Nginx并发布web项目

1.下载linux版本的nginx

nginx: download

2.解压后执行

#配置configure --prefix 代表安装的路径,--with-http_ssl_module 安装ssl,--with-http_stub_status_module查看nginx的客户端状态
./configure --prefix=/usr/local/nginx-1.20.2 --with-http_ssl_module --with-http_stub_status_module

如果没出现错误执行第六步 
3.如果出现错误 ./configure:error:C compiler is not found  执行

  yum -y install gcc gcc-c++ autoconf automake make

4.如果出现错误  ./configure:error: the http rewrite  moudle  requires the PCRE library  执行

   yum -y install openssl openssl-devel

5.解决问题后重新执行第二步

6.#编译安装nginx
make & make install 
7.进入安装目录 /usr/local/nginx/sbin  执行

  ./nginx

8.访问服务器ip:80  查看是否安装成功

9.相关配置文件在nginx/conf/nginx.conf  中

10.把web文件上传到nging/html中,默认访问其中的index.html页面

猜你喜欢

转载自blog.csdn.net/qq_40513633/article/details/127985029