Suponha que você precisa testar se um webserver está rodando

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
DICA UNIX[bb]
Dica Unix 3181 - 22 de outubro de 2009
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Suponha que você precisa testar se um webserver está rodando 

Suponha que você precisa de testar se um webserver está rodando ou não, e você não tem nenhum browser ( IE, Netscape, Lynx ... ) a mão no momento. Não se desespere, pois há um método bem interessante de fazer isto, simplesmente usando o telnet diretamente na porta http do servidor remoto ( a porta http normalmente roda na porta 80 ).

% telnet < endereço ip > < porta >

Quando a conexão for aberta, é só digitar "get / " sem as aspas duplas. Se o webserver estiver rodando ele irá lhe mostrar o código html da página ou então algumas informações básicas e irá fechar a conexão.

% telnet yahoo.com 80
Trying 204.71.200.245...
Connected to yahoo.com.
Escape character is '^]'.
get /
HTTP/1.0 302 RD
Location: http://www.yahoo.com/

Connection closed by foreign host

----------------------------------------

Para assinar: http://www.ugu.com/sui/ugu/show?tip.subscribe
Para sair: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
Para enviar uma dica: http://www.ugu.com/sui/ugu/show?tip.today
======================================
DECLARAÇÃO: TODAS AS DICAS DE UNIX SÃO PROPIEDADE DA UNIX GURU UNIVERSE E NÃO SÃO PARA SER VENDIDAS, IMPRESSAS OU USADAS SEM O CONSENTIMENTO POR ESCRITO DA UNIX GURU UNIVERSE. TODAS AS DICAS SÃO "USADAS POR SEU PROPRIO RISCO". UGU ADVERTE PARA TESTAR TODAS AS DICAS EM UM AMBIENTE QUE NÃO ESTEJA EM PRODUÇÃO. Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2008
======================================