[sysadmin] vhostlist
| ( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105 | ||||
|---|---|---|---|---|
| Call Stack | ||||
| # | Time | Memory | Function | Location |
| 1 | 0.0001 | 53060 | {main}( ) | ../index.php:0 |
| 2 | 0.0002 | 56500 | require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' ) | ../index.php:17 |
| 3 | 0.1889 | 16855920 | require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' ) | ../wp-blog-header.php:16 |
| 4 | 0.1906 | 16918500 | include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' ) | ../template-loader.php:43 |
| 5 | 0.2275 | 17037144 | the_content( ) | ../single.php:16 |
| 6 | 0.2276 | 17039100 | apply_filters( ) | ../post-template.php:169 |
| 7 | 0.2312 | 17046568 | call_user_func_array ( ) | ../plugin.php:166 |
| 8 | 0.2312 | 17046752 | vim_color( ) | ../plugin.php:0 |
| 9 | 0.2312 | 17047088 | preg_replace ( ) | ../wp-vimcolor.php:143 |
| 10 | 0.2313 | 17057692 | preg_replace ( ) | ../wp-vimcolor.php:143 |
| 11 | 0.2313 | 17058848 | vimcolor_process_color( ) | ../wp-vimcolor.php(143) : regexp code:11 |
| 12 | 0.2412 | 17076096 | fread ( ) | ../wp-vimcolor.php:105 |
On our public web server, we are hosting a
lot of stuff. Currently, we have over one hundred virtual hosts defined in
Apache.
One day, I realised that I didn’t have an overview any more of all these
deployments. That’s when I decided to write a simple script to produce me a
list of all virtual hosts (and aliases) in HTML. As it’s all about file
parsing, and I got a bit bored of Perl, I decided to write it in AWK and wrap
it in sh so it can be installed as a CGI script on the same web server.
It’s still really basic, but it serves it’s purpose. Wished feature is to show
a difference between ServerName’s and ServerAlias’es. This is left as an
exercise to the reader.