3.142.171.180 |    

Navigation

Google Advertisement

Get ServerName, DocumentRoot, ErrorLog and CustomLog from VirtualHost-Block

vhostinfo
  1. #!/bin/bash
  2.  
  3. # get ServerName, DocumentRoot, ErrorLog and CustomLog from VirtualHost-Block...
  4. perl -n -e '
  5.  
  6. if ( $_ =~ m/<virtualhost/io .. $_ =~ m/<\/virtualhost>/io ) {
  7. 	print $1."\n" if ( $_ =~ /^\s*(documentroot\s+.*)$/i);
  8. 	print $1."\n" if ( $_ =~ /^\s*(servername\s+.*)$/i);
  9. 	print $1."\n" if ( $_ =~ /^\s*(errorlog\s+.*)$/i);
  10. 	print $1."\n" if ( $_ =~ /^\s*(customlog\s+.*)$/i);
  11. }
  12.  
  13. ' /etc/apache/httpd.conf
Parsed in 0.001 seconds at 345.26 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 3 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)