54.152.38.154 |    

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.004 seconds at 112.42 KB/s

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

User online
There are 3 users online.

Tags Cloud

Latest snippets
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)
STDERR
(Bash::Function)
radius
(CSS)
shadow
(CSS)
rotate
(CSS)
create_function
(JavaScript::Snippets)