- 下载nginx软件:http://nginx.org/en/download.html,wget http://nginx.org/download/nginx-1.16.0.tar.gz
- 解压:tar -zxvf nginx-1.16.0.tar.gz
- 编译安装:./configure --prefix=/home/zx/nginx/
- 报错:
./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
解决:sudo apt-get install libpcre3 libpcre3-dev
- 报错:
./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option.
解决:下载zlib库: wget http://www.zlib.net/zlib-1.2.11.tar.gz,解压并安装:tar -zxvf zlib-1.2.11.tar.gz && cd zlib-1.2.11/ && make && make install
-
sudo apt-get install openssl libssl-dev
- 报错:
- 再次编译:./configure --prefix=/home/zx/nginx/
Configuration summary + using system PCRE library + OpenSSL library is not used + using system zlib library nginx path prefix: "/home/zx/nginx/" nginx binary file: "/home/zx/nginx//sbin/nginx" nginx modules path: "/home/zx/nginx//modules" nginx configuration prefix: "/home/zx/nginx//conf" nginx configuration file: "/home/zx/nginx//conf/nginx.conf" nginx pid file: "/home/zx/nginx//logs/nginx.pid" nginx error log file: "/home/zx/nginx//logs/error.log" nginx http access log file: "/home/zx/nginx//logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp"
- 安装:make && make install
- 安装goaccess分析access.log日志:sudo apt-get install goaccess
- 安装certbot开启https访问:
- sudo apt-get install python-certbot-nginx
- certbot --nginx --nginx-server-root=/home/zx/nginx/conf/nginx.conf -d geektime.zx.pub
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· Ollama——大语言模型本地部署的极速利器
· 使用C#创建一个MCP客户端
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· Windows编程----内核对象竟然如此简单?
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用