0

So this question came to me earlier today, and I was wondering what was a accepted way of finding out if there were no active sessions to a WAMP server (so I could restart the server as a whole).

I'm using WAMP installed on a Windows 2003 server. Since HTTP is stateless, and the website in particular was a simple PHP + Flash + MySQL based website, the only way I checked to see if someone was on the website was to look at the access log. Now mind you the website is very very low traffic, goes days without any access. Probably see one access log entry a week or so.

Thinking about it in retrospect, I could've checked the PHP 'sessions store'. I know the programming of the website doesn't do any special session management, so which begs my auxiliary question, where does PHP store session info by default?

2 Answers 2

0

mod_status enabled with the server-status handler will tell you exactly what connections are established realtime.

Also, if you are worried about losing connections on a restart, you can perform an Apache graceful restart, which will maintain active connections on a restart.

httpd -k restart

My WampDeveloper Pro setup has this...

LoadModule status_module modules/mod_status.so
ExtendedStatus On

<VirtualHost *:80>
    DocumentRoot "C:/WampDeveloper/Websites/ServerHost/webroot"
    ServerName ServerStatus
    ServerAlias httpd.status

    <Directory "C:/WampDeveloper/Websites/ServerHost/webroot">
        Options FollowSymLinks
        AllowOverride None
        order deny,allow
        deny from all
    </Directory>

    <Location />
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
</VirtualHost>

This is a special VirtualHost that shows you all server connections.

0

What about running "netstat -a -n" from a cmd prompt and look for ESTABLISHED connections on port 80?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .