How to Check Apache Connections

Apache is one of the famous web services and surpass for more than 100 Million website.

If you have experience in Server Administrator task, you surely headache on the Apache connections when it is getting tons of connections to the server. But, how could you going to check for those connections?

Some command like netstats, grep, ps, etc will very helpful to help you to understand the number of connections of the server.

Mick Genie will guide you some ways to list the Apache connection as below.

Grep port 80 (web services port)

netstat -alntp | grep :80

Check the number of connection from port 80

netstat -alntp | grep :80 | wc -l
ps auxw | grep httpd | wc -l

List the remote IPs connecting to your server on port 80

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr

List the unique remote IPs and the number of connections from each IP

netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

Why my 3GP file not serve by IIS?

By default, 3GP file extension is not understand and serve by the IIS, hence you might get the error as below when you try to browse to your 3GP file from your IIS web services engine.

The problem is IIS handler mapping do not have 3GP file extension format by default. To get this fixed, you could add the extension through the handler mapping from IIS 7.x.

Alternatively, you may run the following command to add the extension.

%windir%\system32\inetsrv\appcmd set config /section:staticContent /+"[fileExtension='.3gp',mimeType='video/3gpp']"

Faster PHP in IIS

Did you know Microsoft and PHP have came out faster PHP with IIS named wincache(Windows Cache Extension) last week?

This means that you will no longer see PHP process keep used up your memory if you are using IIS Web Services anymore.

How to get wincache? It is very easy, make sure that you have PHP5.2 or PHP5.3 installed with your machine. Even you may install Microsoft Web Platform Installer from your Windows Server 2003 or Windows Server 2008 machine to install it.

For more information, you may refer to the URL below for more detail.

WinCache Extension 1.0 for PHP – Release to Web

You might ask what is the advantage with WinCache extension? IIS (Internet Information System) have listed Wincache could increase the PHP performance on Windows by caching bytecode in memory, reduce file system I/O used in memory, etc.