#============================================================================# # vHost - one-step solution for all virtual hosting needs # # V00hostconf - host/dns configuration # # # # Copyright(c) Chaogic Systems, LLC. http://chaogic.com # # Author: Jake Fan # # # # This is Free Software; permission to use, copy, modify, and distribute # # this software and its documentation for any purpose - with or without fee # # - is hereby granted, provided that the above copyright information and # # this permission notice appear in all copies and documentations. This # # software is provided "as is" without express or implied warranty. For # # more details, see GNU General Public License as published by the Free # # Software Foundation. # # # #============================================================================# $X eq "configuration" && do { ################################################ ### EDITABLE CONFIGURATIONS ################################################## ### for distributed systems only. a list of servers functioning as a virtual # hosting cluster (e.g. using round robin dns). must be main host names or # main host ip's. separate each entry with white space. include the local # server if it's a member of the cluster. # $HOSTs = "host1.chaogic.com host2.chaogic.com 192.168.1.71 192.168.1.72"; $HOSTs = ""; ### for distributed systems only. a list of remotely accessible domain name # servers (with vhost installed to add/del dns records). must be main host # names or main host ip's. separate each entry with white space. include # the local server if it's one of the domain name servers. the first entry # will be treated as the master server. # $DNSs = "ns1.chaogic.com ns2.chaogic.com 192.168.1.1 192.168.1.2"; $DNSs = ""; ### a list of ip's allowed for ip aliasing and dns records. must be single # ip's or ranges of ip's. separate each entry with white space. when left # blank, all ip's will be allowed. value ignored (treated as blank) when # dynamic ip support is enabled. see $IPADD below for more information. # $IPs = "192.168.1.77 192.168.1.64-192.168.1.95 192.168.7.1-192.168.9.254"; $IPs = ""; ### non-top level domains that are treated as top level. may contain country # codes or any other suffixes. separate each entry with white space. # $TLDs = ".chaogic.com .uh.edu .co.il .co.jp .co.uk .co.za"; $TLDs = ".chaogic.com .uh.edu .co.il .co.jp .co.uk .co.za"; ### security level for adding/deleting dns records, hosts, and host aliases, # i.e., who can add/del. 2 = virtual host owners (sub-domains/hosts only), # 1 = virtual root users, 0 = root only. # $HOSTADD = "2"; $HOSTADD = "2"; ### ip address selection scheme for implicit ip in command "vhost --addhost". # 0 = all virtual hosts use one default ip, which is the first entry in $IPs # if it's a single ip, 1 = each virtual host is assigned with the least # occupied ip in $IPs, 2 = reserved for future use, 3 = dynamic ip support. # the main host ip will be used if $IPs is blank or inapplicable. (dynamic # ip support will be implemented in version 4.0.) # $IPADD = "0"; $IPADD = "0"; ### when adding/deleting virtual hosts and host aliases, 1 = automatically # add/del dns records, 0 = disable the feature. the "-z" and "-i" switches # can be passed from "vhost --addhost" when desired. the local and remote # dns servers ($DNSs) should be properly setup when enabling this feature. # $DNSAWARE = "0"; $DNSAWARE = "0"; ### on distributed systems, !0 = sync user id's across all systems when adding # virtual root users and virtual host owners, 0 = disable the feature. when # enabled, a positive number also serves as the starting number for the # search of available user id's. # $UIDSYNC = "2000"; $UIDSYNC = "2000"; ### on distributed systems, 1 = enable remote root access to root level vhost # commands, 0 = disable such access. # $ROOTCMD = "1"; $ROOTCMD = "1"; ### account for remote access on distributed systems. should be a trusted # user with a sh-style shell. must be able to run commands remotely on # participating systems listed in $HOSTs/$DNSs without supplying a password # (see $REXEC below). profiles with different $HOSTs/$DNSs or $VHOME # settings must not use the same $RUSER. will be created if doesn't exist. # $RUSER = "vhost"; $RUSER = "vhost"; ### command prefix for remote access on distributed systems. use rsh or ssh. # vhost should automatically work with rsh, assuming rshd is running on # participating systems with .rhosts authentication enabled. ssh requires # manual setup but is highly recommended for enhanced security. must end # with "-l $RUSER". # $REXEC = "rsh -l $RUSER"; $REXEC = "rsh -l $RUSER"; ### home directory for virtual hosts. most virtual host data and directory # structures will be stored under this directory. will be created if # doesn't exist. # $VHOME = "/vhost"; $VHOME = "/vhost"; ### optional host template directory. contents under this directory will be # recursively copied to the directory of newly created virtual hosts. # $HTEMP = "$VHOME/vhost.template"; $HTEMP = "$VHOME/vhost.template"; ### optional user template directory. contents under this directory will be # recursively copied to the directory of newly created virtual users. # $UTEMP = "$HTEMP/home/vuser.template"; $UTEMP = "$HTEMP/home/vuser.template"; ### official admin name on virtual hosts. used in places where the admin # contact mail address is needed. # $ADMIN = "admin"; $ADMIN = "admin"; ### shell used when granting virtual root users and virtual host owners # telnet/shell access. can be any valid shell found in "/etc/shells". # $SHELL = "/bin/bash"; $SHELL = "/bin/bash"; ### maximum access level allowed in command "vhost --access" for virtual host # owners. 2 = telnet/shell, 1 = ftp/web-gui, 0 = none. also used as the # default access level when creating virtual root users and virtual host # owners. # $ACCESS = "1"; $ACCESS = "1"; ### maximum number of virtual host owners allowed under the current profile, # including virtual root users. must be a non-negative decimal integer. # 0 = no limit. # $OWNERMAX = "0"; $OWNERMAX = "0"; ### maximum quota values allowed in command "vhost --qhost". in the form of # "mailbox_size(K/M/G) #user #uali". must be non-negative decimal numbers. # 0 = no limit. also used as the default host quota values when creating # virtual hosts. # $QHOST = "0.0K 0 0"; $QHOST = "0.0K 0 0"; ### maximum quota vaules allowed in command "vhost --quser". in the form of # "disk_space(K/M/G) #host #hali". must be non-negative decimal numbers. # 0 = no limit. also used as the default user quota values when creating # virtual root users and virtual host owners. # $QUSER = "0.0K 0 0"; $QUSER = "0.0K 0 0"; ### command history log file. can be viewed with command "vhost --cmdlog". # will be created if doesn't exist. # $CMDLOG = "/var/log/messages"; $CMDLOG = "/var/log/messages"; ### pager program for viewing logs. set to "/bin/cat" to disable paging. # will be overwritten by environment variable $PAGER if it exists and # points to a secure pager program. # $PAGER = "/usr/bin/less"; $PAGER = "/usr/bin/less"; ### caching of disk usage information (as reported by system command "du") # for command "vhost --lshost". 1 = enable caching for fast output, 0 = # disable caching for real-time data. command-line option "-f" ignores # this value and disables caching. a cron job will be created to update # the cache if $cronDir (see below) is setup properly. # $DUCACHE = "0"; $DUCACHE = "0"; ### when running command "vhost --uphost", 1 = automatically update virtual # host ip addresses if an ip address is different from the main host ip or # not listed in $IPs (depending on the value of $IPADD), 0 = disable the # feature and leave all ip addresses untouched even if the main host ip or # $IPs has been changed. # $UPDATEIP = "1"; $UPDATEIP = "1"; ### character used to replace the dot (".") character in usernames. set to # "." itself for systems that allow "." in usernames. # $dotChar = "."; $dotChar = "."; ### username length limit on the main host. system dependent. # $unameLen = "32"; $unameLen = "32"; ### minimum length required for alternative logins. # $minLogin = "8"; $minLogin = "8"; ### block size in bytes on file system $VHOME. # $blockSize = "1024"; $blockSize = "1024"; ### directory on the main host which contains user homes. # $homeDir = "/home"; $homeDir = "/home"; ### directory on the main host which contains user mails. # $mailDir = "/var/spool/mail"; $mailDir = "/var/spool/mail"; ### directory on the main host which contains crontab files. # $cronDir = "/var/spool/cron"; $cronDir = "/var/spool/cron"; ### password file on the main host. # $passwdCf = "/etc/passwd"; $passwdCf = "/etc/passwd"; ### shadow password file on the main host. set to $passwdCf if no shadow. # $shadowCf = "/etc/shadow"; $shadowCf = "/etc/shadow"; ### mail alias file on the main host. # $aliasesCf = "/etc/aliases"; $aliasesCf = "/etc/aliases"; ### inetd configuration file or directory. set to file "inetd.conf" for inetd # or directory "xinetd.d" for xinetd. # $inetdCf = "/etc/inetd.conf"; $inetdCf = "/etc/inetd.conf"; ### inetd reload command sequence. separate multiple commands with shell meta # characters such as "|", ";", "||", "&&", etc. # $inetdRc = "/etc/rc.d/init.d/inetd reload"; $inetdRc = "/etc/rc.d/init.d/inetd reload"; ### dns configuration file. value ignored if this server is not a dns server # or not listed in $DNSs, in which case it will be retrieved from the dns # master server. (make sure $RUSER and $REXEC are setup properly on all # systems.) # $dnsCf = "/etc/named.conf"; $dnsCf = "/etc/named.conf"; ### dns reload command sequence. separate multiple commands with shell meta # characters such as "|", ";", "||", "&&", etc. leave blank if invoked by # inetd. value ignored if this server is not a dns server or not listed in # $DNSs, in which case it will be retrieved from the dns master server. # (make sure $RUSER and $REXEC are setup properly on all systems.) # $dnsRc = "/etc/rc.d/init.d/named reload"; $dnsRc = "/etc/rc.d/init.d/named reload"; ### dns reverse zone file. if you don't know what to put here, you probably # don't have the authority to add reverse mappings (ip-based hosts). value # ignored if this server is not a dns server or not listed in $DNSs, in # which case it will be retrieved from the dns master server. (make sure # $RUSER and $REXEC are setup properly on all systems.) # $revZf = ""; $revZf = ""; ### dns chroot directory if it's running in a chroot environment, otherwise # leave blank. value ignored if this server is not a dns server or not # listed in $DNSs, in which case it will be retrieved from the dns master # server. (make sure $RUSER and $REXEC are setup properly on all systems.) # $dnsRt = ""; $dnsRt = ""; ### $dnsCf master server forward zone configuration. vhost will replace # "[ZONE_NAME]" with the actual value. keep this and leave $slaveC blank # (see below) to make this server a master server. # $masterC = <<"---eoc---eoc---eoc---"; $masterC = <<"---eoc---eoc---eoc---"; zone "[ZONE_NAME]" { type master; file "named.[ZONE_NAME]"; }; ---eoc---eoc---eoc--- ### $dnsCf slave server forward zone configuration. vhost will replace # "[ZONE_NAME]" and "[MASTER_IP]" with actual values. keep this and leave # $masterC blank (see above) to make this server a slave server. # $slaveC = <<"---eoc---eoc---eoc---"; $slaveC = <<"---eoc---eoc---eoc---"; zone "[ZONE_NAME]" { type slave; file "slave.[ZONE_NAME]"; masters { [MASTER_IP]; }; }; ---eoc---eoc---eoc--- ### dns forward zone file configuration. vhost will replace "[NS_NAME]", # "[FILE_SERIAL]", "[ZONE_NAME]", and "[IP_ADDRESS]" with actual values. # $zoneC = <<"---eoc---eoc---eoc---"; $zoneC = <<"---eoc---eoc---eoc---"; \$TTL 1D @ IN SOA [NS_NAME]. root.[NS_NAME]. ( [FILE_SERIAL] ; serial 8H ; refresh 4H ; retry 2W ; expire 1D ; minimum ) @ IN NS [NS_NAME]. @ IN MX 10 mail.[ZONE_NAME]. @ IN A [IP_ADDRESS] www IN A [IP_ADDRESS] ftp IN A [IP_ADDRESS] mail IN A [IP_ADDRESS] ---eoc---eoc---eoc--- ### network address translation table for dns records. when adding/deleting # dns records, vhost will replace the relevant ip addresses found in the # first column with the corresponding ip addresses in the second column. # separate the two columns with white space. invalid entries will be # silently ignored. # $natC = <<"---eoc---eoc---eoc---"; # 192.168.1.77 206.180.157.77 # 192.168.1.254 206.180.157.77 # ---eoc---eoc---eoc--- $natC = <<"---eoc---eoc---eoc---"; #192.168.1.77 206.180.157.77 #192.168.1.254 206.180.157.77 ---eoc---eoc---eoc--- ### DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!! ### SanityChecking ########################################################### $EVAL{'$USER;'} = 4; $EVAL{'$PERM;'} = 4; $EVAL{'$HNAM;'} = 4; $EVAL{'$dotChar;'} = 4; $EVAL{'$unameLen;'} = 4; $EVAL{'$VUSR{$USER};'} = 3; $EVAL{'$VUSR{$U};'} = 3; $EVAL{'$VSPW{$U};'} = 3; $EVAL{'GetU;'} = 2; }; 1;