【发布时间】:2013-03-15 05:08:27
【问题描述】:
我有两个 apache 服务器。一台 apache 服务器正在运行。另一个 apache 没有运行。从运行 apche ,如何找到第二个 apache 是否正在运行?我想要jsp代码..
【问题讨论】:
-
“检查 apache 服务器是否正在运行”是什么意思?进程到了吗?它是否响应请求?是否可以从另一台特定服务器访问?
标签: java ajax apache jsp tomcat
我有两个 apache 服务器。一台 apache 服务器正在运行。另一个 apache 没有运行。从运行 apche ,如何找到第二个 apache 是否正在运行?我想要jsp代码..
【问题讨论】:
标签: java ajax apache jsp tomcat
我不明白你的意思,也许你想通过套接字连接 apache 服务器。
<%@ page contentType="text/html" import="java.io.*, java.net.*" %>
<%
try {
Socket s = new Socket("another.apache.com", 80);
BufferedReader in = new BufferedReader(new
InputStreamReader(s.getInputStream()));
PrintWriter socketOut = new PrintWriter(s.getOutputStream());
socketOut.print("GET /index.html\n\n");
socketOut.flush();
String line;
while ((line = in.readLine()) != null){
out.println(line);
}
} catch (Exception e){}
%>
如果没有异常,说明你的另一台apache服务器正在运行,否则处于离线状态。
【讨论】: