在部署nginx前,我们需要进行环境的部署
1.编译工具gcc,g++,autoconf,automake ,make
sudo apt-get install gcc g++ autoconf automake make
2.依赖库zlib,openssl,pcre
2.1 openssl下载地址
https://www.openssl.org/source/openssl-3.0.14.tar.gz
1.mkdir openssl(创建一个存储目录)
2.cd openssl
3.wget https://www.openssl.org/source/openssl-3.0.14.tar.gz
4.tar -zxvf openssl-3.0.14.tar.gz
4.cd openssl-3.0.14
5./config
6.make && make Install
2.2 pcre下载地址
https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
1.mkdir pcre(创建一个存储目录)
2.cd pcre
3.wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
4.tar -zxvf pcre-8.45.tar.gz
4.cd pcre-8.45
5./configure
6.make && make Install
2.3 nginx下载地址
https://nginx.org/download/nginx-1.2.7.tar.gz
1.mkdir nginx(创建一个存储目录)
2.cd nginx
3.wget https://nginx.org/download/nginx-1.2.7.tar.gz
4.tar -zxvf nginx-1.2.7.tar.gz
4.cd nginx-1.2.7.tar.gz
5. ./configure --help(先查看配置的参数)
具体的参数含义可以去查阅文档,我们加上需要的参数
6. ./configure --prefix=/home/fxk123/nginx/nginx127 --with-http_ssl_module --with-http_fiv_module --with-http_gzip_static_module --with-http_stub_status_module --with-threads --with-file-aio
开始检查相关依赖
然后输入即可
7. make && make install