-2

I am not too good in server and Linux commands as I am php guy, but I need something which can trigger a command or a script just after a client is connected/disconnected with my web server.

The basic thing which I want to do is to display the current active connection with the web server. Also display a flash when a new connection is established or closed.

It will be a great help if this can be done without hiring any server expertise....

Thanks

1 Answers1

1

You can use mod_status for reporting of new connections and just ask regularly for this info, but I don't know about any module which can push this info to you actively.

BTW not hiring a server guy is not best approach if you're building some serious business app.

Ondra Sniper Flidr
  • 2,653
  • 12
  • 18
  • Thanks Ondra for your answer and Yes mod_status is an option, but for this i have to do a lot of data parsing and continuous pinging for getting real time data :( while I need something which can either execute a script or push the information to an another service, if it can be possible easily. – Vikas Chaudhary Aug 08 '16 at 11:12
  • In this case you have to write your own apache module. But is it really what you want? Don't forget there will be new connection for every image, css, javascript file etc. and this module will significantly slow down whole your environment (you will not see it in 10 reqs per second but you - resp. your customers - will when you will reach 100s reqs per sec). If you will have loadbalancer, there will be another connections for healthchecks. – Ondra Sniper Flidr Aug 08 '16 at 12:29
  • No i don't want that.... that's why I came out for getting some help & proper guidance. My basic requirement is to display the active connections and IN/OUT flash only, One way is very simple by using mod_status or by netstat commands similar to `netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head` but what I was looking for, it should trigger some event based on that I can broadcast the actual numbers..... – Vikas Chaudhary Aug 08 '16 at 12:56