apache httpd启动时出现apache2 Java故障
对不起,我的英语不好
我正在尝试在Windows上从Java启动Apache HTTPD服务器
public static Process pp;
@Override
public void run() {
try {
Runtime run = Runtime.getRuntime();
try {
MyThread.pp = run.exec("usr/local/apache24/bin/httpd.exe");
BufferedReader in = new BufferedReader(new InputStreamReader(MyThread.pp.getErrorStream()));
String line;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
如果Apache-HTTPD将在没有输出到控制台的情况下启动(没有错误和警告),那么这段代码正确地启动了Apache-HTTPD服务器(在RAM中有两个进程),并且一切正常
但是,如果ApacheHttpD服务器有任何输出到控制台,那么这个Java代码就无法正确启动ApacheHttpD服务器。 例如,如果ApacheHTTPD服务器将有输出到控制台
AH00112: Warning: DocumentRoot [C:/Art/Dropbox/OpenSource/MyGIT/myprivatesite/]
does not exist
AH00548: NameVirtualHost has no effect and will be removed in the next release C
:/Art/MyServer/usr/local/apache24/conf/httpd.conf:535
Java只启动ApacheHTTPD服务器的一个进程,他无法工作
如果他有任何控制台输出,我如何启动ApacheHTTPD服务器
共 (0) 个答案