https://github.com/n2ref/apache_config_parser
Parse apache config
https://github.com/n2ref/apache_config_parser
apache config parser
Last synced: 5 months ago
JSON representation
Parse apache config
- Host: GitHub
- URL: https://github.com/n2ref/apache_config_parser
- Owner: n2ref
- License: gpl-2.0
- Created: 2014-11-11T09:26:34.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-07-13T13:21:02.000Z (over 3 years ago)
- Last Synced: 2025-06-13T23:35:28.167Z (6 months ago)
- Topics: apache, config, parser
- Language: PHP
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 (
)
)
...
)
```