batch-apache/ 0040755 0001753 0001754 00000000000 07407714447 012521 5 ustar daniel coder batch-apache/back.html 0100644 0001753 0001754 00000000415 07310741204 014264 0 ustar daniel coder
(If that link does not work, please hit the back button on your browser.)
batch-apache/batch-apache-lib.pl 0100644 0001753 0001754 00000000061 07310741204 016074 0 ustar daniel coder # dtest.pl
do '../web-lib.pl';
&init_config();
batch-apache/config.info 0100600 0001753 0001754 00000001043 07336714704 014623 0 ustar daniel coder home_path=Directory to put domain home directories,0
user=User who owns domain files,5
should_default_webmaster=Specify an email address for webmaster?,1,0-No,1-Yes
default_webmaster=Email address of webmaster,0
should_copyindex=Specify an automatically generated home-page?,1,0-No,1-Yes
indexfile=Filename that is linked to become default home-page (Optional),0
addr=IP Address on this server (Optional; for virtual domains),0
outsideip=IP Address as seen by outside (Optional; if firewalled),0
follow=Chaining URL to add primary DNS (optional),0 batch-apache/help/ 0040755 0001753 0001754 00000000000 07407712002 013432 5 ustar daniel coder batch-apache/help/intro.html 0100644 0001753 0001754 00000020003 07407710225 015450 0 ustar daniel coder
Webmin Batch-Apache Version 0.2.2 and Batch-DNS Modules Version 0.1.2
Copyright (C) 2001 Daniel R. Allen and Prescient Code Solutions
Questions/comments/suggestions are welcome- please email daniel@coder.com
This module is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License.
Contents:
---------
Batch-Apache Module notes
Batch-DNS Module notes
Batch-Apache Module
Batch-Apache simplifies the task of adding a number of virtual domains to
a web server. Once some initial information is given to Batch-Apache, the
admin may add any number of domains in one step.
This module can chain together with the Batch-DNS module, so that Master
and Slave DNS can be set up for all domains in one step each.
Installation:
-------------
You can obtain Batch-Apache from http://coder.com/code/batch-apache.wbm
or by visiting http://webmin.thirdpartymodules.com/?page=Servers
Standard webmin Install places this module "Batch Apache Host Addition"
into the "Others" tab.
Module Configurations:
----------------------
- Directory to put domain home directories (eg., /home/apache)
- User who owns domain files (eg., www-user)
- Specify an email address for webmaster? No or Yes.
If "No", webmaster@domain is used.
- Email address of webmaster (eg., myaddress@myotherdomain.com)
- Specify an automatically generated home-page? No or Yes.
If "Yes", the file "domain/htdocs/index.html"
becomes a soft link to a default file.
- Filename that is linked to become default home-page (Optional)
(Eg., your "coming soon" webpage).
- IP Address on this server (Optional, If you need to specify a
non-default address for virtual domains)
- IP Address as seen by outside (Optional, if your firewall has a
different webserver IP address for outside
connections
- Chaining URL to add primary DNS (optional)
Chains the output of this module to the Batch-DNS module to create master
records. This is done via a URL so that you can have your Apache daemon
run on one server and your Bind 8 daemon run on another server.
To construct the URL for accessing another server in a single step
(without having to fill in your username and password each time) you can
use the following URL template:
http://username:password@domain.com:port/batch-dns/run.cgi
(where, of course, username, password, domain.com, and port are customized
for your setup).
Usage:
------
Log into webmin, choose the "Others" tab, and choose "Batch Apache Host
Addition".
Fill in the text field with as many domains as you like, one on a line.
All must be fully qualified (eg., must end in .com, .org, etc). Choose
"Save".
The script will: create a directory for each domain under your specified
home directory, create htdocs and cgi-bin directories, and if you like,
create a link to a standard index.html for the home directory. It will
update conf/httpd.conf with the new domains, and create an alias for
accessing each domain for testing purposes.
The exact httpd.conf additions are:
ServerAdmin $webmaster
ServerName $domain
ServerAlias $domain *.$domain
DocumentRoot $fullpath/htdocs
Alias /$domain $fullpath/htdocs
You will see a count and list of the apache domains succesfully added; if
there were any problems, they will be listed separately.
Choose "Restart Apache" to bring up the changes in Apache. The output page
will tell you apache has been restarted. Choose "Continue."
If you filled in a Chaining URL, you will see the option to "Add Master
DNS". Choose this link to submit the list of successful domain additions
to the Batch-DNS module. Batch-DNS may be installed on the same
physical server, or on a different server.
For those interested in the details of chaining, Batch-Apache constructs a
POST form with the Chaining URL as the action, with the following hidden
variables:
secondary - (0 for primary or 1 for secondary DNS)
ip - (IP address of this server)
domains - (carriage-return-delimited list of domain names to add)
Batch-DNS Module
Batch-DNS simplifies adding any number of master or slave DNS domains for
a server running Bind 8. It can chain to another instantiation of itself
on another server, so that after adding the master records, it can
automatically add slave records. Any number of slave servers can be
chained in series to the master server. It is also written to accept DNS
records from Batch-Apache.
Installation:
-------------
You can obtain Batch-DNS from http://coder.com/code/batch-dns.wbm
or by visiting http://webmin.thirdpartymodules.com/?page=Servers
Standard webmin Install places this module "Batch DNS Domain Addition"
into the "Others" tab.
Module Configurations:
----------------------
- Master server (the master's name to be used in
the zone records).
- Use specific email address? (default or yes- "default" means
"root@domain" will be used.
- Non-default email address (optional)
- Refresh time (in sec.)
- Transfer retry time (in sec.)
- Expiry Time (in sec.)
- Default time-to-live (in sec.)
- Chaining URL to add secondary DNS (optional)
Chains the output of this module to Batch-DNS to create slave DNS records.
This is done via a URL so that you can have Bind control master records on
one server, and slave records on another server, ideally in a different
network for added stability.
To construct the URL for accessing another server in a single step
(without having to fill in your username and password each time) you can
use the following URL template:
http://username:password@domain.com:port/batch-dns/run.cgi
(where, of course, username, password, domain.com, and port are customized
for your setup).
Usage:
------
Log into webmin, choose the "Others" tab, and choose "Batch DNS Domain
Addition."
Choose whether the records should be master or slave. To set up a domain,
you should start with master on one server, and then add slave on a second
server.
Fill in the domain name or IP address that will host all of the following
domain name records. This should be the IP or domain that will run Apache
or FTP or whatever other services you want to provide with the domains.
Fill in the text field with as many domains as you like, one on a line.
Any valid hostname is fine. (eg., server2, terminator.movie.com, etc.)
Choose "Save".
The script will create a zone file for each domain, and add an appropriate
zone record to the "named.conf" file for each master or slave.
You will see a count and list of the domains succesfully added; if there
were any problems, they will be listed separately.
If you filled in a Chaining URL, you will see the option to "Add Slave
DNS". Choose this link to submit the list of successful additions to the
Batch-DNS module as Slave records. You may have as many slaves as you
like, and each slave can be chained to the next via the chained URLs.
For those interested in the details of chaining, Batch-DNS uses a POST
form with the Chaining URL as the action, with the following hidden
variables:
secondary - (0 for primary or 1 for secondary DNS)
ip - (IP address for the host server)
domains - (carriage-return-delimited list of domain names to add)
------------------------------------------------------------------
Webmin Batch-Apache and Batch-DNS Modules
Copyright (C) 2001 Daniel R. Allen and Prescient Code Solutions
Questions/comments/suggestions are welcome- please email daniel@coder.com
This module is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License.
batch-apache/images/ 0040755 0001753 0001754 00000000000 07310741204 013746 5 ustar daniel coder batch-apache/images/icon.gif 0100644 0001753 0001754 00000000573 07123764017 015400 0 ustar daniel coder GIF87a0 0 fff , 0 0 0 hwYUU`mbQcj^FWf.-g_˳l͊rl:Шq|ZSlQy%J
koos3m+NO8Vqe20*"!v8²ƾWǷиTˤٻۺ]&b=
Hp*I#B
.3jI4./9YY
ɐp(b$Rn~ L;+{fʱQ 贬2蘋31cfK} ; batch-apache/README 0120777 0001753 0001754 00000000000 07407714447 016346 2help/intro.html ustar daniel coder batch-apache/lang/ 0040744 0001753 0001754 00000000000 07310741204 013420 5 ustar daniel coder batch-apache/module.info 0100600 0001753 0001754 00000000062 07310741204 014626 0 ustar daniel coder name=batch-apache
desc=Batch Apache Host Addition
batch-apache/run.cgi 0100700 0001753 0001754 00000012433 07407711575 014001 0 ustar daniel coder #!/usr/local/bin/perl
# run.cgi
#$no_acl_check = 1;
require './batch-apache-lib.pl';
my (@new_domains, @bad_domains);
my %bad_reason;
my $address;
my $directives;
&ReadParse();
&process();
&output();
sub process {
# modifies globals: @bad_domains, %bad_reason, @new_domains, $address.
foreign_require("apache", "apache-lib.pl");
my $error;
my $rawlist = $in{'domains'};
my @raw_domains = split '\n', $rawlist;
my $home_path = $config{'home_path'} || { $error = 1 };
my $user = $config{'user'} || { $error = 1 };
if ($config{'should_default_webmaster'}) {
$config{'default_webmaster'} || { $error = 1 };
}
my $should_copyindex = $config{'should_copyindex'} || 0;
my $indexfile;
if ($should_copyindex) {
$indexfile = $config{'indexfile'} || { $error = 1 };
}
if ($error) {
&error("Missing Configuration information. Please select \"Module Config\".");
}
#getting htconf
foreign_require("apache", "apache-lib.pl");
%apache_config = foreign_config('apache');
if ($apache_config{'httpd_conf'}) {
$htconf = $apache_config{'httpd_conf'};
} else {
$htconf = "$apache_config{'httpd_dir'}/conf/httpd.conf";
}
#getting names of all servers:
my ($conf, @virt, %vserv, $ns, $v, $vm);
$conf = foreign_call('apache', 'get_config');
@virt = foreign_call('apache', find_directive_struct, "VirtualHost", $conf);
$ns = foreign_call('apache', 'find_directive', "ServerName", $conf);
$ns && ($vserv{$ns} = $ns);
foreach $v (@virt) {
$vm = $v->{'members'};
$ns = foreign_call('apache', 'find_vdirective', "ServerName", $vm, $conf);
$ns && ($vserv{$ns} = $ns);
}
# validate IP address
my $default_address = to_ipaddress((&get_system_hostname));
$address = $config{'addr'} || $default_address;
if ($address !~ /\S/) { &error("IP Address must not contain spaces.") };
if (!&check_ipaddress($address)) {
&error("Address $address is not a valid IP");
}
unless (-d $home_path) {
&error("Path $home_path does not exist.");
}
# name must have one or more '.', no illegal characters, no repeats.
foreach $domain (@raw_domains) {
$domain =~ s/\s$//;
if ($domain =~ /^\s*$/) { # entirely whitespace
next;
} elsif ($domain !~ /^\S+$/) {
push @bad_domains, $domain;
$bad_reason{$domain} = "Bad format: Domain contains space or other bad character.";
} elsif ($domain !~ /\./) {
push @bad_domains, $domain;
$bad_reason{$domain} = "Bad format: Domain does not contain a dot.";
} elsif ($vserv{$domain}) {
push @bad_domains, $domain;
$bad_reason{$domain} = "Domain already exists on this server.";
} else {
push @new_domains, $domain;
}
}
# build virtualhost directives and create directories
my $fullpath;
my $webmaster = $config{'default_webmaster'};
foreach $domain (@new_domains) {
$fullpath = "$home_path/$domain";
unless ($config{'should_default_webmaster'}) {
$webmaster = "webmaster\@$domain";
}
$directives .= <\n"; # chain to another server, if necessary. my $out_rawlist = join "\n", @new_domains; if ($config{'follow'}) { my $out_address = $config{outsideip} || $address; print "
"; print "