Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/n2ref/apache_config_parser

Parse apache config
https://github.com/n2ref/apache_config_parser

apache config parser

Last synced: 7 days ago
JSON representation

Parse apache config

Awesome Lists containing this project

README

        

Apache config parser
====================

Parse apache config

## Example
```php

require_once('Apache_Config_Parser.php');

$server_apache_config = '/etc/apache2/apache2.conf';

$apache_config_parser = new Apache_Config_Parser($server_apache_config);
$apache_hosts = $apache_config_parser->getApacheHosts();

echo'

';print_r($apache_hosts);echo'
';
```

Result

```html
Array (
[host1.com] => Array (
[is_active] => 1
[document_root] => /home/username1/www/host1.com
[aliases] => Array (
0 => Array (
[name] => www.host1.com
[is_active] => 1
)
1 => Array (
[name] => h1.com
[is_active] => 1
)
)
)

[host2.com] => Array (
[is_active] => 1
[document_root] => /home/username2/www/host2.com
[aliases] => Array (
)
)

[host3.com] => Array (
[is_active] => 1
[document_root] => /home/username2/www/host2.com
[aliases] => Array (
)
)

...

)
```