NAME

Provision::Unix::Web::Apache - Provision web hosting accounts on Apache

SYNOPSIS

FUNCTIONS

create

Create an Apache vhost container like this:

  <VirtualHost *:80 >
    ServerName blockads.com
    ServerAlias ads.blockads.com
    DocumentRoot /usr/home/blockads.com/ads
    ServerAdmin admin@blockads.com
    CustomLog "| /usr/local/sbin/cronolog /usr/home/example.com/logs/access.log" combined
    ErrorDocument 404 "blockads.com
  </VirtualHost>

	my $apache->create($vals, $conf);

	Required values:

         ip  - an ip address
       name  - vhost name (ServerName)
     docroot - Apache DocumentRoot

    Optional values

 serveralias - Apache ServerAlias names (comma seperated)
 serveradmin - Server Admin (email address)
         cgi - CGI directory
   customlog - obvious
 customerror - obvious
      sslkey - SSL certificate key
     sslcert - SSL certificate

enable

Enable a (previously) disabled virtual host.

$apache->enable($vals, $conf);

disable

Disable a previously disabled vhost.

$apache->disable($vals, $conf);

destroy

Delete's an Apache vhost.

$apache->destroy();

exists

Tests to see if a vhost definition already exists in your Apache config file(s).

show

Shows the contents of a virtualhost block that matches the virtual domain name passed in the $vals hashref.

$apache->show($vals, $conf);

get_file

If vhosts are each in their own file, this determines the file name the vhost will live in and returns it. The general methods on my systems works like this:

example.com would be stored in $apache/vhosts/example.com.conf

so would any subdomains of example.com.

thus, a return value for *.example.com will be "$apache/vhosts/example.com.conf".

$apache is looked up from the contents of $conf.

get_match

Find a vhost declaration block in the Apache config file(s).

AUTHOR

Matt Simerson, <matt at tnpi.net>

BUGS

Please report any bugs or feature requests to bug-unix-provision-virtualos at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Provision-Unix. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Provision::Unix

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2008 Matt Simerson

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.