This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

# parse_apache_configs A simple python library that will parse apache configs and convert them to a python data structure.

parse_apache_configs

A simple python library that will parse apache configs and convert them to a python data structure. This will then allow the configs to be manipulated programatically.

Main Functions

To use:

from parse_apache_configs import parse_config

Parse the apache config via file path, and return a python object representation:

apache_parse_obj = parse_config.ParseApacheConfig(apache_config_path="/some/path/to/file")
apache_config = apache_parse_obj.parse_config()

or to parse the apache config as a string:

apache_parse_obj = parse_config.ParseApacheConfig(apache_file_as_string=apache_string_obj)
apache_config = apache_parse_obj.parse_config()

Now you can use the apache_config object to manipulate the apache config.

To add or override an existing directive and return the result:

apache_config = apache_parse_obj.add_directive(apache_config, "SomeDirectiveName", "SomeDirectiveArguments", "<VirtualHost *:80>")

The code above will add the line “SomeDirectiveName SomeDirectiveArguments” under <VirtualHost *:80>. If the directive is already there, then it’s arguments will be overridden. Keep in mind that directives in nested tags can also be added/overridden, but their full “path” must be fed into add_directive. For example, given the following apache file:

<VirtualHost *:80>
  ServerName example.org
  ServerAlias *.example.org
  ErrorLog /var/log/httpd/example.err
  DocumentRoot /var/www/example.org
  <Directory "/var/www/example.org">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

To override the “Order” directive under <Directory “/var/www/example.org”>, the invocation to add_directive would look like this:

apache_config = apache_parse_obj.add_directive(apache_config, "Order", "deny,allow", "<VirtualHost *:80>", "<Directory "/var/www/example.org">")

To convert the apache_config object into a printable string:

apache_config_string = apache_parse_obj.get_apache_config(apache_config)
print apache_config_string
Release History

Release History

0.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
parse_apache_configs-0.0.2.tar.gz (4.7 kB) Copy SHA256 Checksum SHA256 Source Feb 1, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting