You can usually get some pretty good clues by looking at the HTTP headers, which you can do using curl (with the -I flag). For example,
$ curl -I www.microsoft.com
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 0
Server: Microsoft-IIS/8.0
P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM
INT NAV ONL PHY PRE PUR UNI"
X-AspNet-Version: 2.0.50727
VTag: 279958544400000000
X-Powered-By: ASP.NET
X-Powered-By: ARR/2.5
X-Powered-By: ASP.NET
Date: Fri, 20 Sep 2013 20:50:16 GMT
Note the line above that says Server: Microsoft-IIS/8.0
. By contrast, try:
$ curl -I www.php.net
HTTP/1.1 200 OK
Date: Fri, 20 Sep 2013 20:53:05 GMT
Server: Apache/2.2.21 (FreeBSD) mod_ssl/2.2.21 OpenSSL/0.9.8q PHP/5.4.16-dev
X-Powered-By: PHP/5.4.16-dev
Content-language: en
Set-Cookie: COUNTRY=USA%2C173.203.108.101; expires=Fri, 27-Sep-2013 20:53:05 GMT; path=/;
domain=.php.net
Last-Modified: Sat, 21 Sep 2013 02:21:12 GMT
Vary: User-Agent,Accept-Encoding
Connection: close
Content-Type: text/html;charset=utf-8
and, it's pretty clear that this is a LAMP setup.