DevHeads.net

Postings by Hemant Chaudhary

Running Lua Script using mod_lua

Hi,

While running lua_script using mod_lua, I am getting this error in
error_log. What does it mean
"PANIC: unprotected error in call to Lua API (core and library have
incompatible numeric types)"

Thanks
Hemant

Python and Perl support in Apache

Hi All,

Which of the following is the best way to support python and perl in our
apache and why.

Python - WSGI, CGI, CGID or FCGID.

PERL - mod_perl, cgi, cgid , mod_fcgid, mod_psgi.

Thanks
Hemant

openssl-1.1.0 with httpd-2.4.33

Hi All,

I am trying to build openssl-1.1.0 with httpd-2.4.33, everything is working
fine without mod_ssl. But when I am loading mod_ssl, I am getting error
while deloading the module i:e dso_close. Whereas httpd-2.4.33 is working
fine with openssl-1.0.2d.

Does anybody also get this issue ?

Thanks
Hemant

Apache supports client initiated renegotiation

Hi Team,

I tried to send request from openssl-1.0.2d to Apache server-2.4.25 for ssl
renegotiation using command "openssl s_client -connect IP:PORT". I got
error RENEGOTIATING
2283136:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake
failure:s3_pkt.c:656. I checked in error log, error is [client
15.213.82.149:52145] AH02042: rejecting client initiated renegotiation.

I got SSL_SECURE_RENEG true in my custom log, it means we are supporting
Secure Renegotiation. But how should I enable client initiated ssl
renegotiation ?

Thanks
Hemant

Logging in apache

Hi Team,

How apache writes to access_log or error log. Whether it opens File
Descriptor(FD) for each request/connection to write in log file.

Thanks
Hemant

How modules are called during request processing phase

Hi All,

If I have two modules mod_A and mod_B. Both has defined a hook handler with
APR_HOOK_MIDDLE then which module will be called first to check handler.
Whether calling of module will be random for each request or it depends
which module is loaded first in httpd.conf.

Thanks
Hemant

Writting own module

Hi All,

I am writing my own module just to check process flow.

Scoreboard file

Hi,

According to Apache documentation, parent and Child processes communicate
with shared memory. But I don't have shared memory, therefore they are
communicating through scoreboard file.

I added " ScoreBoardFile /apache/logs/apache_runtime_status " in httpd.conf
to create file at this location. When I started, apache_runtime_status file
get created at above location. But this file contains only 4 Bytes and
file is not getting updated with load on apache. Then how child and parent
processes are communicating with this 4 Byte scoreboard file?

Apache 2.0 architecture

Hi All,

While Debugging apache, I encountered with following questions. I am unable
to get answers for the following questions, please help to answer them.

Q1. Startup process is reading configuration two times and creating
conftree. Why do we need to read configuration script twice? Is there any
difference in conftree after first and second read of configuration script.

Q2. When we start apache, it starts with startup process and then it
detaches and starts Master/Parent Process. After that Master Process take
control and spawn child processes.

Mutex at run time

Hi,

I set Mutex to default, sysvsem but when I am checking error_log
AcceptMutex is none.

My httpd.conf:
Mutex sysvsem
Mutex sysvsem mpm-accept

My error_log :
worker.c(1885): AH00294: Accept mutex: none (default: sysvsem)

Where am I going wrong to use mutex ?

Hemant

Integrate Apache-2.4.25 with tomcat-8.5.23

Hi,

My apache is running on 15.213.91.33:5643 at location "/home/hemant/apache"
and tomcat-8.5.x is running on 15.213.91.33:8009 at location
/home/hemant/tomcat.

To integrate apache with tomcat I used mod_proxy and mod_proxy_ajp.
My httpd.conf looks like this :
<Location /ajp>
ProxyPass "ajp://15.213.91.33:8009"
ProxyPassReverse "ajp://15.213.91.33:8009"
</Location>

My server.xml is configured like :
<Connector port="8009" protocol="AJP/1.3" proxyName="15.213.91.33"
proxyPort="5643" />

When I am accessing "15.213.91.33:5643/ajp" then index.html of tomcat
appears, but If I click on any tab

Worker MPM with debug mode

Hi All ,

I added the following patch of code in my worker.c
static void clean_child_exit(int code)

if (one_process) {
prefork_note_child_killed(/* slot */ 0, 0, 0);
+ atexit(apr_terminate);
}
ap_mpm_pod_close(my_bucket->pod);

When I am starting apache with Worker mpm in debug mode and killing the
process with kill -term PID, it is not killing the process.

After send status 200 response, process exited

Hi,,
I started my apache successfully, but when I am sending request from
browser. Getting ERR_NO_RESPONSE in chrome.

I added LogLevel trace7 and collected the error log. What I have found
that, after successful response of requests(status-200), process is
exited.

Apache sending Content-Length 0

Hi,

When I am sending request from browser to client for basic "index.html", I
am getting error that
" Err_EMPTY_RESPONSE " in browser.

When I checked in the error log, found that response content length is 0.

[Tue Dec 05 05:28:15.499282 2017] [core:trace5] [pid 150995199:tid
577157567797854212]
C:\cygwin64\home\hemant\apache\httpd-2.4.25\server\protocol.c(645): [client
15.213.82.149:62584] Request received from client: GET / HTTP/1.1
[Tue Dec 05 05:28:15.499445 2017] [http:trace4] [pid 150995199:tid
577157567797854212]
C:\cygwin64\home\hemant\apache\httpd-2.4.25\modules\http\http_request.c

AH00052 error in apache

