How to restart Apache from Java application? -
i want restart apache java. have tried using following code restart it.
runtime.getruntime().exec("cmd.exe /c \"c:\\program files\\apache\\apache22\\bin\\httpd.exe\" -k restart -n \"localserver\"");
this doesn't seem work inside java program (it work if put command line). know i'm going run issues administrator stuff, want restart server. can give me pointers?
i managed figure out , make work windows 7 , uac admin thing.
process stop = runtime.getruntime().exec("\"c:\\program files\\apache\\apache22\\bin\\elevate.exe\" -c \"c:\\program files\\apache\\apache22\\bin\\httpd.exe\" -k stop -n \"localserver\"");
there second start again. first call elevate .exe downloaded elevated privileged able run commands , second did stop.
Comments
Post a Comment