nginx调试

02-Nginx安装与常用命令 对于C/C++语言的编译器,使用最多的是 gcc 与 gcc-c++,而这两款编译器在 CentOS7 中是没有安装的,所以首先要安装这两款编译器。由于Nginx 服务器默认的端口号为 80,所以在浏览器中直接输入 Nginx 的主机名或 IP, 就可以看到 Nginx 欢迎页面。在 Nginx 的安装目录/usr/local/nginx 中有一个 sbin 目录,其中存放着 nginx 的命令程序。进入到/usr/apps 目录中的Nginx 解压包目录,查看Nginx 的目录。 阅读详情


配置

        一般来说,默认./configure 生成的makefile文件都将带上-g选项,这对于利用gdb调试nginx是非常必要的,但如果在使用gdb调试nginx时提示“No symbol table is loaded. Use the "file" command.”,则需检查objs/Makefile文件里的CFLAGS标记是否带上了-g选项;另一个值得关注的编译选项是-O0,如果在gdb内打印变量提示“<value optimized out>”,则是因为gcc优化导致,我们可以加上-O0选项禁止gcc的编译优化。如何把“-g -O0”应用在nginx上可以有三种方法:

  1. 在进行configure配置时,按如下方式执行:[root@localhost nginx-1.2.0]# CFLAGS="-g -O0" ./configure(已经验证)
  2. 直接修改文件objs/Makefile给其加上“-g -O0”
  3. 在执行make时,按如下方式执行:[root@localhost nginx-1.2.0]# make CFLAGS="-g -O0"

第2、3两种方法是在我们已经执行configure之后进行的,如果之前已经执行过make,那么还需刷新所有源文件的时间戳,以便重新编译nginx:

[root@localhost nginx-1.2.0]# find . -name "*.c" | xargs touch


编译

       nginx的编译步骤如下:

  1. CFLAGS="-g -O0" ./configure --prefix=/styx/home/dk/nginx --with-pcre=/styx/home/dk/pcre-8.3.3(这里是pcre源代码所在目录)
  2. make
  3. make install
完成了上述主要步骤,就可以使用gdb调试nginx了,祝你玩的愉快。

参考:

Nginx(20)-多种调试配置的方法与技巧 NGINX功能强大,模块多,对复杂需求要正确配置或正确调优,是有一定难度的。因此,如何进行配置调试就很重要,特别是对于生产环境调试。本文主要提供调试方法或技巧,对于配置调试Nginx非常又帮助。 阅读详情

相关推荐

Protobuf NDK以及QNX交叉编译

Protobuf 用处很广,尤其是通讯数据序列化,反序列化。TODO。

静虚待令,有物混成 1568

Nginx命令行参数

Nginx命令行参数可以通过 nginx -h 获取: $ nginx -h nginx version: nginx/1.21.5 Usage: nginx [-?hvVtTq] [-s signal] [-p prefix] [-e filename] [-c filename] [-g directives] Options: -?,-h : this help -v : show version and exit -V

呜呼哈 4967

神经网络(十五)在VS Code下搭建PyTorch环境

pytorch在vscode中的配置和使用

就随便写写.... 5万+

nginx的基本使用介绍

nginx是一个高性能多进程的web服务器,相对比apache,它对处理高并发请求有更好的性能。

weixin_51049616的博客 903

PLC编程标准之争:IEC61131与IEC61499核心区别与选型指南

在工业自动化领域,PLC编程长期依赖IEC61131标准,它定义了梯形图、结构化文本等语言,通过周期扫描机制保证确定性执行。然而,随着工业4.0和分布式控制场景的兴起,IEC61499以事件驱动模型打破传统范式,让功能块能跨设备协同,实现更灵活的柔性产线和模块化系统。理解两者在程序结构、数据交互、部署方式和实时性上的差异,是选型与工程落地的关键。本文从基础概念出发,剖析执行模型与架构演进,结合一线调试经验,帮助工程师在传统PLC与下一代标准之间做出理性决策。

weixin_27014595的博客 270

处理图数据, 安装“Pytorch“ + 图神经网络开源框架“PyG “+ “ogb“使用