Hi All,

When I am starting apache, its started successfully and also listening to
that port.
But when I am sending request from browser to apache. It is not responding
and giving error AH00052.

[Wed Nov 29 11:14:04.956827 2017] [core:notice] [pid 2097152018:tid
7876215824606887940] AH00052: child pid 738197672 exit signal signal #31
(31)

What is the reason for this error ? and how to solve it.
Attaching my configuration file.

Thanks
Hemant

Libtool lock error

Hi

While building apache, I am getting this error:
libtool: compile: Waiting for mod_lbmethod_bytraffic.o.lock to be removed
libtool: compile: Waiting for mod_lbmethod_bytraffic.o.lock to be removed
libtool: compile: Waiting for mod_lbmethod_bytraffic.o.lock to be removed
libtool: compile: Waiting for mod_lbmethod_bytraffic.o.lock to be removed
libtool: compile: Waiting for mod_lbmethod_bytraffic.o.lock to be removed
libtool: compile: Waiting for mod_lbmethod_bytraffic.o.lock to be removed
libtool: compile: Waiting for mod_lbmethod_bytraffic.o.lock to be removed

This time I am getting error

Worker MPM with kill

Hi,

I started apache server which has worker as mpm in debug mode. I killed the
process with kill -9 then it kills the process and stop debug. But when I
am using kill -term PID then it is not killing process. Whereas kill -term
PID is woking with prefork debug.

If I want to use kill -term PID in debug mode of worker then how to do that.

Thanks
Hemant

Aapche with c99 or c11

Hi All,

I have compiled my apache with c99 and its working fine. I am planning to
use c11 compiler also.
Is there any impact will occur if I use c11 in place of c99 ?

Few more questions :
1) My apr is not supporting sendfile,random and mmap. What will be the
impact ?
2) When I am sending request from apache j-meter to my apache server then
for http is working fine with good TPS but for https, TPS is not good
because for most of the request it is taking connection time of
7000-9000ms. Is there anything am I missing in ssl configuration so that it
shouldn't connect continuously.

Thanks
Hemant

Apache creates Semaphore

Hi,

Semaphore is used in multi process environment to share resources within
processes. But when I am starting apache in debug mode i:e single process
then still it creates semaphore. May I know the reason why it is creating
semaphore in debug mode also.

Thanks
Hemant

Apache with Semaphore

Hi

When I am starting apache in debug mode then it creates semaphore. In
another terminal I am giving command "httpd -k stop" to stop apache. It
stops successfully but it is not removing semaphore.

Why apache is not sending signal to remove semaphore in debug mode after
stop it.

Thanks
Hemant

Start apache with tomcat

Hi All,

I am using tomcat-7.0.82 and httpd-2.4.25.

Following are my configuration :

in server.xml

<!-- Define an AJP 1.3 Connector on port 8009 -->

<Connector port="5644" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3" URIEncoding="UTF-8" />

in httpd.conf

Listen 5643

Loaded mod_proxy_ajp and mod_proxy

Include /home/ananya/apache-2.4.25/other/ajp.conf

in ajp.conf

ProxyRequests Off

<Proxy *>

Require all granted

</Proxy>

ProxyPass / ajp://15.213.91.33:5644/

ProxyPassReverse / ajp://15.213.91.33:5644/

I started both tomcat and apache server.

log in socket.c in APR

Hi All,

I want to add log statement in apr to check some function in apr. When I am
adding ap_log_perror in socket.c in apr, it is giving error..

Is there nay way to print logs of apr. please help.

Thanks
Hemant

apr_socket_accept error

Hi,

When I am starting my apache-2.4.25, I am getting following error.

[Wed Oct 11 13:05:23.521575 2017] [core:error] [pid 1744830478]
(4104)Socket operation on non-socket: AH02179: apr_socket_accept: (client
socket)

What are the reasons for this error.
Help will be apreciated.

Thanks
Hemant

How to stop apache from debugging

Hi,

I started debugging with "./httpd -X" command. It starts debugging. Now I
want to stop debugging and start the server normally.

Which command should I use to stop debugging ?

HC

Run apache without master

Hi,

I want to start my apache without master process means when I will give
"httpd" command, it should start 5 worker process which has access to
httpd.conf as well as serve requests.

Is it possible to achieve this ? If yes, then how should to achieve this ?

Thanks
hemant

Waiting for mod_dav.o.lock to be removed

HI

I am getting "libtool:Waiting for mod_dav.o.lock to be removed" error while
make apache.

Any help will be appreciated.

Thanks
Hemant

Which file creates master process

Hi

I have apache-2.4.25 on my ststem. When we start server, initially master
process starts and give access to mpm. I want to know which ".c" file is
used to create master process before worker.c.

Thanks
Hemant

Build apache without mpm

Hi

By which configuration I can build apache without threaded> I dont want to
sue mpm.

Thanks
Hemant

MPM_Worker main process

Hi folks,

I have my apache-2.4.25 with worker mpm. For testing, I have killed the
master/main process and send simultaneous requests from apache j-meter and
my apache serves all the requests. What I have observed is that even with
loads number of worker threads are same, it means I lost forking
capability because of main process.

My query is without Master process, what functionalities will I loose?

Thanks
Hemant

User Auth type in apache-2.4.25

Hi ,

I have user and group in my httpd.config. I want to use user in Auth type
instead of basic or digest. so that whenever customer try to open
directory, promt will ask to enter username and password and customer can
enter "user" as username and password.

Is there any option to achieve this or I need to write my own module for
this.

Cheers,
Hemant