Menu

Grab Active File List

Ross
/* Code to print the active Apache file list */

String rootConfFile = "/usr/local/apache2/conf/httpd.conf";
String serverRoot = "/usr/local/apache2";
String binFile = "/usr/local/apache2/bin/apachectl";

StaticModuleParser staticParser = new StaticModuleParser(new File(binFile));
SharedModuleParser sharedParser = new SharedModuleParser(new File(binFile));

Parser parser = new Parser(rootConfFile, serverRoot, staticParser.getStaticModules(), sharedParser.getSharedModules());

String files[] = parser.getActiveConfFileList();
for(int i=0; i<files.length; i++) {
    System.out.println(files[i]);
}

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.