"OGB" OSError: [WinError 127] 找不到指定的程序。1.[遇到这类问题往往跟torch安装的工具包(如torch-sparse,torch-scatter,torch-cluster)版本没对应上有关](https://blog.csdn.net/weixin_42358688/article/details/117433691)2.[OGB使用环境安装与依赖](https://ogb.stanford.edu/docs/home/)Data Loaders3.[torch-geo

Fuguir™的博客 3703

【教程】Nginx快速学习

正向代理的客户端通过中间代理访问服务器不同,反向代理是指当客户端将请求发送给中间代理的时候,中间代理会将请求选择性的交给不同的服务器。源码编译安装方式比较复杂,需要到官网下载源码,在系统上安装c语言编译环境和nginx所使用的库,再在运行./configure时指定需要配置的参数,官网有对应的教程这里就不再做过多赘述了。负载均衡是当客户端有大量请求时,nginx按照预设好的规则将不同的请求发送到不同服务器以减轻各服务器的压力的功能。server块是http块中最重要的部分,有很多非常重要的指令。

风舞雪凌月的博客 791

啥是PLCnext?它能干啥?

简单来说,PLCnext是基于Linux操作系统的一个控制器运行时,所以它原生具备的两个特点:1.原生兼容IEC611312.原生兼容Linux各类应用PLCnext的控制器大概长下面这样(AXC F 1152、2152),通过背板总线连接IO、通过网口连接Profinet或者上位机。

博客 1655

Linux服务:Nginx服务部署及基础配置

本文介绍I/O模型相关概念:同步、异步、阻塞、非阻塞,讲解了如何通过yum和编译安装nginx服务以及nginx的基础配置:信号以及基础命令。介绍了nginx服务的优缺点并且和apache服务进行了对比,以及nginx服务的优化。

云计算之路 2714

【深度学习】手把手教你在远程服务器上跑 YOLOv3 相关代码(含环境配置)

这篇文章主要记录了如何配置项目环境以及如何在远程服务器上跑 YOLOv3 模型。

作者正在煮茶中... 2389

U-net复现pytorch版本 以及制作自己的数据集并训练

GitHub链接: https://github.com/milesial/Pytorch-UNet 论文链接:

candice5566的博客 3万+

nginx调试输出

nginx本身无法像编程语言一样通过输出语句输出调试信息,只能通过第三方模块echo-nginx-module来实现调试信息的输出,下面记录下该模块的使用方法: 1、下载echo-nginx-module 下载地址 下载完成后解压到/usr/local/下,命名为echo-nginx-modu...

chunjusu2447的博客 6601

【五分钟论文笔记】Vision Banana:图像生成器成为通用视觉学习器

图像生成训练可以像 LLM 预训练一样,让模型学习强大且通用的视觉表示感知即生成——将视觉任务输出参数化为 RGB 图像,是一种优雅且强大的统一框架视觉理解能力可以在不牺牲生成能力的情况下获得——两者可以共存于同一个模型。

专注:太空算力、AI infra、异构调度、大模型成本工程 239

nginx调试方法

2015-05-02 wcdj 摘要:调试nginx用到的工具有:secureCRT, curl, wget, gdb, cgdb, strace, pstack, addr2line等。 首先是下载源码,可以通过curl或wget来完成。 curl -O http://nginx.org/download/nginx-1.2.0.tar.gz wget http://

delphiwcdj的专栏 1940

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Nginx 调试

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_33708432的博客 381

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

调试 Nginx 的配置

调试 Nginx 的配置 标签(空格分隔): Nginx 调试 Debuging 配置 注:该文原文是 Debugging Nginx Configuration 默认,Nginx 仅仅记录标准错误日志到 Nginx 默认的 error 文件中,或是被 error_log 指令指定的文件中。 我们可以控制许多方面的错误日志,这将帮助我们调试我们 Nginx 配置文件。 重

wuzhongchao的专栏 520

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

利用gdb调试nginx

利用gdb调试nginx 1. 打开nginx调试     首先修改/auto/cc/conf文件,将ngx_compile_opt="-c"改为ngx_compile_opt="-c -g".     打开debug模式进行编译,简单操作如下:              sudo ./configure –with-debug              sudo make  

chenglinhust的专栏 1693

使用gdb调试Nginx worker进程

使用gdb调试Nginx worker进程Tags: Nginx在开发Nginx模块或者遇到难以解决的Nginx配置问题时,不得不通过调试手段来找出问题所在,本文通过在Linux系统上使用gdb工具来演示如何调试运行中的Nginx进程,本文只关心Nginx的实际执行者–worker进程。 (1)编译Nginx首先你需要编译出带有调试信息的可执行文件和.o文件。 获得Nginx源码之后,通过我们熟

zstu_cc的专栏 8777

nginx系列第二篇:nginx源码调试

nginx进程调试

hsy12342611的专栏 2287

Nginx调试大法

一:源码编译安装: //参考: https://blog.csdn.net/happylzs2008/article/details/89042273 步骤一 ): configure的极简配置: ./configure --prefix=/server/nginx /server(自己手动建立的,与服务器相关的都安装到这里) configure的其他配置: ...

happylzs2008的专栏 6485

Nginx 源码学习(一) nginx的跟踪与调试

在学习优秀的源代码时是 少不了源码的跟踪与调试,它不仅是我们解决程序bug的有效途径 也是我们理解、学习优秀源码的有效途径。 本文主要介绍一些源码调试的方法,并结合Nginx 源码进行示例。 1, 利用GDB调试    a,首先你应该熟悉 GDB 调试的一些基本命令(不熟悉的移步 至 用GDB调试程序 ,熟悉step,run,break,list,info,continue等

Daniel 的技术笔记 不积跬步无以至千里,不积小流无以成江海。 1万+

nginx源码分析--使用GDB调试nginx

gdb是linux上调试应用程序的首选。在进行nginx的调试过程中,首先需要修改Makefile文件。 vi objs/Makefile #增加 -O0 和 -g 选项; -O0代表不进行优化,-g代表调试模式 CFLAGS =  -pipe -W -Wall -Wpointer-arith -Wno-unused-parameter -g -O0 1 2 3

鱼思故渊的专栏 3365

如何调试Nginx

如果需要调试Nginx,你需要增加--with-debug选项重新编译一个Nginx,同时,nginx.conf如下配置: error_log logs/error.log debug; # 只记录调试日志 master_process off; # 简化调试 此指令不得用于生产环境 daemon off; # 简化调试 此指令可以用到生产环...

持续疯长,往天那边去 263

nginx模块_使用gdb调试nginx源码

原文地址 工欲善其事必先利其器,如何使用调试工具gdb一步步调试nginx是了解nginx的重要手段。 ps:本文的目标人群是像我这样初接触Unix编程的同学,如果有什么地方错误请指正。 熟悉gdb的使用 这里就不说了,谷歌一搜一堆,这里推荐一篇文章:GDB 命令详细解释 请重点看一下step,run,break,list,info,continue命令 下

沧海浮云的世界 一步一个脚印 905

Java扩展Nginx之四:远程调试

广大java程序员日常开发和定位问题时常用的远程调试功能,nginx-clojure也支持,来体验吧

程序员欣宸的博客 1490
上一篇: Linux I/O模型思考
下一篇: Linux文件系统预读(二)
kai_ding
博客等级 码龄14年 173粉丝 53原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值