Where the Apache HTTP server stores data for incoming requests
I configured the Apache HTTP server on my Linux machine. I’m sending a request to it from my Windows machine. I want to check the contents of an incoming request. Where does it store incoming requested data? I think on Windows machines it uses the C:\Users\username\AppData\Local\Temp file for this. I looked at the /var/tmp folder on my Linux machine, but all the files in that folder are empty.
I have a json web service developed using the web2py framework that is hosted on an Apache HTTP server on a Linux machine. It has get_tkn web service, and I’m trying to access it from a Python shell.
import jsonrpclib
import json
server_url = 'http://ip_address/appname/controllername/call/jsonrpc/'
api = jsonrpclib. Server(server_url)
tk_request = {
'header' : {
'a_id':u'f23ew343',\
'a_key':u'ldddk333k444d4',
'r_id':'12345',
't_id':'mec','uip_address':'someipaddr',
'tkn':''
},
'body' : {'prms' :{}}
}
api.get_tkn(tk_request)
Solution
It logs all incoming requests or any errors that occur. To view logs in real time in a Linux terminal, use the following command
tail -f /var/log/apache2/other_vhosts.access.log
The location and name of the log files depend on your Linux distribution.
Under debian/ubuntu it is /var/log/apache2, and on centos/fedora it is the /var/log/httpd folder. After executing the above command, send your request from Windows and view the real-time logs in your Linux terminal.