The ApacheConfParser provides a java library that is used to parse and read the Apache http server configuration. The library is currently used to power http://apachegui.net. Questions and comments can be sent to apachegui.net@gmail.com
The followng functionality is included in the library:
- Search for directives
- Search for enclosures
- Search for directives inside enclosures
- Grab the active file list
- Grab currently loaded modules
- Various parsing utilties
- Filters lines inside of IfModule declarations with modules that are not loaded
- Supports Multi-line configuration lines
- Much more...
The current jar files can be found under the dist directory of this project. You may also download a released jar file from the releases page of this project. The current jar file has two formats:
- Java library - This is a jar file with the ApacheConfParser code packaged into it. It does not contain any project dependencies. If you wish to run ApacheConfParser solely as a java library then this file is your best option.
- Runnable - This is a jar file with all dependencies packaged into it. This jar file has a Main class and is a valid runnable jar file. You can view details on running the jar here.
The ApacheConfParser source code is currently structured as a Maven enabled java project. It can be imported to any Java IDE as a Maven project.
If you wish to add ApacheConfParser to your project as a Maven dependency then you must add the snippets below to your pom.xml. Version 1.0.10 and above support Maven dependencies.
<repositories>
...
<repository>
<id>ApacheConfParser-mvn-repo</id>
<url>https://raw.githubusercontent.com/jrossi227/ApacheConfParser/mvn-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
...
</repositories>
<dependencies>
...
<dependency>
<groupId>net.apachegui</groupId>
<artifactId>ApacheConfParser</artifactId>
<version>1.0.10</version>
</dependency>
...
</dependencies>
- Java 1.6+
- Maven
The following steps can be used to generate javadoc and new jar files.
- Navigate to the project root directory (This is the directory that contains pom.xml).
- Run
mvn clean package
The target directory should contain the following after running the package build phase:
- A new java library jar file. A java library jar file can be found with the following naming convention ApacheConfParser-{version}.jar.
- A new runnable jar file. A runnable jar file can be found with the following naming convention ApacheConfParser-{version}-jar-with-dependencies.jar.
- New javadoc. Javadoc can be found exploded in the apidocs folder or bundled as jar file with the naming convention ApacheConfParser-{version}-javadoc.jar.
You can view code samples here
API Docs are available here
The generated jar is a Runnable jar file. You can view details on running the jar here.