diff --git a/sysutils/dtc/Makefile b/sysutils/dtc/Makefile index 657787b8b0c6..220053c43b29 100644 --- a/sysutils/dtc/Makefile +++ b/sysutils/dtc/Makefile @@ -6,7 +6,7 @@ # PORTNAME= dtc -PORTVERSION= 0.17.0.4 +PORTVERSION= 0.24.6.1 CATEGORIES= sysutils MASTER_SITES= ftp://ftp.gplhost.com/pub/dtc/bsd/ @@ -14,32 +14,82 @@ MAINTAINER= thomas@goirand.fr COMMENT= A hosting web GUI for admin and accounting all hosting services RUN_DEPENDS= ${LOCALBASE}/share/pear/Crypt/CBC.php:${PORTSDIR}/security/pear-Crypt_CBC \ - proftpd-mysql>=0:${PORTSDIR}/ftp/proftpd-mysql \ - ${LOCALBASE}/libexec/apache/mod_log_sql.so:${PORTSDIR}/www/mod_log_sql2 \ - ${LOCALBASE}/bin/webalizer:${PORTSDIR}/www/webalizer \ - ${LOCALBASE}/www/cgi-bin/sbox:${PORTSDIR}/www/sbox-dtc + ${LOCALBASE}/libexec/apache22/mod_log_sql.so:${PORTSDIR}/www/mod_log_sql2-dtc \ + ${LOCALBASE}/www/cgi-bin/sbox:${PORTSDIR}/www/sbox-dtc \ + ${LOCALBASE}/bin/sudo:${PORTSDIR}/security/sudo \ + ${LOCALBASE}/bin/run-mailcap:${PORTSDIR}/misc/mime-support \ + ${LOCALBASE}/lib/nss_mysql.so:${PORTSDIR}/net/libnss-mysql \ + ${LOCALBASE}/sbin/chrootuid:${PORTSDIR}/security/chrootuid \ + ${LOCALBASE}/bin/rrdtool:${PORTSDIR}/net/rrdtool \ + ${X11BASE}/lib/X11/fonts/bitstream-vera/Vera.ttf:${PORTSDIR}/x11-fonts/bitstream-vera \ + ${X11BASE}/lib/X11/fonts/webfonts/verdana.ttf:${PORTSDIR}/x11-fonts/webfonts \ + ${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mysql50-server NO_BUILD= yes -USE_MYSQL= yes USE_PHP= mysql pcre session .if defined(WITH_PHP5) DEFAULT_PHP_VER=5 -IGNORE_WITH_PHP=4 +BROKEN_WITH_PHP=4 +RUN_DEPENDS+= ${LOCALBASE}/bin/pear:${PORTSDIR}/devel/pear USE_PHP+= bz2 gd mbstring mcrypt mysql mysqli openssl pcre \ pear session sockets xml zlib .endif +.if defined(DTC_TOASTER) +RUN_DEPENDS+= ${LOCALBASE}/bin/webalizer:${PORTSDIR}/www/webalizer \ + ${LOCALBASE}/www/awstats:${PORTSDIR}/www/awstats \ + ${LOCALBASE}/bin/mhonarc:${PORTSDIR}/www/mhonarc \ + ${LOCALBASE}/bin/mlmmj-list:${PORTSDIR}/mail/mlmmj \ + ${LOCALBASE}/sbin/pure-ftpd:${PORTSDIR}/ftp/pure-ftpd \ + ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix \ + ${LOCALBASE}/cyrus/bin/deliver:${PORTSDIR}/mail/cyrus-imapd23 +USE_APACHE= 2.2+ + +.else + +.if defined(WITH_WEBALIZER) +RUN_DEPENDS+= ${LOCALBASE}/bin/webalizer:${PORTSDIR}/www/webalizer +.endif + +.if defined(WITH_AWSTATS) +RUN_DEPENDS+= ${LOCALBASE}/www/awstats:${PORTSDIR}/www/awstats +.endif + +.if defined(WITH_MHONARC) +RUN_DEPENDS+= ${LOCALBASE}/bin/mhonarc:${PORTSDIR}/www/mhonarc +.endif + +.if defined(WITH_MLMMJ) +RUN_DEPENDS+= ${LOCALBASE}/bin/mlmmj-list:${PORTSDIR}/mail/mlmmj +.endif + +.if defined(WITH_PUREFTPD) +RUN_DEPENDS+= ${LOCALBASE}/sbin/pure-ftpd:${PORTSDIR}/ftp/pure-ftpd +.elif defined(WITH_PROFTPD) +RUN_DEPENDS+= proftpd-mysql>=0:${PORTSDIR}/ftp/proftpd-mysql +.endif + +.if defined(WITH_POSTFIX) +RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix +.if defined(WITH_CYRUS_IMAPD) +RUN_DEPENDS+= ${LOCALBASE}/cyrus/bin/deliver:${PORTSDIR}/mail/cyrus-imapd23 +.endif +.elif defined(WITH_COURIER) +RUN_DEPENDS+= ${LOCALBASE}/libexec/courier/courierd:${PORTSDIR}/mail/courier \ + ${LOCALBASE}/lib/pam_mysql.so:${PORTSDIR}/security/pam-mysql +.endif + +.if defined(WITH_APACHE2) +USE_APACHE= 2.2+ +.endif + +.endif + DTCROOT?= www/dtc DTCDIR= ${PREFIX}/${DTCROOT} PLIST_SUB+= DTCROOT="${DTCROOT}" -# Now tested and working. In fact, under BSD it's easyer to use Apache2 now. -# If you know what to do so all dependancies are set correctly, please help! -.if defined(WITH_APACHE2) -IGNORE= with Apache 2 is untested -.endif - SUB_FILES= dtc-install dtc-deinstall SUB_LIST+= QMAIL_DIR="${QMAIL_DIR}" diff --git a/sysutils/dtc/distinfo b/sysutils/dtc/distinfo index cf0d060c69fe..94b43728220e 100644 --- a/sysutils/dtc/distinfo +++ b/sysutils/dtc/distinfo @@ -1,3 +1,3 @@ -MD5 (dtc-0.17.0.4.tar.gz) = 894e2f9bf96f31fd47cafd98972253fa -SHA256 (dtc-0.17.0.4.tar.gz) = 625e1e2983299ef99599d40dd52be4cc7cf42e703cc28ec6cf30abad59f9bc4b -SIZE (dtc-0.17.0.4.tar.gz) = 10215361 +MD5 (dtc-0.24.6.1.tar.gz) = 91017a593355e955d522806acea83c37 +SHA256 (dtc-0.24.6.1.tar.gz) = 168044efc074f7e425416e3d975fca584798becbd419338167084abb3db73936 +SIZE (dtc-0.24.6.1.tar.gz) = 32600446 diff --git a/sysutils/dtc/files/dtc-deinstall.in b/sysutils/dtc/files/dtc-deinstall.in index 05e76f367cd6..650737b9420b 100644 --- a/sysutils/dtc/files/dtc-deinstall.in +++ b/sysutils/dtc/files/dtc-deinstall.in @@ -59,7 +59,6 @@ then TMP_FILE2=`${MKTEMP} DTC_uninstall.crontab.XXXXXX` || exit 1 grep -v "Configured by DTC" $PATH_CRONTAB_CONF > $TMP_FILE grep -v "cd /usr/share/dtc/admin; " $TMP_FILE > $TMP_FILE2 - cp -f $PATH_NAMED_CONF $PATH_NAMED_CONF.DTC.removed # don't rm the original file, just empty it so we keep permissions echo -n > $PATH_CRONTAB_CONF cat < $TMP_FILE2 >> $PATH_CRONTAB_CONF @@ -71,18 +70,16 @@ if grep "Configured by DTC" $PATH_NAMED_CONF >/dev/null then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Uninstalling inclusion from named.conf" - echo "removing \"Configured by DTC\" and include \""${PATH_DTC_ETC}/named.conf"\" lines" fi TMP_FILE=`${MKTEMP} DTC_uninstall.named.conf.XXXXXX` || exit 1 TMP_FILE2=`${MKTEMP} DTC_uninstall.named.conf.XXXXXX` || exit 1 grep -v "Configured by DTC" $PATH_NAMED_CONF > $TMP_FILE grep -v "include \"$PATH_DTC_ETC/named.conf\"" $TMP_FILE > $TMP_FILE2 cp -f $PATH_NAMED_CONF $PATH_NAMED_CONF.DTC.removed - # don't purge the original file, just empty it + # don't rm the original file, just empty it echo -n > $PATH_NAMED_CONF cat < $TMP_FILE2 >> $PATH_NAMED_CONF - rm -f $TMP_FILE - rm -f $TMP_FILE2 + rm -f $TMP_FILE $TMP_FILE2 fi # @@ -113,6 +110,15 @@ then fi fi +if [ -e /etc/apache2/ports.conf ] ; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling ports.conf" + fi + if [ -e /etc/apache2/ports.conf.DTC_backup ] ;then + cat Uninstalling inclusion from postfix/master.cf" +fi +if grep "Configured by DTC" ${PATH_POSTFIX_ETC}/master.cf >/dev/null 2>&1 +then + start_line=`grep -n "Configured by DTC" ${PATH_POSTFIX_ETC}/master.cf | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" ${PATH_POSTFIX_ETC}/master.cf | cut -d":" -f1` + nbr_line=`cat ${PATH_POSTFIX_ETC}/master.cf | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.postfix.conf.XXXXXX` || exit 1 + cat ${PATH_POSTFIX_ETC}/master.cf | head -n $(($start_line - 1 )) > $TMP_FILE + cat ${PATH_POSTFIX_ETC}/master.cf | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f ${PATH_POSTFIX_ETC}/master.cf ${PATH_POSTFIX_ETC}/master.cf.DTC.removed + echo -n > ${PATH_POSTFIX_ETC}/master.cf + cat < $TMP_FILE >> ${PATH_POSTFIX_ETC}/master.cf + rm $TMP_FILE +fi + # # uninstall amavis/amavisd.conf # +PATH_AMAVISD_ETC=`dirname $PATH_AMAVISD_CONF` +# if there is no amavisd conf, but there is a conf.d, delete a 99-dtc file +if [ ! -f "$PATH_AMAVISD_CONF" -a -e $PATH_AMAVISD_ETC/conf.d/99-dtc ]; then + rm $PATH_AMAVISD_ETC/conf.d/99-dtc +fi + if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Uninstalling inclusion from amavis/amavisd.conf" fi @@ -262,3 +294,162 @@ then cp -f /etc/poppasswd.DTC.backup /etc/poppasswd fi fi + +# Uninstall sudoers and shell +# check for some path defaults... +if [ -z "$PATH_SUDO" ]; then + PATH_SUDO=`which sudo` +fi +if [ -z "$PATH_CHROOT" ]; then + PATH_CHROOT=`which chroot` +fi +if [ -z "$PATH_SHELLS_CONF" ]; then + PATH_SHELLS_CONF=/etc/shells +fi +if [ -z "$PATH_SUDOERS_CONF" ]; then + PATH_SUDOERS_CONF=/etc/sudoers +fi +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling inclusion from $PATH_SUDOERS_CONF" +fi +if grep "Configured by DTC" $PATH_SUDOERS_CONF >/dev/null 2>&1 +then + start_line=`grep -n "Configured by DTC" $PATH_SUDOERS_CONF | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" $PATH_SUDOERS_CONF | cut -d":" -f1` + nbr_line=`cat $PATH_SUDOERS_CONF | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.sudoers.XXXXXX` || exit 1 + cat $PATH_SUDOERS_CONF | head -n $(($start_line - 1 )) > $TMP_FILE + cat $PATH_SUDOERS_CONF | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f $PATH_SUDOERS_CONF $PATH_SUDOERS_CONF.DTC.removed + echo -n > $PATH_SUDOERS_CONF + cat < $TMP_FILE >> $PATH_SUDOERS_CONF + rm $TMP_FILE +fi + +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling inclusion from $PATH_SHELLS_CONF" +fi +if grep "Configured by DTC" $PATH_SHELLS_CONF >/dev/null 2>&1 +then + start_line=`grep -n "Configured by DTC" $PATH_SHELLS_CONF | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" $PATH_SHELLS_CONF | cut -d":" -f1` + nbr_line=`cat $PATH_SHELLS_CONF | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.shells.XXXXXX` || exit 1 + cat $PATH_SHELLS_CONF | head -n $(($start_line - 1 )) > $TMP_FILE + cat $PATH_SHELLS_CONF | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f $PATH_SHELLS_CONF $PATH_SHELLS_CONF.DTC.removed + echo -n > $PATH_SHELLS_CONF + cat < $TMP_FILE >> $PATH_SHELLS_CONF + rm $TMP_FILE +fi + +if [ -z "$PATH_SSH_CONF" ]; then + PATH_SSH_CONF=/etc/ssh/sshd_config +fi +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling inclusion from $PATH_SSH_CONF" +fi +if grep "Configured by DTC" $PATH_SSH_CONF >/dev/null 2>&1 +then + start_line=`grep -n "Configured by DTC" $PATH_SSH_CONF | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" $PATH_SSH_CONF | cut -d":" -f1` + nbr_line=`cat $PATH_SSH_CONF | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.ssh.XXXXXX` || exit 1 + cat $PATH_SSH_CONF | head -n $(($start_line - 1 )) > $TMP_FILE + cat $PATH_SSH_CONF | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f $PATH_SSH_CONF $PATH_SSH_CONF.DTC.removed + echo -n > $PATH_SSH_CONF + cat < $TMP_FILE >> $PATH_SSH_CONF + rm $TMP_FILE +fi + +# stuff to remove from NSS mysql config / password + +if [ -z "$PATH_NSS_CONF" ]; then + PATH_NSS_CONF=/etc/nss-mysql.conf +fi +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling inclusion from $PATH_NSS_CONF" +fi +if grep "Configured by DTC" $PATH_NSS_CONF >/dev/null 2>&1 +then + start_line=`grep -n "Configured by DTC" $PATH_NSS_CONF | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" $PATH_NSS_CONF | cut -d":" -f1` + nbr_line=`cat $PATH_NSS_CONF | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.nss-mysql.XXXXXX` || exit 1 + cat $PATH_NSS_CONF | head -n $(($start_line - 1 )) > $TMP_FILE + cat $PATH_NSS_CONF | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f $PATH_NSS_CONF $PATH_NSS_CONF.DTC.removed + echo -n > $PATH_NSS_CONF + cat < $TMP_FILE >> $PATH_NSS_CONF + rm $TMP_FILE +fi + +# stuff to remove from NSS mysql root config / shadow + +if [ -z "$PATH_NSS_ROOT_CONF" ]; then + PATH_NSS_ROOT_CONF=/etc/nss-mysql-root.conf +fi +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling inclusion from $PATH_NSS_ROOT_CONF" +fi +if grep "Configured by DTC" $PATH_NSS_ROOT_CONF >/dev/null 2>&1 +then + start_line=`grep -n "Configured by DTC" $PATH_NSS_ROOT_CONF | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" $PATH_NSS_ROOT_CONF | cut -d":" -f1` + nbr_line=`cat $PATH_NSS_ROOT_CONF | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.nss-mysql-root.XXXXXX` || exit 1 + cat $PATH_NSS_ROOT_CONF | head -n $(($start_line - 1 )) > $TMP_FILE + cat $PATH_NSS_ROOT_CONF | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f $PATH_NSS_ROOT_CONF $PATH_NSS_ROOT_CONF.DTC.removed + echo -n > $PATH_NSS_ROOT_CONF + cat < $TMP_FILE >> $PATH_NSS_ROOT_CONF + rm $TMP_FILE +fi + +if [ -z "$PATH_NSSWITCH_CONF" ]; then + PATH_NSSWITCH_CONF=/etc/nsswitch.conf +fi + +# remove the stuff from nsswitch.conf +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling inclusion from $PATH_NSSWITCH_CONF" +fi +if grep "Configured by DTC" $PATH_NSSWITCH_CONF >/dev/null 2>&1 +then + start_line=`grep -n "Configured by DTC" $PATH_NSSWITCH_CONF | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" $PATH_NSSWITCH_CONF | cut -d":" -f1` + nbr_line=`cat $PATH_NSSWITCH_CONF | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.nsswitch.XXXXXX` || exit 1 + cat $PATH_NSSWITCH_CONF | head -n $(($start_line - 1 )) > $TMP_FILE + cat $PATH_NSSWITCH_CONF | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f $PATH_NSSWITCH_CONF $PATH_NSSWITCH_CONF.DTC.removed + echo -n > $PATH_NSSWITCH_CONF + cat < $TMP_FILE >> $PATH_NSSWITCH_CONF + rm $TMP_FILE +fi + +APACHE2_CONFD="/etc/conf.d/apache2" +if [ -e ${APACHE2_CONFD} ]; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Uninstalling inclusion from $APACHE2_CONFD" + fi + if grep "Configured by DTC" $APACHE2_CONFD >/dev/null 2>&1 + then + start_line=`grep -n "Configured by DTC" $APACHE2_CONFD | cut -d":" -f1` + end_line=`grep -n "End of DTC configuration" $APACHE2_CONFD | cut -d":" -f1` + nbr_line=`cat $APACHE2_CONFD | wc -l` + TMP_FILE=`${MKTEMP} DTC_uninstall.conf.d_apache2.XXXXXX` || exit 1 + cat $APACHE2_CONFD | head -n $(($start_line - 1 )) > $TMP_FILE + cat $APACHE2_CONFD | tail -n $(($nbr_line - $end_line )) >> $TMP_FILE + cp -f $APACHE2_CONFD $APACHE2_CONFD.DTC.removed + echo -n > $APACHE2_CONFD + cat < $TMP_FILE >> $APACHE2_CONFD + rm $TMP_FILE + fi +fi + +rm -f ${PATH_DTC_ADMIN}/.htaccess +rm -f ${PATH_DTC_SHARED}/shared/cyrus.php +rm -f ${PATH_DTC_SHARED}/shared/securepay/paiement_config.php +rm -f ${PATH_DTC_SHARED}/shared/mysql_config.php diff --git a/sysutils/dtc/files/dtc-install.in b/sysutils/dtc/files/dtc-install.in index 316a85e973f3..3315552d2dba 100644 --- a/sysutils/dtc/files/dtc-install.in +++ b/sysutils/dtc/files/dtc-install.in @@ -13,9 +13,21 @@ UNIX_TYPE=freebsd VERBOSE_INSTALL=yes -echo "###############################################################" -echo "### Welcome to DTC config script for automatic installation ###" -echo "###############################################################" +# Create our group and user +CONF_DTC_SYSTEM_USERNAME=dtc +CONF_DTC_SYSTEM_GROUPNAME=dtcgrp +if getent group ${CONF_DTC_SYSTEM_GROUPNAME} >/dev/null ; then + echo "Group ${CONF_DTC_SYSTEM_GROUPNAME} already exists: skiping creation!" +else + pw groupadd ${CONF_DTC_SYSTEM_GROUPNAME} +fi +CONF_DTC_SYSTEM_GID=`getent group ${CONF_DTC_SYSTEM_GROUPNAME} | cut -d':' -f3` +if getent passwd ${CONF_DTC_SYSTEM_USERNAME} >/dev/null ; then + echo "User ${CONF_DTC_SYSTEM_USERNAME} already exists: skiping creation!" +else + pw useradd ${CONF_DTC_SYSTEM_USERNAME} -m -s /bin/false -g ${CONF_DTC_SYSTEM_GROUPNAME} +fi +CONF_DTC_SYSTEM_UID=`getent passwd ${CONF_DTC_SYSTEM_USERNAME} | cut -d':' -f3` # DATABASE CONFIGURATION echo "### MYSQL CONFIGURATION ###" @@ -24,174 +36,16 @@ echo "WARNING: Your MySQL Server MUST be running." echo "If not, please issue the following cmd:" echo "/usr/local/etc/rc.d/mysql-server.sh start" echo "" -echo "DTC needs to access to your mysql database" -echo "Please give your mysql account information" -echo "If you didn't setup a root password before," -echo "DTC can do it of you (later on this script)." -echo -n 'MySQL hostname [localhost]: ' -read conf_mysql_host -if [ "$conf_mysql_host" = "" ]; -then - conf_mysql_host="localhost" -fi - -echo -n 'MySQL root login [root]: ' -read conf_mysql_login -if [ "$conf_mysql_login" = "" ]; -then - conf_mysql_login="root" -fi - -echo "This is the password you want to be used after" -echo "this script is finished (not the old pass)." -echo -n 'MySQL root password []: ' -read conf_mysql_pass - -echo "" -echo "Do you want that DTC setup this password" -echo "for you ? (eg: UPDATE user SET Password=PASSWORD('XXX')...)" -echo -n 'Setup the mysql password [Ny]: ' -read conf_mysql_change_root -if [ ""$conf_mysql_change_root = "y" ]; -then - echo "===> Changing MySQL Root password" - echo "MySQL will now prompt your for the password to connect to" - echo "the database. This is the OLD password that was there before" - echo "you launched this script. If you didn't setup a root pass for" - echo "mysqld, just hit ENTER to use empty pass." - mysql -u$conf_mysql_login -p -h$conf_mysql_host -Dmysql --execute="UPDATE user SET Password=PASSWORD('"$conf_mysql_pass"') WHERE User='root'; FLUSH PRIVILEGES;"; -else - echo "Skinping MySQL password root change!" -fi - -echo "" -echo "What MTA (Mail Tranport Agent, the one that" -echo "will route and deliver your incoming mail) do" -echo "you wish to use with DTC ? Type q for qmail" -echo "or type p for postfix." -echo -n 'MTA type (Qmail or Postfix) [Q/p]: ' -read conf_mta_type -if [ "$conf_mta_type" = "p" ]; -then - conf_mta_type=postfix - echo "Postfix will be used" -else - conf_mta_type=qmail - echo "Qmail will be used" -fi - -echo -n 'Choose a DB name for DTC [dtc]: ' -read conf_mysql_db -if [ "$conf_mysql_db" = "" ]; -then - conf_mysql_db="dtc" -fi - -# Host configuration -# cur_ip_addr=`ifconfig | head -n 2 | tail -n 1 | cut -f2 -d":" | cut -f1 -d" "` -echo "### YOUR SERVER CONFIGURATION ###" -echo "" -echo "Please enter the main domain name you will use." -echo "DTC will install the root admin panel on that host." -echo -n "Domain name (example: toto.com): " -read main_domain_name - -echo "" -echo "DTC will install a root admin panel on a subdomain" -echo "of the domain you just provided. The default subdomain" -echo "is dtc, which leeds you to http://dtc."$main_domain_name"/" -echo "You can enter another subdomain name if you want." -echo -n 'Subdomain for DTC admin panel [dtc]: ' -read dtc_admin_subdomain - - -if [ "$dtc_admin_subdomain" = "" ]; -then - dtc_admin_subdomain="dtc" -fi - -echo "" -echo "I need now your host information for apache !" -echo -n "What is your IP addresse ? [ 127.0.0.1 ]: " -read conf_ip_addr - -if [ "$conf_ip_addr" = "" ]; -then - conf_ip_addr="127.0.0.1" -fi - -echo "" -echo " Do you want that DTC generates apache file to use" -echo "a LAN IP address that your server is using?" -echo "If your server is in the LAN behind a firewall" -echo "that does NAT and port redirections of the public IP(s)" -echo "address(es) to your server, then you must say YES" -echo "here, otherwise (if your server is connected directly" -echo "to the internet with a public static IP) leave it to NO." -echo -n "Use NATed vhosts ? [N/y]: " -read conf_use_nated_vhosts - -if [ ""$conf_use_nated_vhosts = "y" -o ""$conf_use_nated_vhosts = "Y" -o ""$conf_use_nated_vhosts = "yes"]; then - conf_use_nated_vhosts = "yes"; -else - conf_use_nated_vhosts = "no"; -fi - -echo "" -echo " Please enter the LAN IP of your server if you said" -echo "yes to use nated vhosts. Ignore otherwise." -echo -n "IP address of your server if in the LAN [192.168.0.2]: " -read conf_nated_vhost_ip -if [ ""$conf_nated_vhosts_ip = "" ]; then - conf_nated_vhosts_ip = "192.168.0.2" -fi - - -echo "" -echo "Where will you keep your files for hosting ?" -echo -n "Hosting path [/var/www/sites]: " -read conf_hosting_path -if [ "$conf_hosting_path" = "" ]; -then - conf_hosting_path="/var/www/sites" -fi - -echo "" -echo "Path where to build the chroot environment." -echo "Where do you want DTC to build the cgi-bin chroot" -echo "environment? Please note that DTC will do hardlinks" -echo "to that directory, so the chroot path should be in" -echo "the same logical device as the path for hosted" -echo "domains files." -echo -n "Chroot path [/var/www/chroot]: " -read conf_chroot_path -if [ "$conf_chroot_path" = "" ]; -then - conf_chroot_path="/var/www/chroot" -fi - -echo "" -echo "What admin login/pass do you want for the administration of "$main_domain_name "?" -echo -n "Login [dtc]: " -read conf_adm_login -if [ "$conf_adm_login" = "" ]; -then - conf_adm_login="dtc" -fi -echo -n "Password: " -read conf_adm_pass # Deamon path configuration - echo "### DEAMON PATH CONFIGURATION ###" -if [ -f "${LOCALBASE}/etc/apache/httpd.conf" ] ;then - PATH_HTTPD_CONF="${LOCALBASE}/etc/apache/httpd.conf" -elif [ -f "${LOCALBASE}/etc/apache2/httpd.conf" ] ;then - PATH_HTTPD_CONF="${LOCALBASE}/etc/apache2/httpd.conf" +if [ -f "${LOCALBASE}/sbin/apxs" ]; then + PATH_HTTPD_CONF="`/usr/local/sbin/apxs -q SYSCONFDIR`/httpd.conf" else echo "Could not found your httpd.conf: exiting." exit 1 fi +PATH_APACHE_PID_FILE="/var/run/httpd.pid" PATH_NAMED_CONF="/etc/namedb/named.conf" # Copy default conf if no conf exists (BSD specific) if [ ! -f ${LOCALBASE}/etc/proftpd.conf ]; @@ -201,6 +55,12 @@ fi PATH_PROFTPD_CONF="${LOCALBASE}/etc/proftpd.conf" PATH_DOVECOT_CONF="${LOCALBASE}/etc/dovecot.conf" PATH_COURIER_CONF_PATH="${LOCALBASE}/etc/courier" +PATH_COURIER_AUTHD_CONF_PATH="${LOCALBASE}/etc/courier" +if [ ! -f $PATH_COURIER_AUTHD_CONF_PATH/authdaemonrc ]; then + if [ -f ${LOCALBASE}/etc/authlib/authdaemonrc ]; then + PATH_COURIER_AUTHD_CONF_PATH="${LOCALBASE}/etc/authlib" + fi +fi PATH_POSTFIX_CONF="${LOCALBASE}/etc/postfix/main.cf" PATH_POSTFIX_ETC="${LOCALBASE}/etc/postfix" PATH_SASL_PASSWD2="${LOCALBASE}/sbin/saslpasswd2" @@ -213,6 +73,10 @@ PATH_DTC_SHARED="${PREFIX}/www/dtc" PATH_CRONTAB_CONF=/etc/crontab PATH_AWSTATS_ETC=${LOCALBASE}/etc/awstats MYSQL_DB_SOCKET_PATH="/tmp/mysqld.sock" +PATH_CGIBIN="${LOCALBASE}/lib/cgi-bin" + +PATH_SUDOERS_CONF="${LOCALBASE}/etc/sudoers" +PATH_RRDTOOL="${LOCALBASE}/bin/rrdtool" PATH_DTC_ETC=$PATH_DTC_SHARED"/etc" PATH_DTC_ADMIN=$PATH_DTC_SHARED"/admin" @@ -223,49 +87,6 @@ USER_ADD_CMD=groupadd USER_MOD_CMD=usermod PASSWD_CMD=passwd -echo "" -echo "" -echo "" -echo "" -echo "" -echo "### Last confirmation before installation !!! ###" -echo "" -echo "Here are the given informations:" -echo "" -echo "MySQL host: "$conf_mysql_host -echo "MySQL login: "$conf_mysql_login -echo "MySQL pass: "$conf_mysql_pass -echo "MySQL db: "$conf_mysql_db -echo "Addresse of dtc panel: http://"$dtc_admin_subdomain"."$main_domain_name"/" -echo "IP addr: "$conf_ip_addr -echo "Hosting path: "$conf_hosting_path -echo "DTC login: "$conf_adm_login -echo "DTC pass: "$conf_adm_pass -echo "httpd.conf: "$PATH_HTTPD_CONF -echo "named.conf: "$PATH_NAMED_CONF -echo "proftpd.conf: "$PATH_PROFTPD_CONF -echo "dovecot.conf: "$PATH_DOVECOT_CONF -echo "Courier authdaemonrc: "$PATH_COURIER_CONF_PATH -echo "postfix/main.cf: "$PATH_POSTFIX_CONF -echo "qmail control: "$PATH_QMAIL_CTRL -echo "php4 cgi: "$PATH_PHP_CGI -echo "Freeradius sql.conf and rad.conf folder: "$FREERADIUS_ETC -echo "Awstats awstats.conf folder: "$PATH_AWSTATS_ETC -echo "generated files: "$PATH_DTC_ETC -echo "" -echo "" -echo "" -echo -n 'Confirm and install DTC ? [Ny]:' -read valid_infos - -if [ "$valid_infos" = "y" ]; -then - echo "Installation has started..." -else - echo "Configuration not validated : exiting !" - exit 1 -fi - echo "===> Checking BSD type" kernel=`uname -a | awk '{print $1}'`; echo "Kernel: $kernel" @@ -349,6 +170,288 @@ if [ -f /usr/local/share/pear/PEAR.php ] ;then fi fi +# Here starts the interactive_installer.sh script +#!/bin/sh + +# This is the interactive installer that will asks questions +# for all of these OS that don't have ncurse (or similar) +# automated system. +# Authors: Thomas Goirand +# and Damien Mascord with the help +# of some contributors + +echo "###############################################################" +echo "### Welcome to DTC config script for automatic installation ###" +echo "###############################################################" + +if [ -f "/root/.dtc_install" ]; then + . /root/.dtc_install +else + touch /root/.dtc_install +fi + +# DATABASE CONFIGURATION +echo "### MYSQL CONFIGURATION ###" +echo "" +echo "DTC needs to access to your mysql database" +echo "Please give your mysql account information" +if [ -z $conf_mysql_host ] ; then + conf_mysql_host="localhost" +fi +echo -n "MySQL hostname [${conf_mysql_host}]: " +read answer +if [ ! -z $answer ]; then + conf_mysql_host=${answer} +fi +sed -i.bak '/conf_mysql_host/d' /root/.dtc_install +echo "conf_mysql_host=${conf_mysql_host}" >> /root/.dtc_install + +if [ -z $conf_mysql_login ] ; then + conf_mysql_login="root" +fi +echo -n "MySQL root login [${conf_mysql_login}]: " +read answer +if [ ! -z $answer ]; then + conf_mysql_login=${answer} +fi +sed -i.bak '/conf_mysql_login/d' /root/.dtc_install +echo "conf_mysql_login=${conf_mysql_login}" >> /root/.dtc_install + +if [ -z $conf_mysql_pass ] ; then + conf_mysql_pass="" +fi +echo -n "MySQL root password [${conf_mysql_pass}]: " +read answer +if [ ! -z $answer ]; then + conf_mysql_pass=${answer} +fi +sed -i.bak '/conf_mysql_pass/d' /root/.dtc_install +echo "conf_mysql_pass=${conf_mysql_pass}" >> /root/.dtc_install + +echo "" +echo "Do you want that DTC setup this password" +echo "for you ? (eg: UPDATE user SET Password=PASSWORD('XXX')...)" +echo -n 'Setup the mysql password [Ny]: ' +read conf_mysql_change_root + +if [ ""$conf_mysql_change_root = "y" -o ""$conf_mysql_change_root = "Y" ]; then + echo "===> Changing MySQL Root password" + echo "MySQL will now prompt your for the password to connect to" + echo "the database. This is the OLD password that was there before" + echo "you launched this script. If you didn't setup a root pass for" + echo "mysqld, just hit ENTER to use empty pass." + mysql -u$conf_mysql_login -p -h$conf_mysql_host -Dmysql --execute="UPDATE user SET Password=PASSWORD('"$conf_mysql_pas"') WHERE User='root'; FLUSH PRIVILEGES;"; +else + echo "Skinping MySQL password root change!" +fi + +echo -n 'Choose a DB name for DTC [dtc]: ' +read conf_mysql_db +if [ ""$conf_mysql_db = "" ] ; then + conf_mysql_db="dtc" +fi + +echo "" +echo "What MTA (Mail Tranport Agent, the one that" +echo "will route and deliver your incoming mail) do" +echo "you wish to use with DTC ? Type q for qmail" +echo "or type p for postfix." +echo -n 'MTA type (Qmail or Postfix) [Q/p]: ' +read conf_mta_type +if [ ""$conf_mta_type = "p" -o ""$conf_mta_type = "P" ]; then + conf_mta_type=postfix + echo "Postfix will be used" +else + conf_mta_type=qmail + echo "Qmail will be used" +fi + +# Host configuration +echo "### YOUR SERVER CONFIGURATION ###" +echo "" +echo "Please enter the main domain name you will use." +echo "DTC will install the root admin panel on that host." +echo -n "Domain name (example: toto.com): " +read main_domain_name + +echo "" +echo "DTC will install a root admin panel on a subdomain" +echo "of the domain you just provided. The default subdomain" +echo "is dtc, which leads you to http://dtc."$main_domain_name"/" +echo "You can enter another subdomain name if you want." +echo -n 'Subdomain for DTC admin panel [dtc]: ' +read dtc_admin_subdomain +if [ ""$dtc_admin_subdomain = "" ] ; then + dtc_admin_subdomain="dtc" +fi + +if [ ""$UNIX_TYPE = "freebsd" -o ""$UNIX_TYPE = "osx" ]; then + echo "***FIX ME*** Installer in OS X and BSD version don't have IP addr detection yet!" + guessed_ip_addr="" +else + echo "Trying to guess your current IP..." + guessed_ip_addr=`ifconfig | head -n 2 | tail -n 1 | cut -f2 -d":" | cut -f1 -d" "` +fi + +echo "" +echo " Do you want that DTC generates apache file to use" +echo "a LAN IP address that your server is using?" +echo "If your server is in the LAN behind a firewall" +echo "that does NAT and port redirections of the public IP(s)" +echo "address(es) to your server, then you must say YES" +echo "here, otherwise (if your server is connected directly" +echo "to the internet with a public static IP) leave it to NO." +echo -n "Use NATed vhosts ? [N/y]: " +read conf_use_nated_vhosts +if [ ""$conf_use_nated_vhosts = "y" -o ""$conf_use_nated_vhosts = "Y" -o ""$conf_use_nated_vhosts = "yes" ]; then + conf_use_nated_vhosts="yes"; + echo "" + echo " Please enter the LAN IP of your server." + echo -n "IP address of your server if in the LAN [${guessed_ip_addr}]: " + read conf_nated_vhost_ip + if [ ""$conf_nated_vhosts_ip = "" ]; then + conf_nated_vhosts_ip=$guessed_ip_addr + fi +else + conf_use_nated_vhosts="no"; + conf_nated_vhosts_ip="192.168.0.2" +fi + +echo "" +echo "I need now you host information to configure the daemons." +if [ ""$conf_use_nated_vhosts = "yes" ] ; then + echo -n "What is your external (public) IP addresse ?: " + read conf_ip_addr +else + echo -n "What is your IP addresse ? [${guessed_ip_addr}]: " + read conf_ip_addr + if [ ""$conf_ip_addr = "" ]; then + conf_ip_addr=$guessed_ip_addr + fi +fi + +echo "" +echo "Where will you keep your files for hosting ?" +echo -n "Hosting path [/var/www/sites]: " +read conf_hosting_path +if [ ""$conf_hosting_path = "" ] ; then + conf_hosting_path="/var/www/sites" +fi + +echo "" +echo "Path where to build the chroot environment." +echo "Where do you want DTC to build the cgi-bin chroot" +echo "environment? Please note that DTC will do hardlinks" +echo "to that directory, so the chroot path should be in" +echo "the same logical device as the path for hosted" +echo "domains files." +echo -n "Chroot path [/var/www/chroot]: " +read conf_chroot_path +if [ ""$conf_chroot_path = "" ] ; then + conf_chroot_path="/var/www/chroot" +fi + +echo "" +echo "What admin login/pass you want for the administration of "$main_domain_name "?" +echo -n "Login [dtc]: " +read conf_adm_login +if [ ""$conf_adm_login = "" ] ; then + conf_adm_login="dtc" +fi +echo -n "Password: " +read conf_adm_pass + +if [ -z "$conf_eth2monitor" ] ; then + if [ ""$UNIX_TYPE = "freebsd" -o ""$UNIX_TYPE = "osx" ]; then + echo "***FIX ME*** OS X and FreeBSD don't have interface detection yet!" + else + NBRLINES=`grep -v "lo:" /proc/net/dev | wc -l` + NBRIFACE=$((${NBRLINES} - 2 )) + CNT=${NBRIFACE} + ALL_IFACES='' + while [ ${CNT} -gt 0 ] ; do + ALL_IFACES=${ALL_IFACES}' '`grep -v "lo:" /proc/net/dev | tail -n ${CNT} | cut -f 1 -d':' | gawk -F ' ' '{print $1}' | head -n 1` + CNT=$((${CNT} - 1 )) + done + fi + echo "" + echo "DTC will setup an RRDTools graphing system for you, please" + echo "enter all the interfaces you wish to see in the total traffic." + echo -n 'Enter the iface you wish to monitor ['$ALL_IFACES']: ' + read conf_eth2monitor + if [ -z "$conf_eth2monitor" ]; then + conf_eth2monitor=$ALL_IFACES + fi +fi + +echo "" +echo "In order to know how many DTC setup has been done, the" +echo "installer can report to GPLHost web site. No data is collected" +echo "exept the operating system (Debian in your case), IP address" +echo "of the setup (we use the IP as an identifier so we don't account" +echo "upgrades and/or reinstallations, we wont ever use it for commercial" +echo "purpose)." +echo "You need an internet connection and wget installed to report. Do you" +echo "wish to allow DTC installer to report the setup of the control panel?" +echo -n 'Allow installer to report setup? [Yn]:' +read report_setup +if [ ""$report_setup = "y" -o ""$report_setup = "Y" -o ""$report_setup = "" ] ; then + conf_report_setup="true"; +else + conf_report_setup="false"; +fi + +echo "" +echo "In some environment, like FreeBSD Jail or Linux vServer," +echo "mknod is not allowed to be executed. For that reason, it's possible" +echo "to skip the creation of the dev null, random and urandom devices" +echo "durring the chroot template creation." +echo -n "Allow installer to create the devices template? [Yn]:" +read omit_dev_mknod +if [ ""$omit_dev_mknod = "y" -o ""$omit_dev_mknod = "Y" -o ""$omit_dev_mknod = "" ] ; then + conf_omit_dev_mknod="no" +else + conf_omit_dev_mknod="yes" +fi + +# Deamon path configuration +echo "" +echo "" +echo "" +echo "" +echo "" +echo "### Last confirmation before installation !!! ###" +echo "" +echo "Here are the given informations:" +echo "" +echo "MySQL host: "$conf_mysql_host +echo "MySQL login: "$conf_mysql_login +echo "MySQL pass: "$conf_mysql_pass +echo "MySQL db: "$conf_mysql_db +echo "Addresse of dtc panel: http://"$dtc_admin_subdomain"."$main_domain_name"/" +echo "IP addr: "$conf_ip_addr +echo "Hosting path: "$conf_hosting_path +echo "DTC login: "$conf_adm_login +echo "DTC pass: "$conf_adm_pass +echo "httpd.conf: "$PATH_HTTPD_CONF +echo "named.conf: "$PATH_NAMED_CONF +echo "proftpd.conf: "$PATH_PROFTPD_CONF +echo "dovecot.conf: "$PATH_DOVECOT_CONF +echo "Courier config path: "$PATH_COURIER_CONF_PATH +echo "postfix/main.cf: "$PATH_POSTFIX_CONF +echo "qmail control: "$PATH_QMAIL_CTRL +echo "php cgi: "$PATH_PHP_CGI +echo "generated files: "$PATH_DTC_ETC +echo "" +echo -n 'Confirm and install DTC ? [Ny]:' +read valid_infos +if [ ""$valid_infos = "y" -o ""$valid_infos = "Y" ] ; then + echo "Installation has started..." +else + echo "Configuration not validated : exiting !" + exit +fi + # Multi OS (Unix system) DATABASE setup sh script for DTC # Written by Thomas GOIRAND # under LGPL Licence @@ -365,10 +468,6 @@ fi # because it's up to you to write it ! :) # Do a "cat setup_mysql_db.sh >>your_os_setup_script" -# This is the setup script for -# MYSQL database initialisation procedure -# Written by Thomas Goirand - # Uses the following variables : # "MySQL host: "$conf_mysql_host @@ -386,6 +485,21 @@ if [ -z "$MKTEMP" ] ; then MKTEMP="mktemp -t" fi +# Params: +# $1 - File where to search +# $2 - String to search +# $3 - String to replace +# $4 - MKTEMP binary and params +searchAndReplace () { + if ! grep ${2} ${1} >/dev/null 2>&1 ; then + TMP_FILE=`${MKTEMP} DTC_SAR_TEMP.XXXXXX` || exit 1 + sed "s/${2}/${3}/" ${1} >${TMP_FILE} + cat ${TMP_FILE} >${1} + rm ${TMP_FILE} + fi +} + + if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "DTC is configuring your services: please wait..." echo "DTC installer is in VERBOSE mode" @@ -395,7 +509,7 @@ fi # Create hosting directories for main site if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "==> Creating directory for hosting "$main_domain_name + echo "===> Creating directory for hosting "$main_domain_name fi mkdir -p $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/"$dtc_admin_subdomain"/html" mkdir -p $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/"$dtc_admin_subdomain"/logs" @@ -409,7 +523,7 @@ mkdir -p $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/40 mkdir -p $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/Mailboxs" mkdir -p $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/mysql" ADMIN_HOME=$conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/"$dtc_admin_subdomain"/html" -if ! [ -e $ADMIN_HOME"/index.php" ] ;then +if ! [ -e $ADMIN_HOME/index.* ] ;then cp $PATH_DTC_SHARED"/shared/default_admin_site.php" $ADMIN_HOME"/index.php" if ! [ -e $ADMIN_HOME"/dtc_logo.gif" ] ;then cp $PATH_DTC_SHARED"/shared/template/dtc_logo.gif" $ADMIN_HOME @@ -421,22 +535,44 @@ fi # Copy a template site to the new main site MAINSITE_HOME=$conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/www/html" -if ! [ -e $MAINSITE_HOME"/index.php" ] ;then - if ! [ -e $MAINSITE_HOME"/index.html" ] ;then - cp $PATH_DTC_SHARED"/shared/template/index.php" $MAINSITE_HOME - if ! [ -e $MAINSITE_HOME"/dtc_logo.gif" ] ;then - cp $PATH_DTC_SHARED"/shared/template/dtc_logo.gif" $MAINSITE_HOME - fi +if ! [ -e $MAINSITE_HOME/index.* ] ;then + cp $PATH_DTC_SHARED"/shared/template/index.php" $MAINSITE_HOME + if ! [ -e $MAINSITE_HOME"/dtc_logo.gif" ] ;then + cp $PATH_DTC_SHARED"/shared/template/dtc_logo.gif" $MAINSITE_HOME fi fi -if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo chown -R nobody:65534 $conf_hosting_path +set +e + +nobodygroup=`cat /etc/group | cut -f 1 -d: | grep ^nobody` +# if we can't find the nobody group, try nogroup +if [ -z ""$nobodygroup ]; then + nobodygroup=`cat /etc/group | cut -f 1 -d: | grep ^nogroup` +fi +# if we can't find nogroup, then set to 65534 +if [ -z ""$nobodygroup ]; then + nobodygroup=65534 +fi + +# if we can't find the nobody group, try nogroup +nobodygid=`cat /etc/group | grep ^nobody | cut -f 3 -d:` +if [ -z ""$nobodygid ]; then + nobodygid=`cat /etc/group | grep ^nogroup | cut -f 3 -d:` +fi +# if we can't find nogroup, then set to 65534 +if [ -z ""$nobodygid ]; then + nobodygid=65534 fi -chown -R nobody:65534 $conf_hosting_path if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "==> DTC is now creating it's database:" + echo chown -R ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path +fi +chown -R ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path + +set -e + +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> DTC is now creating it's database:" fi # Added for MacOS X support with mysql not in the path... if [ ""$conf_mysql_cli_path = "" ] ;then @@ -457,7 +593,7 @@ then echo "Setting up mysql cli "$conf_mysql_cli_path" without password" fi MYSQL=""$conf_mysql_cli_path - MYSQLSOW=$conf_mysqlshow_cli_path + MYSQLSHOW=$conf_mysqlshow_cli_path else if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "Setting up mysql cli with password" @@ -469,21 +605,55 @@ fi create_tables=$PATH_DTC_SHARED"/admin/tables" +# fix the group id for nobody group +perl -i -p -e "s/65534/$nobodygid/g" $create_tables/*.sql + curdir=`pwd` if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "If not exists, create DTC's database name: "$conf_mysql_db + echo -n "===> Installing or upgrading DTC database: dtc " fi $MYSQL -u$conf_mysql_login -h$conf_mysql_host --execute="CREATE DATABASE IF NOT EXISTS "$conf_mysql_db + if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Creating apachelogs database: apachelogs" + echo -n "===> Checking version of mysql installed..." +fi +# mysql Ver 14.7 Distrib 4.1.20, for pc-linux-gnu (i386) using readline 5.1 +MYSQL_VERSION=`mysql -V` +MYSQL_VER=30 +case $MYSQL_VERSION in + *Distrib\ 3.*) + echo "Found version 3.x ..." + MYSQL_VER=30 + ;; + *Distrib\ 4.0*) + echo "Found version 4.0.x ..." + MYSQL_VER=40 + ;; + *Distrib\ 4.1*) + echo "Found version 4.1.x ..." + MYSQL_VER=41 + ;; + *Distrib\ 5.*) + echo "Found version 5.x ..." + MYSQL_VER=50 + ;; +esac + +if [ ""$MYSQL_VER -gt 40 ]; then + echo "Modifying character set to latin1..." + $MYSQL -u$conf_mysql_login -h$conf_mysql_host --execute="ALTER DATABASE \`$conf_mysql_db\` DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;" +fi + +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo -n " apachelogs" fi $MYSQL -u$conf_mysql_login -h$conf_mysql_host --execute="CREATE DATABASE IF NOT EXISTS apachelogs" +if [ ""$MYSQL_VER -gt 40 ]; then + $MYSQL -u$conf_mysql_login -h$conf_mysql_host --execute="ALTER DATABASE apachelogs DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;" +fi cd $create_tables -if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo -n "DTC is now creating table if not exists: " -fi for i in $( ls *.sql ); do table_name=`echo $i | cut -f1 -d"."` @@ -496,6 +666,12 @@ done if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "done." fi + +# fix some tables for 4.1 +if [ ""$MYSQL_VER -gt 40 ]; then + $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE fetchmail DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;" +fi + #echo $PATH_PHP_CGI $PATH_DTC_ADMIN/restor_db.php -u $conf_mysql_login -h $conf_mysql_host -d $conf_mysql_db $conf_mysql_pass if [ ""$VERBOSE_INSTALL = "yes" ] ;then cd $PATH_DTC_ADMIN; $PATH_PHP_CGI $PATH_DTC_ADMIN/restor_db.php -u $conf_mysql_login -h $conf_mysql_host -d $conf_mysql_db "$conf_mysql_pass" @@ -503,7 +679,7 @@ else cd $PATH_DTC_ADMIN; $PATH_PHP_CGI $PATH_DTC_ADMIN/restor_db.php -u $conf_mysql_login -h $conf_mysql_host -d $conf_mysql_db "$conf_mysql_pass" >/dev/null fi if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Inserting values in mysql for hosting "$main_domain_name + echo "===> Inserting values in mysql for hosting "$main_domain_name fi $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO groups (members) VALUES ('zigo')" $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO admin (adm_login,adm_pass,path) VALUES ('"$conf_adm_login"','"$conf_adm_pass"','"$conf_hosting_path"/"$conf_adm_login"')" @@ -521,17 +697,26 @@ $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE domain SET generate_flag='yes' WHERE name='"$main_domain_name"'" # This one is in case of reinstalltion, so the installer has prority to old values -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET main_site_ip='"$conf_ip_addr"',administrative_site='"$dtc_admin_subdomain"."$main_domain_name"',site_root_host_path='"$conf_hosting_path"',generated_file_path='"$PATH_DTC_ETC"',mta_type='"$conf_mta_type"',main_domain='"$main_domain_name"',404_subdomain='404' WHERE 1" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET main_site_ip='"$conf_ip_addr"',administrative_site='"$dtc_admin_subdomain"."$main_domain_name"',site_root_host_path='"$conf_hosting_path"',generated_file_path='"$PATH_DTC_ETC"',mta_type='"$conf_mta_type"',main_domain='"$main_domain_name"',404_subdomain='404',apache_version='"$conf_apache_version"' WHERE 1" $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE cron_job SET qmail_newu='yes',restart_qmail='yes',gen_qmail='yes',reload_named='yes',restart_apache='yes',gen_vhosts='yes',gen_named='yes' WHERE 1" -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET php_library_path='/usr/lib/php:/tmp:/usr/share/pear:$PATH_DTC_ETC/dtc404' WHERE 1" -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE domain SET ip_addr='"$conf_ip_addr"', generate_flag='yes' WHERE name='"$main_domain_name"'" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET php_library_path='/usr/lib/php:/tmp:/usr/share/pear:$PATH_DTC_ETC/dtc404:/usr/share/php', dtc_system_uid='$CONF_DTC_SYSTEM_UID', dtc_system_username='$CONF_DTC_SYSTEM_USERNAME', dtc_system_gid='$CONF_DTC_SYSTEM_GID',dtc_system_groupname='$CONF_DTC_SYSTEM_GROUPNAME' WHERE 1" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE domain SET ip_addr='"$conf_ip_addr"', generate_flag='yes' WHERE name='"$main_domain_name"'" + +# Fix the rights for the UIDs in tables +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE ftp_access SET uid='$CONF_DTC_SYSTEM_UID',gid='$CONF_DTC_SYSTEM_GID' WHERE 1" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE pop_access SET uid='$CONF_DTC_SYSTEM_UID',gid='$CONF_DTC_SYSTEM_GID' WHERE 1" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE ssh_access SET uid='$CONF_DTC_SYSTEM_UID',gid='$CONF_DTC_SYSTEM_GID' WHERE 1" # Here are some DB maintainance for old DTC versions $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE subdomain CHANGE ip ip VARCHAR(255) DEFAULT 'default' NOT NULL" $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE ftp_access CHANGE homedir homedir VARCHAR(255) DEFAULT '' NOT NULL" $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE pop_access CHANGE crypt crypt VARCHAR(255) DEFAULT '' NOT NULL" $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE pop_access CHANGE passwd passwd VARCHAR(255) DEFAULT '' NOT NULL" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE paiement CHANGE secpay_site secpay_site enum('none', 'paypal', 'worldpay','enets') DEFAULT 'none' NOT NULL" $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE pop_access SET crypt=ENCRYPT(passwd,CONCAT(\"\$1\$\",SUBSTRING(crypt,4,8)))" +# fix size of accounting variables to store more info +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE http_accounting CHANGE bytes_receive bytes_receive BIGINT(14) UNSIGNED NOT NULL DEFAULT '0'" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER TABLE http_accounting CHANGE bytes_sent bytes_sent BIGINT(14) UNSIGNED NOT NULL DEFAULT '0'" # Add dtc userspace info to mysql db if it's not there TMP_FILE=`${MKTEMP} dtc_downer_grep.XXXXXXXX` || exit 1 @@ -566,7 +751,7 @@ if ! grep fullemail ${TMP_FILE} 2>&1 >/dev/null ;then if $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="ALTER IGNORE TABLE pop_access ADD fullemail varchar (255) DEFAULT 'none' NOT NULL" ; then echo "plop !" fi - $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE pop_access SET fullemail = concat( id, \"@\", mbox_host )" + $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE pop_access SET fullemail = concat( \`id\`, '@', \`mbox_host\` )" fi if [ -e ${TMP_FILE} ] ;then rm ${TMP_FILE} @@ -595,35 +780,48 @@ $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE mysql.user SET Password=PASSWORD('"${MYSQL_DTCDAEMONS_PASS}"') WHERE User='dtcdaemons'" # grant Select,Insert,Update,Delete,References,Index to ftp_access -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'ftp_access', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', 'Select')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'ftp_access', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', 'Select')" # grant Select,Insert,Update,Delete,References,Index to ftp_access -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'groups', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', 'Select')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'groups', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', 'Select')" # grant Select,Insert,Update,Delete,References,Index to ftp_logs -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'ftp_logs', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', '')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'ftp_logs', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', '')" # grant Select,Insert,Update,Delete,References,Index to ftp_accounting -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'ftp_accounting', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', '')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'ftp_accounting', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', '')" + +# grant Select,Insert,Update,Delete,References,Index to http_accounting +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'http_accounting', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', '')" # grant all to apachelogs $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv) VALUES ('localhost', 'apachelogs', 'dtcdaemons', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'Y', 'Y', 'Y')" # grant select to pop_access -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'pop_access', '', NOW(NULL), 'Select,Update', 'Select,Update')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'pop_access', '', NOW(NULL), 'Select,Update', 'Select,Update')" # update in case of old installations -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE IGNORE mysql.tables_priv SET Timestamp = NOW(NULL) , Table_priv = 'Select,Update', Column_priv = 'Select,Update' WHERE Host = 'localhost' AND Db = 'dtc' AND User = 'dtcdaemons' AND Table_name = 'pop_access' LIMIT 1 " +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE IGNORE mysql.tables_priv SET Timestamp = NOW(NULL) , Table_priv = 'Select,Update', Column_priv = 'Select,Update' WHERE Host = 'localhost' AND Db = '"$conf_mysql_db"' AND User = 'dtcdaemons' AND Table_name = 'pop_access' LIMIT 1 " #$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="GRANT SELECT , UPDATE ( crypt , passwd ) ON dtc.pop_access TO 'dtcdaemons'@'localhost'" +# grant select to ssh_access +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'ssh_access', '', NOW(NULL), 'Select,Update', 'Select,Update')" +# grant select to ssh_groups +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'ssh_groups', '', NOW(NULL), 'Select,Update', 'Select,Update')" +# grant select to ssh_user_group +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'ssh_user_group', '', NOW(NULL), 'Select,Update', 'Select,Update')" + +# populate some data into the ssh_groups table, so that it works correctly +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO ssh_groups (group_id, group_name, status, group_password, gid) VALUES (NULL, 'root', 'A', 'x', 0), (NULL, 'nobody', 'A', 'x', 99), (NULL, 'nobody', 'A', 'x', 65534);" + # grant Select,Insert,Update,Delete,References,Index to smtp_logs -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'smtp_logs', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', '')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'smtp_logs', '', NOW(NULL), 'Select,Insert,Update,Delete,References,Index', '')" # grant select to whitelist -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'whitelist', '', NOW(NULL), 'Select', 'Select')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'whitelist', '', NOW(NULL), 'Select', 'Select')" # grant select to fetchmail -$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', 'dtc', 'dtcdaemons', 'fetchmail', '', NOW(NULL), 'Select', 'Select')" +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO mysql.tables_priv (Host, Db, User, Table_name, Grantor, Timestamp, Table_priv, Column_priv) VALUES ('localhost', '"$conf_mysql_db"', 'dtcdaemons', 'fetchmail', '', NOW(NULL), 'Select', 'Select')" $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="FLUSH PRIVILEGES" @@ -632,12 +830,30 @@ $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE # Add the config for nated vhosts if needed if [ ""$conf_use_nated_vhosts = "yes" ] ;then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Setting-up values in MySQL for using NAT" + fi $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET use_nated_vhost='yes'" - $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET nated_vhost_ip='"${nated_vhost_ip}"'" + $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET nated_vhost_ip='"${conf_nated_vhosts_ip}"'" + $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET use_multiple_ip='no'" else + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Setting-up values in MySQL NOT using NAT" + fi $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET use_nated_vhost='no'" fi +# Set the value to use SSL directly... +if [ ""$conf_gen_ssl_cert = "true" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Adding the use of SSL directly!" + fi + $MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="UPDATE config SET use_ssl='yes'" +fi + +# Insert the cyrus user so we can use cyradm +$MYSQL -u$conf_mysql_login -h$conf_mysql_host -D$conf_mysql_db --execute="INSERT IGNORE INTO pop_access (id,fullemail,passwd,crypt) VALUES('cyrus','cyrus','"${MYSQL_DTCDAEMONS_PASS}"',ENCRYPT('"${MYSQL_DTCDAEMONS_PASS}"'))" + # The panel needs root access (it does database management) echo " $PATH_DTC_SHARED"/shared/mysql_config.php" echo "\$conf_mysql_host=\""$conf_mysql_host"\";" >> $PATH_DTC_SHARED"/shared/mysql_config.php" @@ -648,38 +864,14 @@ echo "\$conf_mysql_conf_ok=\"yes\";" >> $PATH_DTC_SHARED"/shared/mysql_config.ph echo "?>" >> $PATH_DTC_SHARED"/shared/mysql_config.php" cd $curdir -#!/bin/sh - -# this chroot creation script will only work for debian testing -# please modify this for your particular distribution/OS -# Damien Mascord - -# Added support for Debian stable and integrate it in install -# script for all OS (path needs to be checked for BSD and RedHat... -# so this script is for the moment UNTESTED) -# Thomas GOIRAND - -# first check to see if we have the correct command line settings -#if [ "$1" = "" ] -#then -# echo "Usage: $0 " -# exit 1 -#fi - -# assign our variables CHROOT_DIR=$conf_chroot_path -WEB_USER=nobody +WEB_USER=${CONF_DTC_SYSTEM_USERNAME} +WEB_GROUP=${CONF_DTC_SYSTEM_GROUPNAME} if [ $CHROOT_DIR"" = "" ] ; then CHROOT_DIR=/var/www/chroot fi -if [ $UNIX_TYPE"" = "freebsd" ] ; then - WEB_GROUP=nobody -else - WEB_GROUP=nogroup -fi - if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Creating chroot tree in "$CHROOT_DIR fi @@ -692,73 +884,122 @@ mkdir -p $CHROOT_DIR cd $CHROOT_DIR # create directory structure -mkdir -p etc dev bin lib tmp var/tmp var/run sbin +mkdir -p etc dev bin lib tmp var/tmp var/run sbin libexec mkdir -p usr/bin usr/lib usr/libexec usr/share usr/lib/zoneinfo # make devices - adjust MAJOR/MINOR as appropriate ( see ls -l /dev/* ) -if ! [ -e dev/null ] -then - if [ $UNIX_TYPE"" = "freebsd" -o $UNIX_TYPE"" = "osx" ]; - then - mknod dev/null c 2 2 # FreeBSD? - else - mknod dev/null c 1 3 # Linux +if ! [ ""$conf_omit_dev_mknod = "yes" ] ; then + if ! [ -e dev/null ] ; then + if [ $UNIX_TYPE"" = "freebsd" -o $UNIX_TYPE"" = "osx" ] ; then + mknod dev/null c 2 2 # FreeBSD? + else + mknod dev/null c 1 3 # Linux + fi fi -fi -if [ $UNIX_TYPE"" = "freebsd" -o $UNIX_TYPE"" = "osx" ] ; then - if [ $kernel"" = "OpenBSD" ] ; then - if ! [ -e dev/urandom ] ; then - mknod dev/urandom c 45 2 # OpenBSD ? + if [ $UNIX_TYPE"" = "freebsd" -o $UNIX_TYPE"" = "osx" ] ; then + if [ $kernel"" = "OpenBSD" ] ; then + if ! [ -e dev/urandom ] ; then + mknod dev/urandom c 45 2 # OpenBSD ? + fi + else + if ! [ -e dev/random ] ; then + mknod dev/random c 2 3 # FreeBSD + fi + if ! [ -e dev/urandom ] ; then + mknod dev/urandom c 2 3 + fi fi else if ! [ -e dev/random ] ; then - mknod dev/random c 2 3 # FreeBSD + mknod dev/random c 1 8 # Linux fi if ! [ -e dev/urandom ] ; then - mknod dev/urandom c 2 3 + mknod dev/urandom c 1 9 # Linux fi fi -else - if ! [ -e dev/random ] ; then - mknod dev/random c 1 8 # Linux - fi - if ! [ -e dev/urandom ] ; then - mknod dev/urandom c 1 9 # Linux - fi -fi -# some external programs may need these: -if [ $UNIX_TYPE"" = "freebsd" -o $UNIX_TYPE"" = "osx" ] ; then - if ! [ -e dev/stdin ] ; then - mknod dev/stdin c 22 0 # FreeBSD, OpenBSD - fi - if ! [ -e dev/stdout ] ; then - mknod dev/stdout c 22 1 # FreeBSD, OpenBSD - fi - if ! [ -e dev/stderr ] ; then - mknod dev/stderr c 22 2 # FreeBSD, OpenBSD + # some external programs may need these: + if [ $UNIX_TYPE"" = "freebsd" -o $UNIX_TYPE"" = "osx" ] ; then + if ! [ -e dev/stdin ] ; then + mknod dev/stdin c 22 0 # FreeBSD, OpenBSD + fi + if ! [ -e dev/stdout ] ; then + mknod dev/stdout c 22 1 # FreeBSD, OpenBSD + fi + if ! [ -e dev/stderr ] ; then + mknod dev/stderr c 22 2 # FreeBSD, OpenBSD + fi fi fi # copy required binaries to $CHROOT_DIR/usr/bin and $CHROOT_DIR/bin -if [ $UNIX_TYPE"" = "gentoo" ] ; then +if [ -e /bin/bzip2 ] ; then cp -pf /bin/bzip2 usr/bin/ -else +fi +if [ -e /usr/bin/bzip2 ] ; then cp -pf /usr/bin/bzip2 usr/bin/ fi - -cp -pf /usr/bin/file usr/bin/ - -if [ $UNIX_TYPE"" = "freebsd" -o $UNIX_TYPE"" = "osx" ] ; then - cp -pf /usr/bin/cpio usr/bin - cp -pf /usr/bin/gunzip /usr/bin/false /usr/bin/su bin/ -else - cp -pf /bin/gunzip /usr/bin/zip /bin/false /bin/su bin/ - cp -pf /bin/cpio usr/bin +if [ -e /usr/bin/file ] ; then + cp -pf /usr/bin/file usr/bin/ fi -# copy required binaries to $CHROOT_DIR/bin +if [ $UNIX_TYPE"" = "freebsd" ] ; then + cp -pf /usr/bin/cpio usr/bin + cp -pf /libexec/ld-elf.so.1 libexec + cp -pf /bin/rm /bin/mv /usr/bin/gunzip /usr/bin/tar /usr/bin/false bin/ +elif [ $UNIX_TYPE"" = "osx" ] ; then + cp -pf /usr/bin/cpio usr/bin + cp -pf /usr/bin/rm /usr/bin/mv /usr/bin/gunzip /usr/bin/tar /usr/bin/false bin/ +else + cp -pf /bin/rm /bin/mv /bin/gunzip bin/ + cp -pf /bin/cpio usr/bin +fi +# copy zip and unzip if they are present +if [ -e /usr/bin/zip ] ; then + cp -pf /usr/bin/zip bin/ +fi +if [ -e /usr/bin/unzip ] ; then + cp -pf /usr/bin/unzip bin/ +fi + +if [ -e /bin/bash ] ; then + cp -pf /bin/bash bin +fi +if [ -e /usr/bin/bash ] ; then + cp -pf /usr/bin/bash bin +fi +if [ -e /usr/bin/tar ]; then + cp -pf /usr/bin/tar bin +fi +if [ -e /bin/tar ]; then + cp -pf /bin/tar bin +fi +if [ -e /usr/bin/false ]; then + cp -pf /usr/bin/false bin +fi +if [ -e /bin/false ]; then + cp -pf /bin/false bin +fi + +if [ -e /usr/bin/sftp ]; then + cp -pf /usr/bin/sftp bin/ +fi + +# the sftp-server binary can be in /usr/lib or /lib, so check both places +if [ -e /usr/lib/sftp-server ]; then + cp -pf /usr/lib/sftp-server usr/lib/ +fi + +if [ -e /lib/sftp-server ]; then + cp -pf /lib/sftp-server lib/ +fi + +if [ -e /usr/bin/scp ]; then + cp -pf /usr/bin/scp bin/ +fi + +# copy more required binaries to $CHROOT_DIR/bin cp -pf /bin/sh /bin/echo /bin/ls /bin/pwd /bin/cat bin/ # copy ldconfig from sbin to $CHROOT_DIR/sbin @@ -768,7 +1009,40 @@ fi # copy needed /etc files to $CHROOT_DIR/etc cp -pf /etc/protocols /etc/services /etc/hosts \ - /etc/group /etc/passwd /etc/resolv.conf etc/ + /etc/resolv.conf etc/ + +# generate /etc/passwd and /etc/group +# ignore errors +set +e +grep daemon /etc/passwd > etc/passwd +grep bin /etc/passwd >> etc/passwd +grep sys /etc/passwd >> etc/passwd +grep man /etc/passwd >> etc/passwd +grep lp /etc/passwd >> etc/passwd +grep mail /etc/passwd >> etc/passwd +grep news /etc/passwd >> etc/passwd +grep uucp /etc/passwd >> etc/passwd +grep www-data /etc/passwd >> etc/passwd +# generate this one manually: grep nobody /etc/passwd >> etc/passwd +grep daemon /etc/group > etc/group +grep bin /etc/group >> etc/group +grep sys /etc/group >> etc/group +grep man /etc/group >> etc/group +grep lp /etc/group >> etc/group +grep mail /etc/group >> etc/group +grep news /etc/group >> etc/group +grep uucp /etc/group >> etc/group +grep www-data /etc/group >> etc/group +grep ${CONF_DTC_SYSTEM_GROUPNAME} /etc/group >> etc/group +grep ${CONF_DTC_SYSTEM_USERNAME} /etc/group >> etc/group +set -e + +# fix entry for nobody in /etc/passwd +echo "${CONF_DTC_SYSTEM_USERNAME}:x:${CONF_DTC_SYSTEM_UID}:${CONF_DTC_SYSTEM_GID}:${CONF_DTC_SYSTEM_USERNAME}:/html:/bin/bash" >> etc/passwd + +# create shadow account line for nobody +echo "${CONF_DTC_SYSTEM_USERNAME}::12719:0:99999:7:::" > etc/shadow +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} etc/shadow if [ -e /etc/host.conf ] ; then cp -pf /etc/host.conf etc/ @@ -810,11 +1084,50 @@ else mkdir usr/lib/system cp -pf /usr/lib/system/libmathCommon.A.dylib usr/lib/system else + FOUNDED_ARCH=`uname -m` + if [ ""$FOUNDED_ARCH = "x86_64" ] ; then + if [ ! -e lib64 ]; then + ln -s lib lib64 + fi + fi + if [ -e /lib/ld-linux.so.2 ] ; then + cp -pf /lib/ld-linux.so.2 lib/ + fi + if [ -e /lib/ld-linux-x86-64.so.2 ] ; then + cp -pf /lib/ld-linux-x86-64.so.2 lib/ + fi cp -pf /lib/libdl.so.2 /lib/libm.so.6 /lib/libpthread.so.0 \ - /lib/libc.so.6 /lib/libcrypt.so.1 /lib/ld-linux.so.2 \ - /lib/libncurses.so.5 \ + /lib/libc.so.6 /lib/libcrypt.so.1 \ /lib/librt.so.1 \ + /lib/libnss_compat.so.2 /lib/libnsl.so.1 /lib/libnss_files.so.2 \ /lib/libpam.so.0 /lib/libpam_misc.so.0 lib/ + + if [ -e /lib/libncurses.so.5 ]; then + cp /lib/libncurses.so.5 lib/ + fi + + if [ -e /usr/lib/libncurses.so.5 ]; then + cp /usr/lib/libncurses.so.5 lib/ + fi + + if [ -e /lib/libacl.so.1 ]; then + cp /lib/libacl.so.1 lib/ + fi + + if [ -e /lib/libattr.so.1 ]; then + cp /lib/libattr.so.1 lib/ + fi + + if [ -e /lib/libcap.so.1 ]; then + cp /lib/libcap.so.1 lib/ + fi + + if [ -e /lib/libbz2.so.1.0 ]; then + cp /lib/libbz2.so.1.0 lib/ + fi + if [ -e /usr/lib/libbz2.so.1.0 ]; then + cp /usr/lib/libbz2.so.1.0 lib/ + fi if [ -e /usr/lib/libmagic.so.1 ] then cp -pf /usr/lib/libmagic.so.1 lib/ @@ -824,6 +1137,24 @@ else else cp -pf /usr/lib/libz.so.1 lib/ fi + + # libs for sftp and scp + + if [ -e /lib/libresolv.so.2 ]; then + cp -pf /lib/libresolv.so.2 lib/ + fi + + if [ -e /usr/lib/libcrypto.so.0.9.7 ]; then + cp -pf /usr/lib/libcrypto.so.0.9.7 lib/ + fi + + if [ -e /usr/lib/libcrypto.so.0.9.8 ]; then + cp -pf /usr/lib/libcrypto.so.0.9.8 lib/ + fi + + if [ -e /lib/libutil.so.1 ]; then + cp -pf /lib/libutil.so.1 lib/ + fi fi fi @@ -838,25 +1169,97 @@ then #cp -pf /usr/share/magic usr/share/ fi +# No need anymore - fix up pam.d into jail +# if [ -e /etc/pam.d ]; then +# mkdir -p ./etc/pam.d/ +# cp /etc/pam.d/* ./etc/pam.d/ +# fi +# No need anymore - copy PAM-Modules to jail +#if [ -e /lib/security ]; then + #cp -r /lib/security ./lib/ +#fi +#if [ -e /etc/security ]; then +# cp -r /etc/security ./etc/ +#fi +if [ -e /etc/login.defs ]; then + cp /etc/login.defs ./etc/ +fi + +# now we have come this far, make sure our chroot includes enough libs for this environment +LDD=`which ldd` +if [ -n "$LDD" ]; then + +for i in bin/*; +do + for j in `$LDD $i | cut -f 1 -d' '`; + do + if [ -e $j ]; then + cp -pf $j lib/ + fi + + if [ -e /lib/$j ]; then + cp -pf /lib/$j lib/ + fi + + if [ -e /usr/lib/$j ]; then + cp -pf /usr/lib/$j lib/ + fi + + if [ -e /usr/local/lib/$j ]; then + cp -pf /usr/local/lib/$j lib/ + fi + done +done + + +fi + +# if we have a sudo binary around, then use it to create our chroot shell +SUDO=`which sudo` +if [ -n "$SUDO" ] ; then + # create a chroot shell script + echo "Creating chroot shell script..." + SHELL=/bin/dtc-chroot-shell + echo '#!/bin/sh' > $SHELL + echo "`which sudo` -H `which chroot` \$HOME /bin/su - \$USER" \"\$@\" >> $SHELL + chmod 755 $SHELL + # fix sudoers + # fix /etc/shells +fi + # set protections chmod 1770 tmp chmod 1770 var/tmp -chmod 666 dev/null -chmod 644 dev/*random +if ! [ ""$conf_omit_dev_mknod = "yes" ] ; then + chmod 666 dev/null + chmod 644 dev/*random +fi #now need to copy over the perl binary and some modules cp -pf /usr/bin/perl usr/bin/ -if ! [ $UNIX_TYPE"" = "osx" ] ;then - # now create our ld.so cache - chroot $CHROOT_DIR ./sbin/ldconfig - # just in case we have wiped our /etc/ld.so.cache (run locally) - /sbin/ldconfig +if [ $UNIX_TYPE"" = "freebsd" ] ;then + # now create our ld.so cache + cp /libexec/ld-elf.so.1 $CHROOT_DIR/libexec + chroot $CHROOT_DIR ./sbin/ldconfig + # just in case we have wiped our /etc/ld.so.cache (run locally) + /sbin/ldconfig +else + if ! [ $UNIX_TYPE"" = "osx" ] ;then + # now create our ld.so cache + mkdir -p $CHROOT_DIR/etc + touch $CHROOT_DIR/etc/ld.so.cache + touch $CHROOT_DIR/etc/ld.so.conf + chroot $CHROOT_DIR ./sbin/ldconfig + # just in case we have wiped our /etc/ld.so.cache (run locally) + /sbin/ldconfig + fi fi # Multi OS (Unix system) install sh script for DTC # Written by Thomas GOIRAND +# Cyrus modifications by Cristian Livadaru # under LGPL Licence # The configuration for all thoses variables must be written BEFORE this @@ -879,7 +1282,7 @@ fi # so it works automaticaly even without Tucows API # -# VERBOSE_INSTALL=yes +#VERBOSE_INSTALL=yes # We are just after the creation of the chroot tree, so it's time to copy it over # our newly created vhosts dirs (in update mode) @@ -888,33 +1291,193 @@ if [ -z ""$MYSQL_DB_SOCKET_PATH ] ;then MYSQL_DB_SOCKET_PATH="/var/run/mysqld/mysqld.sock" fi - # Copy newly created chroot tree to the 3 vhosts created with this installer (mx and ns don't have apache vhosts generated) if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo -n "===> Adding chroot environment to www."$main_domain_name + echo -n "===> Installing chroot file environment for www."$main_domain_name fi -cp -fupR $conf_chroot_path $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/www/" +cp -fpR $conf_chroot_path/* $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/www/" if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo -n " "$dtc_admin_subdomain"."$main_domain_name fi -cp -fupR $conf_chroot_path $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/404" +cp -fpR $conf_chroot_path/* $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/404" if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo -n " 404."$main_domain_name fi -cp -fupR $conf_chroot_path $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/"$dtc_admin_subdomain +cp -fpR $conf_chroot_path/* $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/"$dtc_admin_subdomain + +# symlink directories so that users can login with ssh to the admin account directory +if [ ! -e $conf_hosting_path/$conf_adm_login/bin ]; then ln -s $main_domain_name/subdomains/www/bin $conf_hosting_path/$conf_adm_login/bin; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/var ]; then ln -s $main_domain_name/subdomains/www/var $conf_hosting_path/$conf_adm_login/var; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/lib ]; then ln -s $main_domain_name/subdomains/www/lib $conf_hosting_path/$conf_adm_login/lib; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/sbin ]; then ln -s $main_domain_name/subdomains/www/sbin $conf_hosting_path/$conf_adm_login/sbin; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/tmp ]; then ln -s $main_domain_name/subdomains/www/tmp $conf_hosting_path/$conf_adm_login/tmp; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/usr ]; then ln -s $main_domain_name/subdomains/www/usr $conf_hosting_path/$conf_adm_login/usr; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/dev ]; then ln -s $main_domain_name/subdomains/www/dev $conf_hosting_path/$conf_adm_login/dev; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/etc ]; then ln -s $main_domain_name/subdomains/www/etc $conf_hosting_path/$conf_adm_login/etc; fi +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/bin +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/var +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/lib +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/sbin +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/tmp +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/usr +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/dev +chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/etc + +# also, so the user can login to the main domain names base directory +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/bin ]; then ln -s subdomains/www/bin $conf_hosting_path/$conf_adm_login/$main_domain_name/bin; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/var ]; then ln -s subdomains/www/var $conf_hosting_path/$conf_adm_login/$main_domain_name/var; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/lib ]; then ln -s subdomains/www/lib $conf_hosting_path/$conf_adm_login/$main_domain_name/lib; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/sbin ]; then ln -s subdomains/www/sbin $conf_hosting_path/$conf_adm_login/$main_domain_name/sbin; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/tmp ]; then ln -s subdomains/www/tmp $conf_hosting_path/$conf_adm_login/$main_domain_name/tmp; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/usr ]; then ln -s subdomains/www/usr $conf_hosting_path/$conf_adm_login/$main_domain_name/usr; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/dev ]; then ln -s subdomains/www/dev $conf_hosting_path/$conf_adm_login/$main_domain_name/dev; fi +if [ ! -e $conf_hosting_path/$conf_adm_login/$main_domain_name/etc ]; then ln -s subdomains/www/etc $conf_hosting_path/$conf_adm_login/$main_domain_name/etc; fi + +set +e + +nobodygroup=`cat /etc/group | cut -f 1 -d: | grep ^nobody` +# if we can't find the nobody group, try nogroup +if [ -z ""$nobodygroup ]; then + nobodygroup=`cat /etc/group | cut -f 1 -d: | grep ^nogroup` +fi +# if we can't find nogroup, then set to 65534 +if [ -z ""$nobodygroup ]; then + nobodygroup=65534 +fi + +nobodygid=`cat /etc/group | grep ^nobody | cut -f 3 -d:` +# if we can't find the nobody group, try nogroup +if [ -z ""$nobodygid ]; then + nobodygid=`cat /etc/group | grep ^nogroup | cut -f 3 -d:` +fi +# if we can't find nogroup, then set to 65534 +if [ -z ""$nobodygid ]; then + nobodygid=65534 +fi + + +set -e if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo chown -R nobody:65534 $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains" + echo "chown -R ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/$main_domain_name/subdomains" fi -chown -R nobody:65534 $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains" +chown -R ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $conf_hosting_path/$conf_adm_login/$main_domain_name/subdomains +# if we have a sudo binary around, then use it to create our chroot shell +# check for some path defaults... +if [ -z "$PATH_SUDO" ]; then + PATH_SUDO=`which sudo` +fi +if [ -z "$PATH_CHROOT" ]; then + PATH_CHROOT=`which chrootuid` +fi +if [ -z "$PATH_SHELLS_CONF" ]; then + PATH_SHELLS_CONF=/etc/shells +fi +if [ -z "$PATH_SUDOERS_CONF" ]; then + PATH_SUDOERS_CONF=/etc/sudoers +fi +if [ -n "$PATH_SUDO" ] ; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then + echo "Creating chroot shell..." + fi + # create a chroot shell script + CHROOT_SHELL=/bin/dtc-chroot-shell + echo '#!/bin/sh' > $CHROOT_SHELL + echo "# This shell script is used by DTC, please do not remove" >> $CHROOT_SHELL + echo "$PATH_SUDO -H $PATH_CHROOT \$HOME \$USER" /bin/bash \"\$@\" >> $CHROOT_SHELL + chmod 755 $CHROOT_SHELL + # fix sudoers + if grep "Configured by DTC" $PATH_SUDOERS_CONF >/dev/null + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$PATH_SUDOERS_CONF has been configured before..." + fi + else + if ! [ -f $PATH_SUDOERS_CONF.DTC.backup ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Backuping "$PATH_SUDOERS_CONF + fi + cp -f "$PATH_SUDOERS_CONF" "$PATH_SUDOERS_CONF.DTC.backup" + fi + TMP_FILE=`${MKTEMP} DTC_install.sudoers.XXXXXX` || exit 1 + echo "# Configured by DTC 0.21 : please do not touch this line !" >> $TMP_FILE + echo "Defaults:${CONF_DTC_SYSTEM_USERNAME} !set_logname" >> $TMP_FILE + echo "${CONF_DTC_SYSTEM_USERNAME} ALL= NOPASSWD: $PATH_CHROOT *" >> $TMP_FILE + echo "# End of DTC configuration : please don't touch this line !" >> $TMP_FILE + cat <$TMP_FILE >>$PATH_SUDOERS_CONF + fi + # fix /etc/shells + if grep "Configured by DTC" $PATH_SHELLS_CONF >/dev/null + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$PATH_SHELLS_CONF has been configured before..." + fi + else + if ! [ -f $PATH_SHELLS_CONF.DTC.backup ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Backuping "$PATH_SHELLS_CONF + fi + cp -f "$PATH_SHELLS_CONF" "$PATH_SHELLS_CONF.DTC.backup" + fi + TMP_FILE=`${MKTEMP} DTC_install.shells.XXXXXX` || exit 1 + echo "# Configured by DTC 0.21 : please do not touch this line !" >> $TMP_FILE + echo "/bin/dtc-chroot-shell" >> $TMP_FILE + echo "# End of DTC configuration : please don't touch this line !" >> $TMP_FILE + cat <$TMP_FILE >>$PATH_SHELLS_CONF + rm $TMP_FILE + fi +fi if ! [ -f $PATH_DTC_SHARED/shared/securepay/paiement_config.php ] ; then cp -v $PATH_DTC_SHARED/shared/securepay/RENAME_ME_paiement_config.php $PATH_DTC_SHARED/shared/securepay/paiement_config.php fi +# +# Modify the php.ini to increase memory limits +# +if ! [ -z ""$PATH_PHP_INI_APACHE ] ; then + searchAndReplace $PATH_PHP_INI_APACHE memory_limit\ =\ 8M memory_limit\ =\ 64M + searchAndReplace $PATH_PHP_INI_APACHE memory_limit\ =\ 16M memory_limit\ =\ 64M +fi +if ! [ -z ""$PATH_PHP_INI_APACHE2 ] ; then + searchAndReplace $PATH_PHP_INI_APACHE2 memory_limit\ =\ 8M memory_limit\ =\ 64M + searchAndReplace $PATH_PHP_INI_APACHE2 memory_limit\ =\ 16M memory_limit\ =\ 64M +fi +if ! [ -z ""$PATH_PHP_INI_CLI ] ; then + searchAndReplace $PATH_PHP_INI_CLI max_execution_time\ =\ 30 max_execution_time\ =\ 1200 + searchAndReplace $PATH_PHP_INI_CLI memory_limit\ =\ 8M memory_limit\ =\ 64M + searchAndReplace $PATH_PHP_INI_CLI memory_limit\ =\ 16M memory_limit\ =\ 64M +fi + +if [ -e /etc/php5/apache/php.ini ] ; then + searchAndReplace /etc/php5/apache/php.ini max_execution_time\ =\ 30 max_execution_time\ =\ 1200 + searchAndReplace /etc/php5/apache/php.ini memory_limit\ =\ 8M memory_limit\ =\ 64M + searchAndReplace /etc/php5/apache/php.ini memory_limit\ =\ 16M memory_limit\ =\ 64M +fi + +if [ -e /etc/php5/apache2/php.ini ] ; then + searchAndReplace /etc/php5/apache2/php.ini max_execution_time\ =\ 30 max_execution_time\ =\ 1200 + searchAndReplace /etc/php5/apache2/php.ini memory_limit\ =\ 8M memory_limit\ =\ 64M + searchAndReplace /etc/php5/apache2/php.ini memory_limit\ =\ 16M memory_limit\ =\ 64M +fi + +if [ -e /etc/php4/apache/php.ini ] ; then + searchAndReplace /etc/php4/apache/php.ini max_execution_time\ =\ 30 max_execution_time\ =\ 1200 + searchAndReplace /etc/php4/apache/php.ini memory_limit\ =\ 8M memory_limit\ =\ 64M + searchAndReplace /etc/php4/apache/php.ini memory_limit\ =\ 16M memory_limit\ =\ 64M +fi + +if [ -e /etc/php4/apache2/php.ini ] ; then + searchAndReplace /etc/php4/apache2/php.ini max_execution_time\ =\ 30 max_execution_time\ =\ 1200 + searchAndReplace /etc/php4/apache2/php.ini memory_limit\ =\ 8M memory_limit\ =\ 64M + searchAndReplace /etc/php4/apache2/php.ini memory_limit\ =\ 16M memory_limit\ =\ 64M +fi + # # Include $PATH_DTC_ETC/vhosts.conf in $PATH_HTTPD_CONF # @@ -930,7 +1493,11 @@ HTTPD_MODULES_CONFIG=/usr/sbin/apache-modconf # if apacheconfig is a symlink (deprecated), then use modules-config if [ -f $HTTPD_MODULES_CONFIG ] then - HTTPD_MODULES_CONFIG="$HTTPD_MODULES_CONFIG apache" + if [ ""$conf_apache_version = "2" ] ; then + HTTPD_MODULES_CONFIG="$HTTPD_MODULES_CONFIG apache2" + else + HTTPD_MODULES_CONFIG="$HTTPD_MODULES_CONFIG apache" + fi else HTTPD_MODULES_CONFIG="" fi @@ -965,199 +1532,246 @@ else echo "=> Verifying User and Group directive" fi + # This is from upgrades from older versions using nobody + if grep "User nobody" $PATH_HTTPD_CONF >/dev/null 2>&1 + then + echo "User nobody -> User ${CONF_DTC_SYSTEM_USERNAME}" + sed "s/User nobody/User ${CONF_DTC_SYSTEM_USERNAME}/" $PATH_HTTPD_CONF >$TMP_FILE + cat <$TMP_FILE >$PATH_HTTPD_CONF + fi + if grep "Group nogroup" $PATH_HTTPD_CONF >/dev/null 2>&1 + then + echo "Group nobody -> User ${CONF_DTC_SYSTEM_GROUPNAME}" + sed "s/Group nogroup/Group ${CONF_DTC_SYSTEM_GROUPNAME}/" $PATH_HTTPD_CONF >$TMP_FILE + cat <$TMP_FILE >$PATH_HTTPD_CONF + fi + # Those 2 are for debian if grep "User www-data" $PATH_HTTPD_CONF >/dev/null 2>&1 then - echo "User www-data -> User nobody" - sed "s/User www-data/User nobody/" $PATH_HTTPD_CONF >$TMP_FILE + echo "User www-data -> User ${CONF_DTC_SYSTEM_USERNAME}" + sed "s/User www-data/User ${CONF_DTC_SYSTEM_USERNAME}/" $PATH_HTTPD_CONF >$TMP_FILE cat <$TMP_FILE >$PATH_HTTPD_CONF fi if grep "Group www-data" $PATH_HTTPD_CONF >/dev/null 2>&1 then - echo "Group www-data -> Group nogroup" - sed "s/Group www-data/Group nogroup/" $PATH_HTTPD_CONF >$TMP_FILE + echo "Group www-data -> Group ${CONF_DTC_SYSTEM_GROUPNAME}" + sed "s/Group www-data/Group ${CONF_DTC_SYSTEM_GROUPNAME}/" $PATH_HTTPD_CONF >$TMP_FILE cat <$TMP_FILE >$PATH_HTTPD_CONF fi # Those 2 are for BSD if grep "User www" $PATH_HTTPD_CONF >/dev/null 2>&1 then - echo "User www -> User nobody" - sed "s/User www/User nobody/" $PATH_HTTPD_CONF >$TMP_FILE + echo "User www -> User ${CONF_DTC_SYSTEM_USERNAME}" + sed "s/User www/User ${CONF_DTC_SYSTEM_USERNAME}/" $PATH_HTTPD_CONF >$TMP_FILE cat <$TMP_FILE >$PATH_HTTPD_CONF fi if grep "Group www" $PATH_HTTPD_CONF >/dev/null 2>&1 then - echo "Group www -> Group nobody" - sed "s/Group www/Group nobody/" $PATH_HTTPD_CONF >$TMP_FILE + echo "Group www -> Group ${CONF_DTC_SYSTEM_GROUPNAME}" + sed "s/Group www/Group ${CONF_DTC_SYSTEM_GROUPNAME}/" $PATH_HTTPD_CONF >$TMP_FILE cat <$TMP_FILE >$PATH_HTTPD_CONF fi # Those 2 are for RedHat if grep "User apache" $PATH_HTTPD_CONF >/dev/null 2>&1 then - echo "User apache -> User nobody" - sed "s/User apache/User nobody/" $PATH_HTTPD_CONF >$TMP_FILE + echo "User apache -> User ${CONF_DTC_SYSTEM_USERNAME}" + sed "s/User apache/User ${CONF_DTC_SYSTEM_USERNAME}/" $PATH_HTTPD_CONF >$TMP_FILE cat <$TMP_FILE >$PATH_HTTPD_CONF fi if grep "Group apache" $PATH_HTTPD_CONF >/dev/null 2>&1 then - echo "Group apache -> Group nobody" - sed "s/Group apache/Group nobody/" $PATH_HTTPD_CONF >$TMP_FILE + echo "Group apache -> Group ${CONF_DTC_SYSTEM_GROUPNAME}" + sed "s/Group apache/Group ${CONF_DTC_SYSTEM_GROUPNAME}/" $PATH_HTTPD_CONF >$TMP_FILE cat <$TMP_FILE >$PATH_HTTPD_CONF fi - if [ "$UNIX_TYPE" = "debian" -o "$UNIX_TYPE" = "osx" ] - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "=> Checking apache modules" - echo -n "Checking for php4..." - fi - # first of all, may as well try to use the provided modules-config or apacheconfig provided by debian... - # else use the normal method to be cross platform compatible +# if [ "$UNIX_TYPE" = "debian" -o "$UNIX_TYPE" = "osx" ] +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo "=> Checking apache modules" +# echo -n "Checking for php4..." +# fi +# # first of all, may as well try to use the provided modules-config or apacheconfig provided by debian... +# # else use the normal method to be cross platform compatible +# +# if [ "$HTTPD_MODULES_CONFIG" = "" ] +# then +# # need to support modules.conf version of apache debian package +# # default to normal HTTPD_CONF +# PATH_HTTPD_CONF_TEMP=$PATH_HTTPD_CONF +# if [ -f $PATH_HTTPD_MODULES_CONF ] +# then +# PATH_HTTPD_CONF_TEMP=$PATH_HTTPD_MODULES_CONF +# fi +# if grep -i "# LoadModule php4_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo "found commented: activating php4 module!" +# fi +# sed "s/# LoadModule php4_module/LoadModule php4_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE +# cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP +# else +# if grep -i "LoadModule php4_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo " ok!" +# fi +# else +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo "php4 missing! please install it or run apacheconfig!!!" +# fi +# exit 1 +# fi +# fi +# else +# if [ ""$conf_apache_version = "2" ] ; then +# echo "Apache2 don't need module checkings..." +# else +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo $HTTPD_MODULES_CONFIG enable php4_module +# fi +# $HTTPD_MODULES_CONFIG enable php4_module +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo $HTTPD_MODULES_CONFIG enable mod_php4 +# fi +# $HTTPD_MODULES_CONFIG enable mod_php4 +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo " enabled by $HTTPD_MODULES_CONFIG" +# fi +# fi +# fi +# +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo -n "Checking for ssl..." +# fi +# if [ "$HTTPD_MODULES_CONFIG" = "" ] +# then +# if grep -i "# LoadModule ssl_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo "found commented: activating ssl module!" +# fi +# sed "s/# LoadModule ssl_module/LoadModule ssl_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE +# cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP +# else +# if grep -i "LoadModule ssl_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo " ok!" +# fi +# else +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo "!!! Warning: ssl_module for apache not present !!!" +# fi +# fi +# fi +# else +# if [ ""$conf_apache_version = "2" ] ; then +# echo "Apache 2 don't need module checkings..." +# else +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo $HTTPD_MODULES_CONFIG enable ssl_module +# fi +# $HTTPD_MODULES_CONFIG enable ssl_module +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo " enabled by $HTTPD_MODULES_CONFIG" +# fi +# fi +# fi +# +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo -n "Checking for sql_log..." +# fi +# if [ "$HTTPD_MODULES_CONFIG" = "" ] +# then +# if grep -i "# LoadModule sql_log_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo "found commented: ativating sql_log module!" +# fi +# sed "s/# LoadModule sql_log_module/LoadModule sql_log_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE +# cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP +# else +# if grep -i "LoadModule log_sql_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo " ok!" +# fi +# else +# if grep -i "# LoadModule log_sql_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo "found commented: ativating sql_log module!" +# fi +# sed "s/# LoadModule log_sql_module/LoadModule log_sql_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE +# cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP +# else +# if grep -i "LoadModule sql_log_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 +# then +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo " ok!" +# fi +# else +# echo "!!! sql_log_module for apache not present !!!" +# echo "please install it or run apacheconfig" +# echo "or add the following type directive" +# echo "(matching your path) to httpd.conf:" +# echo "LoadModule sql_log_module /usr/lib/apache/1.3/mod_log_sql.so (debian)" +# echo "LoadModule log_sql_module /usr/local/libexec/apache/mod_log_sql.so (bsd)" +# exit 1 +# fi +# fi +# fi +# fi +# else +# if [ ""$conf_apache_version = "2" ] ; then +# echo "Apache 2 don't need module checkings..." +# else +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo $HTTPD_MODULES_CONFIG enable log_sql_module +# echo $HTTPD_MODULES_CONFIG enable log_sql_mysql_module +# fi +# $HTTPD_MODULES_CONFIG enable log_sql_module +# $HTTPD_MODULES_CONFIG enable log_sql_mysql_module +# $HTTPD_MODULES_CONFIG enable mod_log_sql # just in case +# if [ ""$VERBOSE_INSTALL = "yes" ] ;then +# echo " enabled by $HTTPD_MODULES_CONFIG" +# fi +# fi +# fi +# else +# echo "" +# echo "!!! WARNING !!! Tests for the folling apache modules" +# echo "has NOT been executed because this could crash" +# echo "the installer. Please verify you have the following" +# echo "apache modules configured and working:" +# echo "php4, ssl, rewrite, and sql_log" +# echo "Note also that current DTC wroks with SBOX and that it" +# echo "should be compiled and installed on your server to" +# echo "enable cgi-bin protected and chrooted environment." +# echo "" +# fi - if [ "$HTTPD_MODULES_CONFIG" = "" ] - then - # need to support modules.conf version of apache debian package - # default to normal HTTPD_CONF - PATH_HTTPD_CONF_TEMP=$PATH_HTTPD_CONF - if [ -f $PATH_HTTPD_MODULES_CONF ] - then - PATH_HTTPD_CONF_TEMP=$PATH_HTTPD_MODULES_CONF - fi - if grep -i "# LoadModule php4_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "found commented: activating php4 module!" + if [ ""$conf_apache_version = "2" ] ; then + # Activate mod_rewrite + if [ -f /etc/apache2/mods-available/rewrite.load ] ; then + if [ -d /etc/apache2/mods-enabled ] ; then + if ! [ -e /etc/apache2/mods-enabled/rewrite.load ] ; then + ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load fi - sed "s/# LoadModule php4_module/LoadModule php4_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE - cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP - else - if grep -i "LoadModule php4_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " ok!" - fi - else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "php4 missing! please install it or run apacheconfig!!!" - fi - exit 1 - fi - fi - else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo $HTTPD_MODULES_CONFIG enable php4_module - fi - $HTTPD_MODULES_CONFIG enable php4_module - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo $HTTPD_MODULES_CONFIG enable mod_php4 - fi - $HTTPD_MODULES_CONFIG enable mod_php4 - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " enabled by $HTTPD_MODULES_CONFIG" fi fi - - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo -n "Checking for ssl..." - fi - if [ "$HTTPD_MODULES_CONFIG" = "" ] - then - if grep -i "# LoadModule ssl_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "found commented: activating ssl module!" - fi - sed "s/# LoadModule ssl_module/LoadModule ssl_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE - cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP - else - if grep -i "LoadModule ssl_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " ok!" - fi - else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "!!! Warning: ssl_module for apache not present !!!" - fi + # Activate mod_ssl + if [ -f /etc/apache2/mods-available/ssl.load ] ; then + if [ -d /etc/apache2/mods-enabled ] ; then + if ! [ -e /etc/apache2/mods-enabled/ssl.load ] ; then + ln -s ../mods-available/ssl.load /etc/apache2/mods-enabled/ssl.load fi fi - else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo $HTTPD_MODULES_CONFIG enable ssl_module - fi - $HTTPD_MODULES_CONFIG enable ssl_module - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " enabled by $HTTPD_MODULES_CONFIG" - fi fi - - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo -n "Checking for sql_log..." - fi - if [ "$HTTPD_MODULES_CONFIG" = "" ] - then - if grep -i "# LoadModule sql_log_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "found commented: ativating sql_log module!" - fi - sed "s/# LoadModule sql_log_module/LoadModule sql_log_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE - cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP - else - if grep -i "LoadModule log_sql_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " ok!" - fi - else - if grep -i "# LoadModule log_sql_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "found commented: ativating sql_log module!" - fi - sed "s/# LoadModule log_sql_module/LoadModule log_sql_module/" $PATH_HTTPD_CONF_TEMP >$TMP_FILE - cat <$TMP_FILE >$PATH_HTTPD_CONF_TEMP - else - if grep -i "LoadModule sql_log_module" $PATH_HTTPD_CONF_TEMP >/dev/null 2>&1 - then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " ok!" - fi - else - echo "!!! sql_log_module for apache not present !!!" - echo "please install it or run apacheconfig" - echo "or add the following type directive" - echo "(matching your path) to httpd.conf:" - echo "LoadModule sql_log_module /usr/lib/apache/1.3/mod_log_sql.so (debian)" - echo "LoadModule log_sql_module /usr/local/libexec/apache/mod_log_sql.so (bsd)" - exit 1 - fi - fi - fi - fi - else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo $HTTPD_MODULES_CONFIG enable sql_log_module - fi - $HTTPD_MODULES_CONFIG enable sql_log_module - $HTTPD_MODULES_CONFIG enable mod_log_sql # just in case - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " enabled by $HTTPD_MODULES_CONFIG" - fi - fi - else - echo "" - echo "!!! WARNING !!! Tests for the folling apache modules" - echo "has NOT been executed because this could crash" - echo "the installer. Please verify you have the following" - echo "apache modules configured and working:" - echo "php4, ssl, rewrite, and sql_log" - echo "Note also that current DTC wroks with SBOX and that it" - echo "should be compiled and installed on your server to" - echo "enable cgi-bin protected and chrooted environment." - echo "" fi if [ ""$VERBOSE_INSTALL = "yes" ] ;then @@ -1175,20 +1789,98 @@ else echo "ok!" fi fi + + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo -n "Checking for Options None..." + fi + if grep "Options None" $PATH_HTTPD_CONF + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Options None -> Options FollowSymLinks" + fi + sed "s/Options None/Options FollowSymLinks/" $PATH_HTTPD_CONF >$TMP_FILE + cat <$TMP_FILE >$PATH_HTTPD_CONF + else + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "ok!" + fi + fi + if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "=> Adding DTC's directives to httpd.conf end" fi # It seems redhat has already the Listen directives... - if [ ""$UNIX_TYPE = "redhat" -o ""$UNIX_TYPE = "gentoo" ] ;then - echo "# Configured by DTC v0.12 : please do not touch this line ! -Include $PATH_DTC_ETC/vhosts.conf" >>$PATH_HTTPD_CONF - else - echo "# Configured by DTC v0.12 : please do not touch this line ! -Include $PATH_DTC_ETC/vhosts.conf -Listen 80 -Listen 443" >>$PATH_HTTPD_CONF + # detect whether we already have Listen directives, and comment them out # and replace with Listen 127.0.0.1:80 and 127.0.0.1:443 + # the other IPs will be created in vhosts.conf + + if grep "^Listen" $PATH_HTTPD_CONF >/dev/null + then + perl -i -p -e 's/^Listen/#Listen/' $PATH_HTTPD_CONF fi + if grep "^BindAddress" $PATH_HTTPD_CONF >/dev/null + then + perl -i -p -e 's/^BindAddress/#BindAddress/' $PATH_HTTPD_CONF + fi + + # if we have a modules.d folder, we need to check to see if there are any Listen or BindAddress there too + if [ -e /etc/apache*/modules.d/ ]; then + # first Listen + for i in `grep -l ^Listen /etc/apache*/modules.d/*`; do + perl -i -p -e 's/^Listen/#Listen/' $i + done + # then BindAddress + for i in `grep -l ^BindAddress /etc/apache*/modules.d/*`; do + perl -i -p -e 's/^BindAddress/#BindAddress/' $i + done + fi + + # If the variable is not set prior to calling this sript, then search for it! + if [ -z "$PATH_APACHE_PID_FILE" ] ; then + # symlink the PidFile to our dtc location, so we can check it in our scripts + PATH_APACHE_PID_FILE=`grep ^PidFile $PATH_HTTPD_CONF | cut -f2 -d' '` + ## strip the pid of " characters if they exist + PATH_APACHE_PID_FILE=${PATH_APACHE_PID_FILE##\"} + PATH_APACHE_PID_FILE=${PATH_APACHE_PID_FILE%%\"} + echo "Symlinking $PATH_APACHE_PID_FILE to $PATH_DTC_ETC/apache.pid ..." + + # in case the specified pid file doesn't exist, try and find it + if [ ! -e $PATH_APACHE_PID_FILE ]; then + if [ -e /etc/httpd/$PATH_APACHE_PID_FILE ]; then + PATH_APACHE_PID_FILE=/etc/httpd/$PATH_APACHE_PID_FILE + fi + if [ -e /var/$PATH_APACHE_PID_FILE ]; then + PATH_APACHE_PID_FILE=/var/$PATH_APACHE_PID_FILE + fi + if [ -e /var/run/$PATH_APACHE_PID_FILE ]; then + PATH_APACHE_PID_FILE=/var/run/$PATH_APACHE_PID_FILE + fi + fi + fi + + rm -f $PATH_DTC_ETC/apache.pid + ln -s $PATH_APACHE_PID_FILE $PATH_DTC_ETC/apache.pid + if [ ! -f $PATH_APACHE_PID_FILE ]; then + echo "PidFile $PATH_APACHE_PID_FILE didn't exist..." + if ps -e | grep apache$ > /dev/null; then + ps -e | grep apache$ | head -n 1 | cut -f1 -d' ' >> $PATH_APACHE_PID_FILE + fi + fi + + # annoyingly redhat has a different Listen for the ssl.conf + # comment that out too + if [ ""$UNIX_TYPE = "redhat" ] ;then + perl -i -p -e 's/^Listen/#Listen/' /etc/httpd/conf.d/ssl.conf + fi + + echo "# Configured by DTC v0.12 : please do not touch this line ! +Include $PATH_DTC_ETC/vhosts.conf" >>$PATH_HTTPD_CONF + + if ! [ ""$conf_omit_dev_mknod = "yes" ] ; then + echo "Listen 127.0.0.1:80 +Listen 127.0.0.1:443" >>$PATH_HTTPD_CONF + fi + echo "LogSQLLoginInfo localhost dtcdaemons "${MYSQL_DTCDAEMONS_PASS} >>$PATH_HTTPD_CONF if [ ""$UNIX_TYPE = "freebsd" ] ;then echo "LogSQLSocketFile /tmp/mysqld.sock" >>$PATH_HTTPD_CONF @@ -1207,65 +1899,241 @@ ErrorDocument 404 /dtc404/404.php fi fi -# Create the ssl certificate if it does not exists (for distribs with /etc/apache only for the moment) -if [ -e "/etc/apache" ]; then - if [ -e "/etc/apache/ssl" ]; then - mkdir -p /etc/apache/ssl +if [ -e /etc/apache2/ports.conf ] ; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Founded ports.conf: will remove it's directive" + fi + if [ -e /etc/apache2/ports.conf.DTC_backup ] ; then + echo -n ""; + else + cp /etc/apache2/ports.conf /etc/apache2/ports.conf.DTC_backup + fi + echo "" >/etc/apache2/ports.conf +fi + +# Remove all the directives for mod_log_sql that we setup already in the main httpd.conf +# Removes: "LogSQLLoginInfo", "LogSQLMassVirtualHosting" and "LogSQLTransferLogFormat" +MOD_SQL_CONF="/etc/apache2/modules.d/42_mod_log_sql.conf" +if [ -e ${MOD_SQL_CONF} ] ; then + TMP_FILE=`${MKTEMP} DTC_configure_mod_log_sql.conf.XXXXXX` || exit 1 + grep -v "LogSQLLoginInfo" ${MOD_SQL_CONF} >${TMP_FILE} + TMP_FILE2=`${MKTEMP} DTC_configure2_mod_log_sql.conf.XXXXXX` || exit 1 + grep -v "LogSQLMassVirtualHosting" ${TMP_FILE} >${TMP_FILE2} + grep -v "LogSQLTransferLogFormat" ${TMP_FILE2} >${MOD_SQL_CONF} + rm -f ${TMP_FILE} ${TMP_FILE2} +fi + + + +# need to make sure we are loading LOG_SQL in the /etc/conf.d/apache2 if that file exists +# this is especially true for gentoo +APACHE2_CONFD="/etc/conf.d/apache2" +if [ -e ${APACHE2_CONFD} ] ; then + if grep "Configured by DTC" $APACHE2_CONFD >/dev/null + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$APACHE2_CONFD has been configured before : skiping include inssertion !" + fi + else + if ! [ -f $APACHE2_CONFD.DTC.backup ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Backing up "$APACHE2_CONFD + fi + cp -f "$APACHE2_CONFD" "$APACHE2_CONFD.DTC.backup" + fi + + TMP_FILE=`${MKTEMP} DTC_install_conf.d_apache2.XXXXXX` || exit 1 + echo "# Configured by DTC $VERSION" >> $TMP_FILE + echo "# This overrides all APACHE2_OPTS, if you wish to modify these options," >> $TMP_FILE + echo "# please add the following line to the end of the file" >> $TMP_FILE + echo "# and replace with the obvious" >> $TMP_FILE + echo "# APACHE2_OPTS=\"\$APACHE2_OPTS \"" >> $TMP_FILE + echo "APACHE2_OPTS=\"-D PHP5 -D SSL -D MOD_LOG -D LOG_SQL\"" >> $TMP_FILE + echo "# End of DTC configuration $VERSION" >> $TMP_FILE + + # now to insert it at the end of the actual $APACHE2_CONFD + cat < $TMP_FILE >>$APACHE2_CONFD + rm ${TMP_FILE} fi fi + + +# Create the ssl certificate if it does not exists (for distribs with /etc/apache only for the moment) +# Obsolet code: removed! +#if [ -e "/etc/apache" ]; then +# if [ -e "/etc/apache/ssl" ]; then +# mkdir -p /etc/apache/ssl +# fi +#fi + # copy the template directory from shared to etc, so we can edit it without worry of being purged on each install # only copy the directory, if it doesn't already exist in the etc path if [ -e "$PATH_DTC_SHARED/shared/template" ]; then if [ ! -e "$PATH_DTC_ETC/template" ]; then cp -r $PATH_DTC_SHARED/shared/template $PATH_DTC_ETC fi - chown -R nobody:65534 $PATH_DTC_ETC/template + chown -R ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_DTC_ETC/template chmod -R 775 $PATH_DTC_ETC/template fi +# fix the perms for the gfx and imgcache +chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_DTC_SHARED/shared/imgcache +chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_DTC_SHARED/shared/gfx +chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_DTC_SHARED/client/imgcache +chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_DTC_SHARED/client/gfx + # copy the 404 index.php file if none is found. -if ! [ -e $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/404/html/index.php" ]; then - if ! [ -e $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/404/html/index.html" ]; then - if [ -e $PATH_DTC_SHARED/shared/404_template/index.php ]; then - cp $PATH_DTC_SHARED/shared/404_template/index.php $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/404/html/" - fi +if ! [ -e $conf_hosting_path/$conf_adm_login/$main_domain_name/subdomains/404/html/index.* ]; then + if [ -e $PATH_DTC_SHARED/shared/404_template/index.php ]; then + cp $PATH_DTC_SHARED/shared/404_template/index.php $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/404/html/" fi fi # copy the Error 404 document -if ! [ -e $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/www/html/404.php" ]; then +if ! [ -e $conf_hosting_path/$conf_adm_login/$main_domain_name/subdomains/www/html/404.* ]; then if [ -e $PATH_DTC_SHARED/shared/404_template/404.php ]; then cp $PATH_DTC_SHARED/shared/404_template/404.php $conf_hosting_path"/"$conf_adm_login"/"$main_domain_name"/subdomains/www/html/" fi fi +# copy the expired.php to the destination folder +if ! [ -e $PATH_DTC_ETC/expired_site ] ; then + mkdir -p $PATH_DTC_ETC/expired_site +fi +if ! [ -e $PATH_DTC_ETC/expired_site/index.* ] ; then + cp $PATH_DTC_SHARED/shared/404_template/expired.php $PATH_DTC_ETC/expired_site/index.php +fi + # also copy it to the dtc404 directory if ! [ -e $PATH_DTC_ETC/dtc404/404.php ]; then mkdir -p $PATH_DTC_ETC/dtc404/ cp $PATH_DTC_SHARED/shared/404_template/404.php $PATH_DTC_ETC/dtc404/ fi -PATH_PAMD_SMTP=/etc/pam.d/smtp -if [ -e /etc/pam.d/ ] -then +cyrus_auth_php="$PATH_DTC_SHARED/shared/cyrus.php" +if [ -e /usr/pkg/cyrus/bin/imapd -o -e /usr/lib/cyrus/bin/imapd -o -e /usr/local/cyrus/bin/imapd -o -e /usr/cyrus/bin/imapd ]; then + + echo " 'localhost', +'PORT' => 143, +'ADMIN' => 'cyrus', +'PASS' => '${MYSQL_DTCDAEMONS_PASS}' +); +\$cyrus_used=1; +\$cyrus_default_quota=51200; +?>" > $cyrus_auth_php; + +else + + echo "" > $cyrus_auth_php; + +fi + +if [ ""$UNIX_TYPE = "freebsd" -a -f /usr/local/lib/sasl2/sql.so ] ;then + PATH_AUTH_SMTPD=/usr/local/lib/sasl2/smtpd.conf + PATH_AUTH_SASLPASSWD=/usr/local/lib/sasl2/saslpasswd.conf + PATH_AUTH_CYRUS=/usr/local/etc/imapd.conf if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "===> Adding configuration inside "$PATH_PAMD_SMTP + echo "===> Adding configuration inside /usr/local/lib/sasl2" fi - if [ -f $PATH_PAMD_SMTP ] - then - if ! [ -f $PATH_PAMD_SMTP.DTC.backup ] - then - cp -f $PATH_PAMD_SMTP $PATH_PAMD_SMTP.DTC.backup + if [ -f $PATH_AUTH_SMTP ]; then + if ! [ -f $PATH_AUTH_SMTP.DTC.backup ]; then + cp -f $PATH_AUTH_SMTP $PATH_AUTH_SMTP.DTC.backup fi fi - touch $PATH_PAMD_SMTP - echo "auth required pam_mysql.so user=dtcdaemons passwd="${MYSQL_DAEMONS_PASS}" db="$conf_mysql_db" table=pop_access usercolumn=id passwdcolumn=password crypt=0" >$PATH_PAMD_SMTP -# if grep "Configured by DTC" $PATH_PAMD_SMTP -# echo $PATH_PAMD_SMTP" has been configured before: skiping include insertion!" -# else -# echo "Including configuration in "$PATH_PAMD_SMTP -# fi + echo "pwcheck_method: auxprop +auxprop_plugin: sql +sql_engine: mysql +sql_hostnames: localhost +sql_user: root +sql_pass: ${MYSQL_DTCDAEMONS_PASS} +sql_database: ${conf_mysql_db} +password_format: crypt +sql_select: SELECT crypt FROM pop_access WHERE fullemail = '%u@%r' +sql_update: UPDATE pop_access SET crypt = '%v' WHERE fullemail = '%u@%r' +sql_verbose: yes" >${PATH_AUTH_SMTPD} + + if [ -f $PATH_AUTH_SASLPASSWD ]; then + if ! [ -f $PATH_AUTH_SASLPASSWD.DTC.backup ]; then + cp -f $PATH_AUTH_SASLPASSWD $PATH_AUTH_SASLPASSWD.DTC.backup + fi + fi + + cp -f $PATH_AUTH_SMTP $PATH_AUTH_SASLPASSWD + + if [ -f $PATH_AUTH_CYRUS ]; then + if ! [ -f $PATH_AUTH_CYRUS.DTC.backup ]; then + cp -f $PATH_AUTH_CYRUS $PATH_AUTH_CYRUS.DTC.backup + fi + fi + + echo "pwcheck_method: auxprop +auxprop_plugin: sql + +sasl_sql_engine: mysql +sasl_sql_hostnames: localhost +sasl_sql_user: root +sasl_sql_pass: ${MYSQL_DTCDAEMONS_PASS} +sasl_sql_database: ${conf_mysql_db} +sasl_password_format: crypt +sasl_sql_select: SELECT crypt FROM pop_access WHERE fullemail = '%u@%r' +sasl_sql_update: UPDATE pop_access SET crypt = '%v' WHERE fullemail = '%u@%r' +sasl_sql_verbose: yes" >>$PATH_AUTH_CYRUS + +else + + PATH_PAMD_SMTP=/etc/pam.d/smtp + PATH_PAMD_IMAP=/etc/pam.d/imap + PATH_PAMD_SIEVE=/etc/pam.d/sieve + PATH_PAMD_POP=/etc/pam.d/pop + if [ -e /etc/pam.d/ ]; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Adding configuration inside "$PATH_PAMD_SMTP + fi + if [ -f $PATH_PAMD_SMTP ]; then + if ! [ -f $PATH_PAMD_SMTP.DTC.backup ]; then + cp -f $PATH_PAMD_SMTP $PATH_PAMD_SMTP.DTC.backup + fi + fi + touch $PATH_PAMD_SMTP + echo "auth required pam_mysql.so user=dtcdaemons passwd="${MYSQL_DTCDAEMONS_PASS}" db="$conf_mysql_db" table=pop_access usercolumn=id passwdcolumn=password crypt=0" >$PATH_PAMD_SMTP + if [ ""$conf_use_cyrus = "true" ]; then + echo "account sufficient pam_mysql.so user=dtcdaemons passwd="${MYSQL_DTCDAEMONS_PASS}" host=localhost db="$conf_mysql_db" table=pop_access usercolumn=fullemail passwdcolumn=crypt crypt=1 + +auth required pam_mysql.so user=dtcdaemons passwd="${MYSQL_DTCDAEMONS_PASS}" host=localhost db="$conf_mysql_db" table=pop_access usercolumn=fullemail passwdcolumn=crypt crypt=1" >$PATH_PAMD_SMTP + + if [ -f $PATH_PAMD_IMAP ]; then + if ! [ -f $PATH_PAMD_IMAP.DTC.backup ]; then + cp -f $PATH_PAMD_IMAP $PATH_PAMD_IMAP.DTC.backup + fi + fi + cp -f $PATH_PAMD_SMTP $PATH_PAMD_IMAP + + if [ -f $PATH_PAMD_SIEVE ]; then + if ! [ -f $PATH_PAMD_SIEVE.DTC.backup ]; then + cp -f $PATH_PAMD_SIEVE $PATH_PAMD_SIEVE.DTC.backup + fi + fi + cp -f $PATH_PAMD_SMTP $PATH_PAMD_SIEVE + + if [ -f $PATH_PAMD_POP ]; then + if ! [ -f $PATH_PAMD_POP.DTC.backup ]; then + cp -f $PATH_PAMD_POP $PATH_PAMD_POP.DTC.backup + fi + fi + cp -f $PATH_PAMD_SMTP $PATH_PAMD_POP + fi +# if grep "Configured by DTC" $PATH_PAMD_SMTP +# echo $PATH_PAMD_SMTP" has been configured before: skiping include insertion!" +# else +# echo "Including configuration in "$PATH_PAMD_SMTP +# fi + fi fi # @@ -1274,15 +2142,56 @@ fi if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Adding inclusion to named.conf" fi +# need to detect named chroot for gentoo +NAMED_CHROOT= +if [ -e /etc/conf.d/named ]; then + NAMED_CHROOT=`. /etc/conf.d/named; echo -n $CHROOT` + echo "named is configured for chroot at $NAMED_CHROOT" +fi +# check to see if NAMED_CHROOT is / +# if so, then we need not do all this hooha below +if [ ""$NAMED_CHROOT = "/" ]; then + NAMED_CHROOT= +fi + +if [ -n ""$NAMED_CHROOT ]; then + if [ -e ""$NAMED_CHROOT ]; then + mkdir -p $NAMED_CHROOT/$PATH_DTC_ETC/zones + mkdir -p $NAMED_CHROOT/$PATH_DTC_ETC/slave_zones + touch $NAMED_CHROOT/$PATH_DTC_ETC/named.conf + if [ -e $PATH_DTC_ETC/named.conf ]; then + if [ ! -L $PATH_DTC_ETC/named.conf -a ! -e $PATH_DTC_ETC/named.conf.moved ] ; then + mv $PATH_DTC_ETC/named.conf $PATH_DTC_ETC/named.conf.moved + fi + fi + if [ -e $PATH_DTC_ETC/zones ]; then + if [ ! -L $PATH_DTC_ETC/zones -a ! -e $PATH_DTC_ETC/zones.moved ]; then + mv $PATH_DTC_ETC/zones $PATH_DTC_ETC/zones.moved + fi + fi + if [ -e $PATH_DTC_ETC/slave_zones ]; then + if [ ! -L $PATH_DTC_ETC/slave_zones -a ! -e $PATH_DTC_ETC/slave_zones.moved ]; then + mv $PATH_DTC_ETC/slave_zones $PATH_DTC_ETC/slave_zones.moved + fi + fi + if [ ! -L $PATH_DTC_ETC/named.conf ]; then + ln -s $NAMED_CHROOT/$PATH_DTC_ETC/named.conf $PATH_DTC_ETC/named.conf + fi + if [ ! -L $PATH_DTC_ETC/zones ]; then + ln -s $NAMED_CHROOT/$PATH_DTC_ETC/zones $PATH_DTC_ETC/zones + fi + if [ ! -L $PATH_DTC_ETC/slave_zones ]; then + ln -s $NAMED_CHROOT/$PATH_DTC_ETC/slave_zones $PATH_DTC_ETC/slave_zones + fi + fi +fi + if grep "Configured by DTC" $PATH_NAMED_CONF >/dev/null then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "named.conf has been configured before : skiping include insertion !" fi else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Including named.conf in $PATH_NAMED_CONF" - fi if ! [ -f $PATH_NAMED_CONF.DTC.backup ] then cp -f $PATH_NAMED_CONF $PATH_NAMED_CONF.DTC.backup @@ -1304,7 +2213,6 @@ if [ -e "$PATH_QMAIL_CTRL" ] ;then # if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Linking qmail control files to DTC generated files" - echo "111" fi if ! [ -e $PATH_QMAIL_CTRL/rcpthosts.DTC.backup ] then @@ -1367,9 +2275,23 @@ fi # make sure the amavisd configuration has 'amavis' user and group +if [ -n ""$PATH_AMAVISD_CONF ]; then + PATH_AMAVISD_ETC=`dirname $PATH_AMAVISD_CONF` +fi +AMAVISD_CONFD=0 +# CLAMD_CONF is the file we modify that has the clamd.ctl +AMAVIS_CLAMD_CONF=$PATH_AMAVISD_CONF +# if there is no amavisd conf, but there is a conf.d, create a 99-dtc file +if [ ! -f "$PATH_AMAVISD_CONF" -a -e $PATH_AMAVISD_ETC/conf.d ]; then + touch $PATH_AMAVISD_ETC/conf.d/99-dtc + PATH_AMAVISD_CONF=$PATH_AMAVISD_ETC/conf.d/99-dtc + AMAVISD_CONFD=1 + AMAVIS_CLAMD_CONF=`grep -l clamd.ctl $PATH_AMAVISD_ETC/conf.d/*` +fi + if [ -f "$PATH_AMAVISD_CONF" ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then - echo "Checking user and group configuration for amavisd..." + if [ ""$VERBOSE_INSTALL = "yes" ]; then + echo "===> Checking user and group configuration for amavisd..." fi # make sure our users exist for amavis @@ -1377,26 +2299,26 @@ if [ -f "$PATH_AMAVISD_CONF" ]; then # turn back on error handling, these users probably exist already $GROUP_ADD_CMD amavis > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "Group amavis already exists..." fi fi $USER_ADD_CMD -g amavis amavis > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "User amavis already exists..." fi fi $PASSWD_CMD -l amavis > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "Change password failed for amavis user" fi fi set -e if grep "Configured by DTC" "$PATH_AMAVISD_CONF" >/dev/null; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "$PATH_AMAVISD_CONF already configured..." fi else @@ -1408,7 +2330,7 @@ if [ -f "$PATH_AMAVISD_CONF" ]; then perl -i -p -e 's/^1;[^\n]*\n//' $PATH_AMAVISD_CONF # fix the clamd ctl file to point to /var/run/clamav/clamd.ctl - perl -i -p -e 's/\"i\/.*?\/clamd.ctl\"/\"\/var\/run\/clamav\/clamd.ctl\"/' $PATH_AMAVISD_CONF + perl -i -p -e 's/\"i\/.*?\/clamd.ctl\"/\"\/var\/run\/clamav\/clamd.ctl\"/' $AMAVIS_CLAMD_CONF mkdir -p /var/run/clamav/ chown -R clamav:clamav /var/run/clamav @@ -1434,17 +2356,50 @@ if [ -f "$PATH_AMAVISD_CONF" ]; then echo "# The following line will read the local domains as generated by DTC, amavisd will need to be restarted for new domains..." >> $TMP_FILE echo "read_hash(\\%local_domains, '$PATH_DTC_ETC/local_domains');" >> $TMP_FILE + # if we have a list of postfix relay domains, we may as well check them to virii etc... + # If you enable this, it will tag ***SPAM*** twice... not very good looking :) + # if [ -e "$PATH_DTC_ETC/postfix_relay_domains" ]; then + # echo "my %tmp_relay_domains;" >> $TMP_FILE + # echo "read_hash(\\%tmp_relay_domains, '$PATH_DTC_ETC/postfix_relay_domains');" >> $TMP_FILE + # echo "# now merge the two hashes" >> $TMP_FILE + # echo "@local_domains{keys %tmp_relay_domains} = values %tmp_relay_domains;" >> $TMP_FILE + # fi + + echo "# Make sure anti-virus and spam are enabled +@bypass_virus_checks_acl = [ 1 ]; +@bypass_spam_checks_acl = [ 1 ]; + +# need to check to see if the variables exist, and set them properly if they do +{ +no strict 'refs'; +my \$ref=\"bypass_virus_checks_maps\"; +if (defined @\$ref) +{ +@\$ref = ( + \\%bypass_virus_checks, \\@bypass_virus_checks_acl, \\\$bypass_virus_checks_re); +} +\$ref=\"bypass_spam_checks_maps\"; +if (defined @\$ref) +{ +@\$ref = ( + \\%bypass_spam_checks, \\@bypass_spam_checks_acl, \\\$bypass_spam_checks_re); +} +} + +" >> $TMP_FILE + echo "# End of DTC configuration $VERSION" >> $TMP_FILE echo "1; # insure a defined return" >> $TMP_FILE # now to insert it at the end of the actual amavisd.conf cat < $TMP_FILE >>$PATH_AMAVISD_CONF + rm ${TMP_FILE} fi fi if [ -f "$PATH_CLAMAV_CONF" ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then - echo "Checking user and group configuration for clamav..." + if [ ""$VERBOSE_INSTALL = "yes" ]; then + echo "===> Checking user and group configuration for clamav..." fi # make sure our users exist for amavis @@ -1452,32 +2407,32 @@ if [ -f "$PATH_CLAMAV_CONF" ]; then # turn back on error handling, these users probably exist already $GROUP_ADD_CMD clamav > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "Group clamav already exists..." fi fi $USER_ADD_CMD -g clamav clamav > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "User clamav already exists..." fi fi $PASSWD_CMD -l clamav > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "Change password failed for clamav user" fi fi # now add amavisd to the clamav group and vice versa $USER_MOD_CMD -G clamav,amavis clamav > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "Change group failed for clamav user" fi fi $USER_MOD_CMD -G amavis,clamav amavis > /dev/null 2>&1 if [ $? -ne 0 ]; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "Change group failed for amavis user" fi fi @@ -1492,7 +2447,7 @@ if [ -f "$PATH_CLAMAV_CONF" ]; then fi if grep "Configured by DTC" "$PATH_CLAMAV_CONF" >/dev/null; then - if [ ""$VERBOSE_INSTALL == "yes" ]; then + if [ ""$VERBOSE_INSTALL = "yes" ]; then echo "$PATH_CLAMAV_CONF already configured..." fi else @@ -1512,7 +2467,109 @@ if [ -f "$PATH_CLAMAV_CONF" ]; then fi fi +# +# Modify the cyrus imapd.conf +# +if [ -f "$PATH_CYRUS_CONF" ] +then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> modifying cyrus config" + fi + if grep "Configured by DTC" "$PATH_CYRUS_CONF" >/dev/null + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Cyrus imapd.conf has been configured before" + fi + else + if grep "unixhierarchysep: no" "$PATH_CYRUS_CONF" >/dev/null; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Changing unixhierarchysep from no to yes" + fi + TMP_FILE=`${MKTEMP} DTC_install.imapd.conf.XXXXXX` || exit 1 + sed "s/unixhierarchysep: no/unixhierarchysep: yes/" "$PATH_CYRUS_CONF" >$TMP_FILE + cat <$TMP_FILE >"$PATH_CYRUS_CONF" + rm $TMP_FILE + fi + if grep "sasl_pwcheck_method: auxprop" "$PATH_CYRUS_CONF" >/dev/null; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Changing sasl_pwcheck_method from auxprop to saslauthd" + fi + TMP_FILE=`${MKTEMP} DTC_install.imapd.conf.XXXXXX` || exit 1 + sed "s/sasl_pwcheck_method: auxprop/sasl_pwcheck_method: saslauthd/" "$PATH_CYRUS_CONF" >$TMP_FILE + cat <$TMP_FILE >"$PATH_CYRUS_CONF" + rm $TMP_FILE + fi + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Inserting DTC configuration inside $PATH_CYRUS_CONF" + fi + + TMP_FILE=`${MKTEMP} DTC_install.imapd.conf.XXXXXX` || exit 1 + echo "# Configured by DTC v0.20 : Please don't touch this line !" > $TMP_FILE + echo "virtdomains: yes +quotawarn: 90 +admins: cyrus +sasl_mech_list: PLAIN LOGIN" >> $TMP_FILE + echo "# End of DTC configuration v0.20 : Please don't touch this line !" >> $TMP_FILE + # now to insert it at the end of the actual imapd.conf + cat < $TMP_FILE >>$PATH_CYRUS_CONF + rm $TMP_FILE + fi + else + echo "$PATH_CYRUS_CONF NOT FOUND" +fi + +if [ -f "$PATH_SASL_START_CONF" ] +then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> modifying saslauthd startup parameters" + fi + if grep "Configured by DTC" $PATH_SASL_START_CONF >/dev/null + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$PATH_SASL_START_CONF has been configured before..." + fi + else + TMP_FILE=`${MKTEMP} DTC_install.saslauthd.XXXXXX` || exit 1 + echo "# Configured by DTC v0.20 : Please don't touch this line !" > $TMP_FILE + echo "START=yes +PARAMS=\"-r -c \"" >> $TMP_FILE + echo "# End of DTC configuration v0.20 : Please don't touch this line !" >> $TMP_FILE + # now to insert it at the end of the actual saslauthd startup file + cat < $TMP_FILE >>$PATH_SASL_START_CONF + rm $TMP_FILE + fi + if [ -f $PATH_SASL_STARTUP ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "modifying saslatuhd startup file" + fi + # create the direcotry for postfix to access SASL socket + mkdir -p $PATH_SASL_SOCKET + + # get the md5sum of the file, if it's original do the change + # else we have a problem and report it to do the change manualy + sasl_start_md5sum=`md5sum $PATH_SASL_STARTUP|cut -d " " -f1` + # ### CL find a better place for this ! + sasl_orginal_m5="6307086733ad29bbd57f81b6c38334a1"; + if [ ""$sasl_orginal_m5 = "$sasl_start_md5sum" ] + then + # ok file is original so we can "patch" it. + patch $PATH_SASL_STARTUP <$PATH_DTC_ADMIN/patch_saslatuhd_startup + else + echo "Can not modify the saslauthd startupfile" + echo "Please edit $PATH_SASL_STARTUP by hand and add folowing after startup:" + echo "rm -f /var/spool/postfix/var/run/saslauthd/mux +ln /var/run/saslauthd/mux /var/spool/postfix/var/run/saslauthd/mux" + echo "for more informations contact DTC development and DTC forums" + fi + fi +else + if [ ""$conf_use_cyrus = "true" ]; then + echo "Big Problem: Cyrus install selected bo no saslauthd startup file"; + echo "Workaround: make saslauth start with -r -c -a pam"; + fi +fi # # Modify the postfix main.cf to include virtual delivery options # @@ -1526,19 +2583,43 @@ then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Linking postfix control files to DTC generated files" fi + touch $PATH_DTC_ETC/postfix_virtual.db + touch $PATH_DTC_ETC/postfix_aliases.db + # fix default /etc/aliases + touch /etc/aliases + newaliases + touch $PATH_DTC_ETC/postfix_relay_recipients.db + touch $PATH_DTC_ETC/postfix_vmailbox.db + touch $PATH_DTC_ETC/postfix_virtual_uid_mapping.db + chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_DTC_ETC/postfix_*.db if grep "Configured by DTC" "$PATH_POSTFIX_CONF" >/dev/null then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "Postfix main.cf has been configured before, not adding virtual mailbox options" fi else + + if grep "recipient_delimiter = +" "$PATH_POSTFIX_ETC/main.cf" >/dev/null; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Changing recipient delimiter from + to -" + fi + TMP_FILE=`${MKTEMP} DTC_install.main.cf.XXXXXX` || exit 1 + sed "s/recipient_delimiter = +/recipient_delimiter = -/" "$PATH_POSTFIX_ETC/main.cf" >$TMP_FILE + cat <$TMP_FILE >"$PATH_POSTFIX_ETC/main.cf" + rm $TMP_FILE + fi + if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "Inserting DTC configuration inside $PATH_POSTFIX_CONF" fi TMP_FILE=`${MKTEMP} DTC_install.postfix_main.cf.XXXXXX` || exit 1 echo "# Configured by DTC v0.12 : Please don't touch this line !" > $TMP_FILE + # CL: this is general config, for courier and cyrus + # for mailname to be mx.$main_domain_name + echo "mx.$main_domain_name" > /etc/mailname echo "# DTC virtual configuration +myhostname = mx.$main_domain_name # disable the following functionality by default (otherwise can't match subdomains correctly) parent_domain_matches_subdomains= @@ -1549,20 +2630,27 @@ mailbox_size_limit = 0 content_filter=smtp-amavis:[127.0.0.1]:10024 virtual_mailbox_domains = hash:$PATH_DTC_ETC/postfix_virtual_mailbox_domains -virtual_mailbox_base = / +" >> $TMP_FILE + +if [ ""$conf_use_cyrus = "true" ]; then + echo "virtual_transport = cyrus +mailbox_transport = cyrus +# local_recipient_maps = $alias_maps, ... ### CL ToDo! " >> $TMP_FILE +else + # courier/postfix only! + echo "virtual_mailbox_base = / virtual_mailbox_maps = hash:$PATH_DTC_ETC/postfix_vmailbox -virtual_minimum_uid = 100 -virtual_uid_maps = static:65534 -virtual_gid_maps = static:65534 -virtual_alias_maps = hash:$PATH_DTC_ETC/postfix_virtual +virtual_minimum_uid = 98 +virtual_uid_maps = static:$nobodygid +virtual_gid_maps = static:$nobodygid +virtual_uid_maps = hash:$PATH_DTC_ETC/postfix_virtual_uid_mapping" >> $TMP_FILE +fi +# CL continue with global part +echo "virtual_alias_maps = hash:$PATH_DTC_ETC/postfix_virtual alias_maps = hash:/etc/aliases, hash:$PATH_DTC_ETC/postfix_aliases relay_domains = $PATH_DTC_ETC/postfix_relay_domains -relay_recipient_maps = hash:$PATH_DTC_ETC/postfix_relay_recipients -virtual_uid_maps = hash:$PATH_DTC_ETC/postfix_virtual_uid_mapping" >> $TMP_FILE +relay_recipient_maps = hash:$PATH_DTC_ETC/postfix_relay_recipients " >> $TMP_FILE if [ -n $conf_dnsbl_list ]; then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " Adding DNS Blacklist to postfix configuration..." - fi IFS=, for i in $conf_dnsbl_list; do dnsbl_list="$dnsbl_list reject_rbl_client $i," @@ -1570,14 +2658,8 @@ virtual_uid_maps = hash:$PATH_DTC_ETC/postfix_virtual_uid_mapping" >> $TMP_FILE unset IFS fi - - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo " Attempting to determine if you have sasl2 installed..." - fi if [ "$PATH_SASL_PASSWD2" = "" ]; then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "No saslpasswd2 installed"; - fi + echo -n "" elif [ -f $PATH_SASL_PASSWD2 ]; then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "Found sasl2passwd at $PATH_SASL_PASSWD2" @@ -1595,7 +2677,7 @@ virtual_uid_maps = hash:$PATH_DTC_ETC/postfix_virtual_uid_mapping" >> $TMP_FILE if [ -e /var/spool/postfix/etc ]; then touch /var/spool/postfix/etc/sasldb2 - chown postfix:65534 /var/spool/postfix/etc/sasldb2 + chown postfix:${CONF_DTC_SYSTEM_GROUPNAME} /var/spool/postfix/etc/sasldb2 chmod 664 /var/spool/postfix/etc/sasldb2 if [ ! -e $PATH_DTC_ETC/sasldb2 ]; then cp /var/spool/postfix/etc/sasldb2 $PATH_DTC_ETC/sasldb2 @@ -1603,11 +2685,11 @@ virtual_uid_maps = hash:$PATH_DTC_ETC/postfix_virtual_uid_mapping" >> $TMP_FILE else if [ -d /etc/sasl2 ]; then touch /etc/sasl2/sasldb2 - chown postfix:65534 /etc/sasl2/sasldb2 + chown postfix:${CONF_DTC_SYSTEM_GROUPNAME} /etc/sasl2/sasldb2 chmod 664 /etc/sasl2/sasldb2 else touch /etc/sasldb2 - chown postfix:65534 /etc/sasldb2 + chown postfix:${CONF_DTC_SYSTEM_GROUPNAME} /etc/sasldb2 chmod 664 /etc/sasldb2 fi if [ ! -e $PATH_DTC_ETC/sasldb2 ]; then @@ -1621,8 +2703,14 @@ virtual_uid_maps = hash:$PATH_DTC_ETC/postfix_virtual_uid_mapping" >> $TMP_FILE SASLTMP_FILE=`${MKTEMP} DTC_install.postfix_sasl.XXXXXX` || exit 1 echo "# Configured by DTC v0.15 : Please don't touch this line !" > ""$SASLTMP_FILE - echo "pwcheck_method: auxprop + # CL: for cyrus use saslauthd instead of auxprop! + if [ ""$conf_use_cyrus = "true" ]; then + echo "pwcheck_method: saslauthd +mech_list: login plain" >> $SASLTMP_FILE + else + echo "pwcheck_method: auxprop mech_list: plain login digest-md5 cram-md5" >> $SASLTMP_FILE + fi echo "# End of DTC configuration v0.15 : please don't touch this line !" >> $SASLTMP_FILE echo "smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, @@ -1650,44 +2738,31 @@ smtpd_tls_auth_only = no # this file is appended to the postfix configure, in case you need to override some configure parameters in the postfix main.cf" > $PATH_DTC_ETC/postfix_config_snippets fi - # if we have maildrop, we should use it! - if [ -n ""$PATH_USERDB_BIN -a -f "$PATH_USERDB_BIN" -a -n ""$PATH_MAILDROP_BIN -a -f "$PATH_MAILDROP_BIN" ]; then - echo "virtual_transport = maildrop" >> $TMP_FILE - echo "## Set to 1 because Maildrop only delivers one message at a time. -maildrop_destination_recipient_limit = 1" >> $TMP_FILE - if grep "Configured by DTC" "$PATH_POSTFIX_ETC/master.cf" >/dev/null; then - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Postfix master.cf has been configured before, not adding maildrop options" - fi - else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Inserting DTC configuration inside $PATH_POSTFIX_ETC/master.cf" - fi - TMP_FILE2=`${MKTEMP} DTC_install.postfix_master.cf.XXXXXX` || exit 1 - echo "# Configured by DTC v0.17 : Please don't touch this line !" > $TMP_FILE2 - echo "maildrop unix - n n - - pipe - flags=DRhu user=nobody argv=$PATH_MAILDROP_BIN -d \${user}@\${nexthop} \${extension} \${recipient} \${user} \${nexthop} -" >> $TMP_FILE2 - echo "# End of DTC configuration v0.17 : please don't touch this line !" >> $TMP_FILE2 - - cat < $TMP_FILE2 >>"$PATH_POSTFIX_ETC/master.cf" - rm $TMP_FILE2 - fi - fi - - # check to see if we have our amavis stuff configured in our master.cf yet - if grep "smtp-amavis" $PATH_POSTFIX_ETC/master.cf > /dev/null; then + if grep "Configured by DTC 0.21" "$PATH_POSTFIX_ETC/master.cf" >/dev/null; then if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Postfix master.cf has amavis configured before..." + echo "Postfix master.cf has been configured before, not adding maildrop options" fi else if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Adding amavis options to Postfix master.cf..." + echo "Inserting DTC configuration inside $PATH_POSTFIX_ETC/master.cf" fi + TMP_FILE2=`${MKTEMP} DTC_install.postfix_master.cf.XXXXXX` || exit 1 echo "# Configured by DTC v0.17 : Please don't touch this line !" > $TMP_FILE2 - + # if we have maildrop, we should use it! + if [ -n ""$PATH_USERDB_BIN -a -f "$PATH_USERDB_BIN" -a -n ""$PATH_MAILDROP_BIN -a -f "$PATH_MAILDROP_BIN" ]; then + echo "maildrop unix - n n - - pipe + flags=DRhu user=${CONF_DTC_SYSTEM_USERNAME} argv=$PATH_MAILDROP_BIN -d \${user}@\${nexthop} \${extension} \${recipient} \${user} \${nexthop} +" >> $TMP_FILE2 + fi + # CL do we use cyrus? + if [ ""$conf_use_cyrus = "true" ]; then + echo "cyrus unix - n n - - pipe + flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m \${extension} \${recipient}" >> $TMP_FILE2 + fi + + # Insert our amavis stuff inside the master.cf echo "# amavisd-new smtp-amavis unix - - - - 2 smtp -o smtp_data_done_timeout=1200 @@ -1713,10 +2788,15 @@ smtp-amavis unix - - - - 2 smtp -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks " >> $TMP_FILE2 - echo "# End of DTC configuration v0.17 : please don't touch this line !" >> $TMP_FILE2 + echo "# End of DTC configuration v0.17 : please don't touch this line !" >> $TMP_FILE2 cat < $TMP_FILE2 >>"$PATH_POSTFIX_ETC/master.cf" rm $TMP_FILE2 - + fi + # if we have maildrop, we should use it! + if [ -n ""$PATH_USERDB_BIN -a -f "$PATH_USERDB_BIN" -a -n ""$PATH_MAILDROP_BIN -a -f "$PATH_MAILDROP_BIN" ]; then + echo "virtual_transport = maildrop" >> $TMP_FILE + echo "## Set to 1 because Maildrop only delivers one message at a time. +maildrop_destination_recipient_limit = 1" >> $TMP_FILE fi echo "# End of DTC configuration v0.12 : please don't touch this line !" >> $TMP_FILE @@ -1730,18 +2810,30 @@ smtp-amavis unix - - - - 2 smtp rm $SASLTMP_FILE fi fi - fi # # prepare mlmmj environment to work with dtc # -if [ -f "/usr/bin/mlmmj-make-ml" ] -then +if [ -f "/usr/bin/mlmmj-make-ml" -o -f "/usr/bin/mlmmj-make-ml.sh" ] ; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Detected presence of mlmmj... prepping environment..." + fi + # symlink the .sh to the non .sh, for the genfiles + if [ ! -e "/usr/bin/mlmmj-make-ml" ] ; then + ln -s "/usr/bin/mlmmj-make-ml.sh" "/usr/bin/mlmmj-make-ml" + fi mkdir -p /etc/mlmmj/lists - chown -R root:65534 /etc/mlmmj/lists + chown -R root:${CONF_DTC_SYSTEM_GROUPNAME} /etc/mlmmj/lists chmod -R g+w /etc/mlmmj/lists fi +# create mlmmj spool directory if it doesn't exist yet +if [ ! -e /var/spool/mlmmj/ ]; then + mkdir -p /var/spool/mlmmj +fi +if [ -e /var/spool/mlmmj/ ] ;then + chown ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} /var/spool/mlmmj/ +fi # This avoid hanging when (re)starting daemons under debian if [ "$UNIX_TYPE" = "debian" ] @@ -1749,33 +2841,39 @@ then db_stop fi +# check to see if we have a userdb FILE, rather than a directory +# move it out of the way, if so +if [ -f "$PATH_COURIER_AUTHD_CONF_PATH/userdb" ]; then + mv $PATH_COURIER_AUTHD_CONF_PATH/userdb $PATH_COURIER_AUTHD_CONF_PATH/userdb.existing +fi + # # Install courier mysql authenticaion # -if [ -f "$PATH_COURIER_CONF_PATH/authdaemonrc" ] +if [ -f "$PATH_COURIER_AUTHD_CONF_PATH/authdaemonrc" ] then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Adding directives to Courier authdaemonrc" fi - if grep "Configured by DTC" $PATH_COURIER_CONF_PATH/authdaemonrc >/dev/null + if grep "Configured by DTC" $PATH_COURIER_AUTHD_CONF_PATH/authdaemonrc >/dev/null then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "authdaemonrc has been configure before: skipping include insertion !" fi else if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Inserting DTC configuration inside "$PATH_COURIER_CONF_PATH/authdaemonrc + echo "Inserting DTC configuration inside "$PATH_COURIER_AUTHD_CONF_PATH/authdaemonrc fi - if ! [ -f $PATH_COURIER_CONF_PATH.DTC.backup ] + if ! [ -f $PATH_COURIER_AUTHD_CONF_PATH.DTC.backup ] then - cp -f $PATH_COURIER_CONF_PATH/authdaemonrc $PATH_COURIER_CONF_PATH.DTC.backup + cp -f $PATH_COURIER_AUTHD_CONF_PATH/authdaemonrc $PATH_COURIER_AUTHD_CONF_PATH.DTC.backup fi TMP_FILE=`${MKTEMP} DTC_install.courier.conf.XXXXXX` || exit 1 echo "# Configured by DTC v0.12 : Please don't touch this line !" > $TMP_FILE echo "authmodulelist=\"authmysql authpam\"" >> $TMP_FILE echo "# End of DTC configuration v0.12 : please don't touch this line !" >> $TMP_FILE # now append this to the existing configuration file - cat < $TMP_FILE >> $PATH_COURIER_CONF_PATH/authdaemonrc + cat < $TMP_FILE >> $PATH_COURIER_AUTHD_CONF_PATH/authdaemonrc rm $TMP_FILE echo " # DB details for dtc mysql DB @@ -1796,12 +2894,23 @@ MYSQL_DEFAULT_DOMAIN $main_domain_name MYSQL_SELECT_CLAUSE SELECT concat(id, '@', mbox_host), crypt, passwd, uid, gid, home, '', quota_size, '' FROM pop_access WHERE (id = '\$(local_part)' AND mbox_host = '\$(domain)') OR (id = SUBSTRING_INDEX('\$(local_part)', '%', 1) AND mbox_host = SUBSTRING_INDEX('\$(local_part)', '%', -1)) MYSQL_CHPASS_CLAUSE UPDATE pop_access SET passwd='\$(newpass)', crypt='\$(newpass_crypt)' WHERE (id = '\$(local_part)' AND mbox_host = '\$(domain)') OR (id = SUBSTRING_INDEX('\$(local_part)', '%', 1) AND mbox_host = SUBSTRING_INDEX('\$(local_part)', '%', -1)) -" > $PATH_COURIER_CONF_PATH/authmysqlrc +" > $PATH_COURIER_AUTHD_CONF_PATH/authmysqlrc if [ -x "/etc/init.d/courier-authdaemon" ] ; then if [ -x /usr/sbin/invoke-rc.d ]; then /usr/sbin/invoke-rc.d courier-authdaemon restart else - /etc/init.d/courier-authdaemon restart + if [ -x /etc/init.d/courier-authdaemon ]; then + /etc/init.d/courier-authdaemon restart + fi + fi + fi + if [ -x "/etc/init.d/courier-authlib" ] ; then + if [ -x /usr/sbin/invoke-rc.d ]; then + /usr/sbin/invoke-rc.d courier-authlib restart + else + if [ -x /etc/init.d/courier-authlib ]; then + /etc/init.d/courier-authlib restart + fi fi fi if [ -x "/etc/init.d/courier-imap" ] ; then @@ -1818,9 +2927,31 @@ MYSQL_CHPASS_CLAUSE UPDATE pop_access SET passwd='\$(newpass)', crypt='\$(ne /etc/init.d/courier-pop restart fi fi + if [ -x "/etc/init.d/courier" ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + /usr/sbin/invoke-rc.d courier stop + else + /etc/init.d/courier stop + fi + fi + + # try to disable courierd using chkconfig + if [ -x /sbin/chkconfig ]; then + /sbin/chkconfig courier off + fi fi fi +# need to remove the paths for courier in /etc/profile.d/ +# since the MTA really breaks postfix paths and handling +if [ -e /etc/profile.d/courier.sh ]; then + mv /etc/profile.d/courier.sh /etc/profile.d/courier.sh.DTC.disabled +fi + +if [ -e /etc/profile.d/courier.csh ]; then + mv /etc/profile.d/courier.csh /etc/profile.d/courier.csh.DTC.disabled +fi + # Generate the OpenSSL test certificate if it does not exists if [ ""$conf_gen_ssl_cert = "true" ]; then if [ ! -e $PATH_DTC_ETC"/ssl" ]; then @@ -1831,20 +2962,28 @@ if [ ""$conf_gen_ssl_cert = "true" ]; then if [ ! -e "./"new.cert.csr ]; then if [ ! -e "./"new.cert.cert ]; then if [ ! -e "./"new.cert.key ]; then - CERTPASS_TMP_FILE=`${MKTEMP} certfilepass.XXXXXX` || exit 1 - echo $conf_gen_ssl_cert"" >$CERTPASS_TMP_FILE - ( echo $conf_cert_countrycode; - echo "the state"; - echo $conf_cert_locality; - echo $conf_cert_organization; - echo $conf_cert_unit; - echo $dtc_admin_subdomain"."$main_domain_name; - echo $conf_cert_email; - echo $conf_cert_challenge_pass; - echo $conf_cert_organization; ) | openssl req -passout file:$CERTPASS_TMP_FILE -new > new.cert.csr - openssl rsa -passin file:$CERTPASS_TMP_FILE -in privkey.pem -out new.cert.key - openssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 3650 - rm $CERTPASS_TMP_FILE + CERTPASS_TMP_FILE=`${MKTEMP} certfilepass.XXXXXX` || exit 1 + echo $conf_gen_ssl_cert"" >$CERTPASS_TMP_FILE + ( echo $conf_cert_countrycode; + echo "the state"; + echo $conf_cert_locality; + echo $conf_cert_organization; + echo $conf_cert_unit; + echo $dtc_admin_subdomain"."$main_domain_name; + echo $conf_cert_email; + echo $conf_cert_challenge_pass; + echo $conf_cert_organization; ) | openssl req -passout file:$CERTPASS_TMP_FILE -new > new.cert.csr + openssl rsa -passin file:$CERTPASS_TMP_FILE -in privkey.pem -out new.cert.key + openssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 3650 + rm $CERTPASS_TMP_FILE + # Copy the certificates to make them available for qmail + if [ -d /var/qmail/control ] ; then + if ! [ -e /var/qmail/control/servercert.pem ] ; then + cat $PATH_DTC_ETC/ssl/new.cert.key $PATH_DTC_ETC/ssl/new.cert.cert >/var/qmail/control/servercert.pem + chown qmaild:qmail /var/qmail/control/servercert.pem + chmod 400 /var/qmail/control/servercert.pem + fi + fi fi fi fi @@ -1856,6 +2995,21 @@ fi # if [ -f $PATH_DOVECOT_CONF ] then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Detecting dovecot version..." + fi + DOVECOT_VERSION=`dovecot --version` + DOVECOT_POSTONE=false + case $DOVECOT_VERSION in + 1.*) + echo "Found version 1.0 or greater" + DOVECOT_POSTONE=true + ;; + 0.*) + echo "Found pre 1.0 version" + ;; + + esac if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Adding directives to dovecot.conf" fi @@ -1865,22 +3019,70 @@ then echo "dovecot.conf has been configure before: skipping include insertion !" fi else - if [ ""$VERBOSE_INSTALL = "yes" ] ;then - echo "Inserting DTC configuration inside "$PATH_DOVECOT_CONF + + if [ ""$DOVECOT_POSTONE ]; then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Version 1.x needs a new config file... replacing existing" + fi + if ! [ -f $PATH_DOVECOT_CONF.DTC.backup ]; then + cp -f $PATH_DOVECOT_CONF $PATH_DOVECOT_CONF.DTC.backup + fi + echo " +# Configured by DTC v0.x : Please don't touch this line ! +protocols = imap imaps pop3 pop3s +default_mail_env = maildir:%h/Maildir +maildir_copy_with_hardlinks = yes +protocol imap { +} +protocol pop3 { +} +auth default { + mechanisms = plain + passdb pam { + args = \"*\" + } + userdb passwd { + } + user = root + userdb sql { + args = $PATH_DTC_ETC/dovecot-mysql.conf + } + passdb sql { + args = $PATH_DTC_ETC/dovecot-mysql.conf + } +} +plugin { +} +# End of DTC configuration v0.x : please don't touch this line ! +" > $PATH_DOVECOT_CONF + else + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Inserting DTC configuration inside "$PATH_DOVECOT_CONF + fi + if ! [ -f $PATH_DOVECOT_CONF.DTC.backup ] + then + cp -f $PATH_DOVECOT_CONF $PATH_DOVECOT_CONF.DTC.backup + fi + TMP_FILE=`${MKTEMP} DTC_install.dovecot.conf.XXXXXX` || exit 1 + echo "# Configured by DTC v0.12 : Please don't touch this line !" > $TMP_FILE + echo "auth_userdb = mysql $PATH_DTC_ETC/dovecot-mysql.conf" >> $TMP_FILE + echo "auth_passdb = mysql $PATH_DTC_ETC/dovecot-mysql.conf" >> $TMP_FILE + echo "# End of DTC configuration v0.12 : please don't touch this line !" >> $TMP_FILE + # now append this to the existing configuration file + cat < $TMP_FILE >> $PATH_DOVECOT_CONF + rm $TMP_FILE fi - if ! [ -f $PATH_DOVECOT_CONF.DTC.backup ] - then - cp -f $PATH_DOVECOT_CONF $PATH_DOVECOT_CONF.DTC.backup - fi - TMP_FILE=`${MKTEMP} DTC_install.dovecot.conf.XXXXXX` || exit 1 - echo "# Configured by DTC v0.12 : Please don't touch this line !" > $TMP_FILE - echo "auth_userdb = mysql $PATH_DTC_ETC/dovecot-mysql.conf" >> $TMP_FILE - echo "auth_passdb = mysql $PATH_DTC_ETC/dovecot-mysql.conf" >> $TMP_FILE - echo "# End of DTC configuration v0.12 : please don't touch this line !" >> $TMP_FILE - # now append this to the existing configuration file - cat < $TMP_FILE >> $PATH_DOVECOT_CONF - rm $TMP_FILE - echo " + if [ ""$DOVECOT_POSTONE ]; then + # there is a new configuration for 1.0.x + echo " +connect = host=$MYSQL_DB_SOCKET_PATH port=3306 dbname=$conf_mysql_db user=dtcdaemons password=${MYSQL_DTCDAEMONS_PASS} client_flags=0 +driver = mysql +default_pass_scheme = PLAIN +password_query = SELECT passwd AS password FROM pop_access WHERE id = '%n' AND mbox_host = '%d' +user_query = SELECT home, uid, gid FROM pop_access WHERE id = '%n' AND mbox_host = '%d' +" > $PATH_DTC_ETC/dovecot-mysql.conf + else + echo " # DB details for dtc mysql DB db_host = $conf_mysql_host db_port = 3306 @@ -1891,9 +3093,10 @@ db_passwd = ${MYSQL_DTCDAEMONS_PASS} db_client_flags = 0 default_pass_scheme = PLAIN -password_query = SELECT passwd FROM pop_access WHERE id = '%n' AND mbox_host = '%d' +password_query = SELECT passwd AS password FROM pop_access WHERE id = '%n' AND mbox_host = '%d' user_query = SELECT home, uid, gid FROM pop_access WHERE id = '%n' AND mbox_host = '%d' " > $PATH_DTC_ETC/dovecot-mysql.conf + fi # need to restart dovecot too if [ -x "/etc/init.d/dovecot" ] ; then /etc/init.d/dovecot restart @@ -1905,10 +3108,46 @@ user_query = SELECT home, uid, gid FROM pop_access WHERE id = '%n' AND mbox_host fi fi +# +# Install pure-ftpd-mysql +# +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Adding directives to pure-ftpd-mysql" +fi +PURE_FTPD_ETC="/etc/pure-ftpd" +if [ -e $PURE_FTPD_ETC ] ;then + if [ -e /etc/pure-ftpd/conf/ ] ;then + echo "yes" >/etc/pure-ftpd/conf/ChrootEveryone + fi + if [ -e $PURE_FTPD_ETC/db/ ] ;then + echo "# Configured by DTC v0.10 : Please don't touch this line ! + +MYSQLSocket /var/run/mysqld/mysqld.sock +MYSQLUser dtcdaemons +MYSQLPassword ${MYSQL_DTCDAEMONS_PASS} +MYSQLDatabase dtc +MYSQLCrypt cleartext +MYSQLGetPW SELECT password FROM ftp_access WHERE login=\"\L\" +MYSQLGetUID SELECT uid FROM ftp_access WHERE login=\"\L\" +MYSQLGetGID SELECT gid FROM ftp_access WHERE login=\"\L\" +MYSQLGetDir SELECT homedir FROM ftp_access WHERE login=\"\L\" + +" >$PURE_FTPD_ETC/db/mysql.conf; + if [ -x /usr/sbin/invoke-rc.d ]; then + /usr/sbin/invoke-rc.d pure-ftpd-mysql restart + else + if [ -x /etc/init.d/pure-ftpd-mysql ] ;then + /etc/init.d/pure-ftpd-mysql restart + fi + fi + fi +fi # # Install proftpd.conf to access to the database # + +if [ -f $PATH_PROFTPD_CONF ]; then if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "===> Adding directives to proftpd.conf" fi @@ -1925,16 +3164,70 @@ else then cp -f $PATH_PROFTPD_CONF $PATH_PROFTPD_CONF.DTC.backup fi + + # Generate the OpenSSL test certificate if it does not exists + if [ ""$conf_gen_ssl_cert = "true" ]; then + if [ ! -e $PATH_DTC_ETC"/ssl" ]; then + mkdir -p $PATH_DTC_ETC"/ssl" + fi + if [ ! -e $PATH_DTC_ETC"/ssl/proftpd" ] ; then + mkdir -p $PATH_DTC_ETC"/ssl/proftpd" + fi + cwd=`pwd` + cd $PATH_DTC_ETC"/ssl/proftpd" + if [ ! -e "./"new.cert.csr ]; then + if [ ! -e "./"new.cert.cert ]; then + if [ ! -e "./"new.cert.key ]; then + CERTPASS_TMP_FILE=`${MKTEMP} certfilepass.XXXXXX` || exit 1 + echo $conf_gen_ssl_cert"" >$CERTPASS_TMP_FILE + ( echo $conf_cert_countrycode; + echo "the state"; + echo $conf_cert_locality; + echo $conf_cert_organization; + echo $conf_cert_unit; + echo $dtc_admin_subdomain"."$main_domain_name; + echo $conf_cert_email; + echo $conf_cert_challenge_pass; + echo $conf_cert_organization; ) | openssl req -passout file:$CERTPASS_TMP_FILE -new > new.cert.csr + openssl rsa -passin file:$CERTPASS_TMP_FILE -in privkey.pem -out new.cert.key + openssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 3650 + rm $CERTPASS_TMP_FILE + fi + fi + fi + cd $cwd + fi + + # need to comment out any existing AuthOrder, since we are changing it + perl -i -p -e 's/AuthOrder/#AuthOrder/' $PATH_PROFTPD_CONF + TMP_FILE=`${MKTEMP} DTC_install.proftp.conf.XXXXXX` || exit 1 echo "# Configured by DTC v0.10 : Please don't touch this line !" > $TMP_FILE # This directive is not used anymore in newer version of proftpd # echo "#UserReverseDNS off" >> $TMP_FILE + echo "AuthOrder mod_sql.c mod_auth_pam.c* mod_auth_unix.c" >> $TMP_FILE echo "IdentLookups off" >> $TMP_FILE echo "DefaultRoot ~" >> $TMP_FILE echo "SQLAuthenticate on" >> $TMP_FILE echo "SQLConnectInfo "$conf_mysql_db"@"$conf_mysql_host" dtcdaemons "${MYSQL_DTCDAEMONS_PASS} >> $TMP_FILE echo "SQLAuthTypes Plaintext" >> $TMP_FILE echo "SQLUserInfo ftp_access login password uid gid homedir shell" >> $TMP_FILE + if [ -e $PATH_DTC_ETC"/ssl/proftpd/new.cert.cert" ] ; then + if [ -e $PATH_DTC_ETC"/ssl/proftpd/new.cert.key" ] ; then + if [ ""$conf_gen_ssl_cert = "true" ]; then + echo "# This is the TLS auth support. Thanks to Erwan Gurcuff (gort) for the tip! + + TLSEngine on + TLSLog /var/log/proftpd-tls.log + TLSProtocol TLSv1 + TLSRequired off + TLSRSACertificateFile "$PATH_DTC_ETC"/ssl/proftpd/new.cert.cert + TLSRSACertificateKeyFile "$PATH_DTC_ETC"/ssl/proftpd/new.cert.key + TLSVerifyClient on +" >> $TMP_FILE + fi + fi + fi echo "# // Transfer Log to Proftpd SQLLog RETR,STOR transfer1 SQLNamedQuery transfer1 INSERT \"'%u', '%f', '%b', '%h', '%a', '%m', '%T',now(), 'c', NULL\" ftp_logs @@ -1969,13 +3262,14 @@ SQLNamedQuery ulcount UPDATE \"ul_count=ul_count+1 WHERE login='%u'\" ft # This restarts proftpd if under debian like system # work has to be done under other OS to restart the ftp daemon if [ -x "/etc/init.d/proftpd" ] ; then - if [ -x /usr/sbin/invoke-rc.d ]; then - /usr/sbin/invoke-rc.d proftpd restart + if [ -x "`which /usr/sbin/invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d proftpd restart else /etc/init.d/proftpd restart fi fi fi +fi # # Install and configuration of FreeRadius 1.0 @@ -2009,7 +3303,7 @@ if [ -e ""$FREERADIUS_ETC ] ;then TMP_FILE6=`${MKTEMP} DTC_install.radius.conf.XXXXXX` || exit 1 if [ -e /var/log/radacct ] ;then - chown -R nobody /var/log/radacct + chown -R ${CONF_DTC_SYSTEM_USERNAME} /var/log/radacct fi sed "s/#user = nobody/user = nobody/" $FREERADIUS_CONF >$TMP_FILE @@ -2091,7 +3385,334 @@ if [ -f $PATH_AWSTATS_ETC/awstats.conf ]; then fi # -# Install the cron php4 script in the $PATH_CRONTAB_CONF +# create the rrd file for queuegraph.cgi +# +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Setting up rrdtools and graphs" +fi +if [ ! -e $PATH_DTC_ETC/mailqueues.rrd ]; then + $PATH_DTC_ADMIN/queuegraph/createrrd.sh $PATH_DTC_ETC +fi +if [ ! -e $PATH_CGIBIN/queuegraph.cgi ]; then + ln -s $PATH_DTC_ADMIN/queuegraph.cgi $PATH_CGIBIN/queuegraph.cgi +fi +if [ -e $PATH_CGIBIN/queuegraph.cgi ]; then + chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_CGIBIN/queuegraph.cgi +fi + + + +# fix path for mailqueues.rrd +perl -i -p -e "s|/etc/postfix|$PATH_DTC_ETC|" $PATH_DTC_ADMIN/queuegraph.cgi + +if [ -z "$conf_eth2monitor" ] ; then + echo "No interface selected: skiping the netusage.rrd setup!!!" +else + # + # create the rrd file for netusegraph.cgi + # + if [ ! -e $PATH_DTC_ETC/netusage.rrd ]; then + $PATH_DTC_ADMIN/netusegraph/createrrd.sh $PATH_DTC_ETC + fi + if [ ! -e $PATH_CGIBIN/netusegraph.cgi ]; then + ln -s $PATH_DTC_ADMIN/netusegraph.cgi $PATH_CGIBIN/netusegraph.cgi + fi + + if [ -e $PATH_CGIBIN/netusegraph.cgi ]; then + # fix path for netusage.rrd + perl -i -p -e "s|/etc/postfix|$PATH_DTC_ETC|" $PATH_DTC_ADMIN/netusegraph.cgi + chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_CGIBIN/netusegraph.cgi + fi +fi + +# +# create the rrd file for cpugraph.cgi +# +if [ ! -e $PATH_DTC_ETC/cpu.rrd ]; then + $PATH_DTC_ADMIN/cpugraph/createrrd.sh $PATH_DTC_ETC +fi +if [ ! -e $PATH_CGIBIN/cpugraph.cgi ]; then + ln -s $PATH_DTC_ADMIN/cpugraph.cgi $PATH_CGIBIN/cpugraph.cgi +fi + +if [ -e $PATH_DTC_ADMIN/cpugraph.cgi ]; then + # fix path for cpugraph.cgi + perl -i -p -e "s|/etc/postfix|$PATH_DTC_ETC|" $PATH_DTC_ADMIN/cpugraph.cgi + chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_CGIBIN/cpugraph.cgi +fi + + +# +# Create the rrd file for memgraph.cgi +# +if [ ! -e $PATH_DTC_ETC/memusage.rrd ]; then + $PATH_DTC_ADMIN/memgraph/createrrd.sh $PATH_DTC_ETC +fi +if [ ! -e $PATH_CGIBIN/memgraph.cgi ]; then + ln -s $PATH_DTC_ADMIN/memgraph.cgi $PATH_CGIBIN/memgraph.cgi +fi +if [ -e $PATH_DTC_ADMIN/memgraph.cgi ]; then + # fix path for memgraph.cgi + perl -i -p -e "s|/etc/postfix|$PATH_DTC_ETC|" $PATH_DTC_ADMIN/memgraph.cgi + chown -hR ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} $PATH_CGIBIN/memgraph.cgi +fi + +# +# Modify the SSH default option to make sure the UsePAM and turn on Password auth +# + +# default to /etc/ssh/sshd_config if it's not set by the installer +if [ -z ""$PATH_SSH_CONF ]; then + PATH_SSH_CONF=/etc/ssh/sshd_config +fi + +if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Modifying SSH config to allow chroot logins... "$PATH_SSH_CONF +fi + +# first we want to comment out any previously set variables +# PasswordAuthentication +# UsePAM + +TMP_FILE=`${MKTEMP} DTC_install.sshd_conf.XXXXXX` || exit 1 + +if grep "^PasswordAuthentication" $PATH_SSH_CONF >/dev/null 2>&1 +then + sed -e "s/^PasswordAuthentication/#PasswordAuthentication/" $PATH_SSH_CONF > $TMP_FILE + cat <$TMP_FILE >$PATH_SSH_CONF +fi + +if grep "^UsePAM" $PATH_SSH_CONF >/dev/null 2>&1 +then + sed -e "s/^UsePAM/#UsePAM/" $PATH_SSH_CONF > $TMP_FILE + cat <$TMP_FILE >$PATH_SSH_CONF +fi + +# now that we have removed the conflicting entries, add it back with the DTC required switches + +if grep "Configured by DTC" $PATH_SSH_CONF >/dev/null +then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$PATH_SSH_CONF has been configured before..." + fi +else + if ! [ -f $PATH_SSH_CONF.DTC.backup ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Backuping "$PATH_SSH_CONF + fi + cp -f "$PATH_SSH_CONF" "$PATH_SSH_CONF.DTC.backup" + fi + echo "# Configured by DTC 0.21 : please do not touch this line !" > $TMP_FILE + echo "UsePAM yes" >> $TMP_FILE + echo "PasswordAuthentication yes" >> $TMP_FILE + echo "# End of DTC configuration : please don't touch this line !" >> $TMP_FILE + cat <$TMP_FILE >>$PATH_SSH_CONF +fi + +rm $TMP_FILE + +# +# Modify /etc/nsswitch.conf +# +TMP_FILE=`${MKTEMP} DTC_install.nsswitch.conf.XXXXXX` || exit 1 + +if [ -z "$PATH_NSSWITCH_CONF" ]; then + PATH_NSSWITCH_CONF=/etc/nsswitch.conf +fi + +if grep "Configured by DTC" $PATH_NSSWITCH_CONF >/dev/null +then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$PATH_NSSWITCH_CONF has been configured before..." + fi +else + if ! [ -f $PATH_NSSWITCH_CONF.DTC.backup ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Backuping "$PATH_NSSWITCH_CONF + fi + cp -f "$PATH_NSSWITCH_CONF" "$PATH_NSSWITCH_CONF.DTC.backup" + fi + echo "# Configured by DTC 0.21 : please do not touch this line !" > $TMP_FILE + echo " +passwd: compat mysql +group: compat mysql +shadow: compat mysql +" >> $TMP_FILE + echo "# End of DTC configuration : please don't touch this line !" >> $TMP_FILE + cat <$TMP_FILE >>$PATH_NSSWITCH_CONF +fi + +rm $TMP_FILE + +# +# Modify /etc/nss-mysql.conf and /etc/nss-mysql-root.conf +# + +TMP_FILE=`${MKTEMP} DTC_install.nss-mysql.conf.XXXXXX` || exit 1 + +if [ -z "$PATH_NSS_CONF" ]; then + PATH_NSS_CONF=/etc/nss-mysql.conf +fi + +if [ -z "$PATH_NSS_ROOT_CONF" ]; then + PATH_NSS_ROOT_CONF=/etc/nss-mysql-root.conf +fi + +NSSMYSQL_VERSION=nss-mysql + +if [ ! -e $PATH_NSS_CONF ]; then + if [ -e /etc/libnss-mysql.cfg ]; then + PATH_NSS_CONF=/etc/libnss-mysql.cfg + NSSMYSQL_VERSION=libnss-mysql + # mv the existing config out of the way + mv $PATH_NSS_CONF $PATH_NSS_CONF.before.dtc + fi +fi + +if [ ! -e $PATH_NSS_ROOT_CONF ]; then + if [ -e /etc/libnss-mysql-root.cfg ]; then + PATH_NSS_ROOT_CONF=/etc/libnss-mysql-root.cfg + NSSMYSQL_VERSION=libnss-mysql + mv $PATH_NSS_ROOT_CONF $PATH_NSS_ROOT_CONF.before.dtc + fi +fi + +if grep "Configured by DTC" $PATH_NSS_CONF >/dev/null +then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$PATH_NSS_CONF has been configured before..." + fi +else + if ! [ -f $PATH_NSS_CONF.DTC.backup ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Backuping "$PATH_NSS_CONF + fi + cp -f "$PATH_NSS_CONF" "$PATH_NSS_CONF.DTC.backup" + fi + + echo "# Configured by DTC 0.21 : please do not touch this line !" > $TMP_FILE + if [ ""$NSSMYSQL_VERSION = "nss-mysql" ]; then + echo " +users.host = inet:localhost:3306; +users.database = ${conf_mysql_db}; +users.db_user = dtcdaemons; +users.db_password = ${MYSQL_DTCDAEMONS_PASS}; +users.backup_host =; +users.backup_database =; +users.table = ssh_access; +users.where_clause =; +users.user_column = ssh_access.login; +users.password_column = ssh_access.crypt; +users.userid_column = ssh_access.uid; +users.uid_column = ssh_access.uid; +users.gid_column = ssh_access.gid; +users.realname_column = \"DTC User\"; +users.homedir_column = ssh_access.homedir; +users.shell_column = ssh_access.shell; +groups.group_info_table = ssh_groups; +groups.where_clause =; +groups.group_name_column = ssh_groups.group_name; +groups.groupid_column = ssh_groups.group_id; +groups.gid_column = ssh_groups.gid; +groups.password_column = ssh_groups.group_password; +groups.members_table = ssh_user_group; +groups.member_userid_column = ssh_user_group.user_id; +groups.member_groupid_column = ssh_user_group.group_id; +" >> $TMP_FILE + else + # this is the libnss version + echo " +[queries] +getpwnam SELECT login,'*',uid,gid,'DTC User',homedir,shell FROM ssh_access WHERE login='%1$s' LIMIT 1 +getpwuid SELECT login,'*',uid,gid,'DTC User',homedir,shell FROM ssh_access WHERE uid='%1$u' LIMIT 1 +getpwent SELECT login,'*',uid,gid,'DTC User',homedir,shell FROM ssh_access +getgrnam SELECT group_name,group_password,group_id FROM ssh_groups WHERE group_name='%1$s' LIMIT 1 +getgrgid SELECT group_name,group_password,group_id FROM ssh_groups WHERE group_id='%1$u' LIMIT 1 +getgrent SELECT group_name,group_password,group_id FROM ssh_groups +memsbygid SELECT login FROM ssh_access WHERE gid='%1$u' +gidsbymem SELECT gid FROM ssh_access WHERE login='%1$s' +getspnam SELECT login,crypt,UNIX_TIMESTAMP() - 10,1,2,7,-1,-1,0 FROM ssh_access WHERE ssh_access.login='%1$s' LIMIT 1 +getspent SELECT login,crypt,UNIX_TIMESTAMP() - 10,1,2,7,-1,-1,0 FROM ssh_access + +[server] +host localhost +port 3306 +database ${conf_mysql_db} +username dtcdaemons +password ${MYSQL_DTCDAEMONS_PASS} +" >> $TMP_FILE + + fi + echo "# End of DTC configuration : please don't touch this line !" >> $TMP_FILE + cat <$TMP_FILE >>$PATH_NSS_CONF +fi + +# fix perm for the nss root configuration +chmod 400 $PATH_NSS_CONF + +if grep "Configured by DTC" $PATH_NSS_ROOT_CONF >/dev/null +then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "$PATH_NSS_ROOT_CONF has been configured before..." + fi +else + if ! [ -f $PATH_NSS_ROOT_CONF.DTC.backup ] + then + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "===> Backuping "$PATH_NSS_ROOT_CONF + fi + cp -f "$PATH_NSS_ROOT_CONF" "$PATH_NSS_ROOT_CONF.DTC.backup" + fi + echo "# Configured by DTC 0.21 : please do not touch this line !" > $TMP_FILE + if [ ""$NSSMYSQL_VERSION = "nss-mysql" ]; then + echo " +shadow.host = inet:localhost:3306; +shadow.database = ${conf_mysql_db}; +shadow.db_user = dtcdaemons; +shadow.db_password = ${MYSQL_DTCDAEMONS_PASS}; +shadow.backup_host =; +shadow.backup_database =; +shadow.table = ssh_access; +shadow.where_clause =; +shadow.userid_column = ssh_access.uid; +shadow.user_column = ssh_access.login; +shadow.password_column = ssh_access.crypt; +shadow.lastchange_column = UNIX_TIMESTAMP()-10; +shadow.min_column = 1; +shadow.max_column = 2; +shadow.warn_column = 7; +shadow.inact_column = -1; +shadow.expire_column = -1; +" >> $TMP_FILE + else + # libnss version + echo "[server] +host localhost +port 3306 +database ${conf_mysql_db} +username dtcdaemons +password ${MYSQL_DTCDAEMONS_PASS} +" >> $TMP_FILE + + fi + + echo "# End of DTC configuration : please don't touch this line !" >> $TMP_FILE + cat <$TMP_FILE >>$PATH_NSS_ROOT_CONF +fi + +# fix perm for the nss root configuration +chmod 400 $PATH_NSS_ROOT_CONF + +rm $TMP_FILE + + + + +# +# Install the cron php4 scripts in the $PATH_CRONTAB_CONF # # just in case we haven't specified PATH_CRONTAB_CONF, default to /etc/crontab @@ -2117,7 +3738,23 @@ else fi TMP_FILE=`${MKTEMP} DTC_install.crontab.XXXXXX` || exit 1 echo "# Configured by DTC v0.10 : Please don't touch this line !" > $TMP_FILE - echo "00,10,20,30,40,50 * * * * root cd $PATH_DTC_ADMIN; $PATH_PHP_CGI $PATH_DTC_ADMIN/cron.php >>/var/log/dtc.log" >> $TMP_FILE + # Under Debian, we use cron.d in the rules file as much as possible + # (unfortunatly, I don't know if it's possible to make it dynamic) + if [ ! ""$UNIX_TYPE = "debian" ] ; then + echo "00,10,20,30,40,50 * * * * root cd $PATH_DTC_ADMIN; $PATH_PHP_CGI $PATH_DTC_ADMIN/cron.php >>/var/log/dtc.log" >> $TMP_FILE + echo "9 4 * * * ${CONF_DTC_SYSTEM_USERNAME} cd $PATH_DTC_ADMIN; nice -n+20 $PATH_PHP_CGI $PATH_DTC_ADMIN/accesslog.php" >> $TMP_FILE + echo "* * * * * root cd $PATH_DTC_ADMIN; nice -n+20 $PATH_DTC_ADMIN/cpugraph/get_cpu_load.sh $PATH_DTC_ETC >>/var/log/dtc.log" >> $TMP_FILE + echo "* * * * * root cd $PATH_DTC_ADMIN; nice -n+20 $PATH_DTC_ADMIN/netusegraph/get_net_usage.sh $PATH_DTC_ETC \"$conf_eth2monitor\" >>/var/log/dtc.log" >> $TMP_FILE + echo "* * * * * root cd $PATH_DTC_ADMIN; nice -n+20 $PATH_DTC_ADMIN/memgraph/get_meminfo.sh $PATH_DTC_ETC >>/var/log/dtc.log" >> $TMP_FILE + echo "9 3 * * * root cd $PATH_DTC_ADMIN; $PATH_PHP_CGI $PATH_DTC_ADMIN/reminders.php" >> $TMP_FILE + fi + + if [ ""$conf_mta_type = "postfix" -o ""$conf_mta_type = "p" ]; then + echo "* * * * * root cd $PATH_DTC_ADMIN; $PATH_DTC_ADMIN/queuegraph/count_postfix.sh $PATH_DTC_ETC >>/var/log/dtc.log" >> $TMP_FILE + fi + if [ ""$conf_mta_type = "qmail" -o ""$conf_mta_type = "q" ]; then + echo "* * * * * root cd $PATH_DTC_ADMIN; nice -n+20 $PATH_DTC_ADMIN/queuegraph/count_qmail.sh $PATH_DTC_ETC >>/var/log/dtc.log" >> $TMP_FILE + fi cat < $TMP_FILE >>/etc/crontab rm $TMP_FILE fi @@ -2137,7 +3774,15 @@ else if [ -e "/usr/bin/htpasswd" ] ;then HTPASSWD="/usr/bin/htpasswd" else - HTPASSWD="htpasswd" + if [ -e "/usr/sbin/htpasswd" ] ;then + HTPASSWD="/usr/sbin/htpasswd" + else + if [ -e "/usr/sbin/htpasswd2" ] ;then + HTPASSWD="/usr/sbin/htpasswd2" + else + HTPASSWD="htpasswd" + fi + fi fi fi $HTPASSWD -cb "$conf_hosting_path"/.htpasswd "$conf_adm_login" $conf_adm_pass @@ -2157,6 +3802,15 @@ AuthUserFile "$conf_hosting_path"/.htpasswd require valid-user" >$PATH_DTC_ADMIN/.htaccess fi +# Alias the ncftp login file in etc to the path of the DTC /etc +if [ ! -e /etc/ncftpput_login.cfg ] ; then + ln -s $PATH_DTC_ETC/ncftpput_login.cfg /etc/ncftpput_login.cfg +fi + +# Chown the imgcache folder so the script can write in it +chown -R ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} ${PATH_DTC_SHARED}/shared/imgcache +chown -R ${CONF_DTC_SYSTEM_USERNAME}:${CONF_DTC_SYSTEM_GROUPNAME} ${PATH_DTC_ETC} + if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "***********************************************************" echo "*** Please wait while DTC configures all the daemons... ***" @@ -2169,16 +3823,34 @@ else echo "done!" fi +if [ ""$conf_report_setup = "true" ]; then + if [ -e /usr/bin/wget ] ; then + WGET="/usr/bin/wget" + else + WGET=`which wget` + fi + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Reporting install using $WGET -b -q --output-document=/dev/null http://www.gplhost.com/dtc-install-stats.php?ostype=${UNIX_TYPE}" + fi + $WGET -b -q --output-document=/dev/null "http://www.gplhost.com/dtc-install-stats.php?ostype=${UNIX_TYPE}" -o /dev/null >/dev/null +else + if [ ""$VERBOSE_INSTALL = "yes" ] ;then + echo "Not reporting install this time..." + fi +fi + echo "" -echo "Browse to: \"http(s)://"$dtc_admin_subdomain"."$main_domain_name"/dtcadmin/\"" +echo "Browse to: \"http://"$dtc_admin_subdomain"."$main_domain_name"/dtcadmin/\"" +echo " or to: \"https://"$dtc_admin_subdomain"."$main_domain_name"/dtcadmin/\"" echo "with login/pass of the main domain admin." echo "Remember to relaunch this installer if you" echo "install some other mail servers, whatever" echo "it is (qmail, postfix, courier, etc...)." +echo "NOTE: please check sshd_config and then restart ssh" if [ ""$VERBOSE_INSTALL = "yes" ] ;then echo "" echo "Visit DTC Home page" fi -echo "http://www.gplhost.com/?rub=softwares&sousrub=dtc" +echo "http://www.gplhost.com/software-dtc.html" exit 0 diff --git a/sysutils/dtc/pkg-descr b/sysutils/dtc/pkg-descr index 2530fbfeae6f..d48987979cd7 100644 --- a/sysutils/dtc/pkg-descr +++ b/sysutils/dtc/pkg-descr @@ -12,7 +12,7 @@ monitor all trafic accounting per user and per service. Since version 0.12, DTC is fully skinable and translated in 7 language (Chinese, English, Spanish, French, Deuch, German and Russian). -WWW: http://www.gplhost.com/?rub=softwares&sousrub=dtc +WWW: http://www.gplhost.com/software-dtc.html - Thomas GOIRAND thomas@goirand.fr diff --git a/sysutils/dtc/pkg-plist b/sysutils/dtc/pkg-plist index 7e670ff3be72..6617b5554045 100644 --- a/sysutils/dtc/pkg-plist +++ b/sysutils/dtc/pkg-plist @@ -1,54 +1,93 @@ -%%DTCROOT%%/Makefile %%DTCROOT%%/admin/checkbind.sh %%DTCROOT%%/admin/404.php -%%DTCROOT%%/admin/dtcrm/main.php -%%DTCROOT%%/admin/dtcrm/product_manager.php -%%DTCROOT%%/admin/dtcrm/submit_to_sql.php +%%DTCROOT%%/admin/cpugraph/createrrd.sh +%%DTCROOT%%/admin/cpugraph/get_cpu_load.sh +%%DTCROOT%%/admin/accesslog.php %%DTCROOT%%/admin/bw_per_month.php +%%DTCROOT%%/admin/cpugraph.cgi %%DTCROOT%%/admin/cron.php %%DTCROOT%%/admin/deamons_state.php %%DTCROOT%%/admin/deamons_state_strings.php %%DTCROOT%%/admin/favicon.ico %%DTCROOT%%/admin/index.php +%%DTCROOT%%/admin/mailgraph.cgi +%%DTCROOT%%/admin/memgraph.cgi +%%DTCROOT%%/admin/netusegraph.cgi +%%DTCROOT%%/admin/patch_saslatuhd_startup +%%DTCROOT%%/admin/queuegraph.cgi +%%DTCROOT%%/admin/reminders.php +%%DTCROOT%%/admin/updateChroot.sh %%DTCROOT%%/admin/view_waitingusers.php +%%DTCROOT%%/admin/dtcrm/main.php +%%DTCROOT%%/admin/dtcrm/product_manager.php +%%DTCROOT%%/admin/dtcrm/submit_to_sql.php +%%DTCROOT%%/admin/genfiles/change_debconf_domain.sh +%%DTCROOT%%/admin/genfiles/change_debconf_ip.sh +%%DTCROOT%%/admin/genfiles/gen_awstats.php %%DTCROOT%%/admin/genfiles/gen_backup_script.php %%DTCROOT%%/admin/genfiles/gen_email_account.php %%DTCROOT%%/admin/genfiles/gen_maildrop_userdb.php +%%DTCROOT%%/admin/genfiles/gen_mailfilter.sh %%DTCROOT%%/admin/genfiles/gen_named_files.php %%DTCROOT%%/admin/genfiles/gen_perso_vhost.php %%DTCROOT%%/admin/genfiles/gen_postfix_email_account.php %%DTCROOT%%/admin/genfiles/gen_pro_vhost.php %%DTCROOT%%/admin/genfiles/gen_qmail_email_account.php %%DTCROOT%%/admin/genfiles/gen_sasl.sh +%%DTCROOT%%/admin/genfiles/gen_ssh_account.php %%DTCROOT%%/admin/genfiles/gen_webalizer_stat.php %%DTCROOT%%/admin/genfiles/genfiles.php +%%DTCROOT%%/admin/genfiles/mailfilter_vacation_template %%DTCROOT%%/admin/genfiles/remote_mail_list.php -%%DTCROOT%%/admin/genfiles/gen_awstats.php -%%DTCROOT%%/admin/genfiles/gen_mailfilter.sh +%%DTCROOT%%/admin/genfiles/gen_customer_ssl_cert.sh +%%DTCROOT%%/admin/inc/adddomain.png +%%DTCROOT%%/admin/inc/databases.png +%%DTCROOT%%/admin/inc/dedic-server.png %%DTCROOT%%/admin/inc/domains.png -%%DTCROOT%%/admin/inc/ftp-accounts.png %%DTCROOT%%/admin/inc/draw_user_admin.php %%DTCROOT%%/admin/inc/dtc_config.php %%DTCROOT%%/admin/inc/dtc_config_strings.php -%%DTCROOT%%/admin/inc/mailboxs.png %%DTCROOT%%/admin/inc/folder.png +%%DTCROOT%%/admin/inc/ftp-accounts.png %%DTCROOT%%/admin/inc/help.png %%DTCROOT%%/admin/inc/img.php -%%DTCROOT%%/admin/inc/my-account.png -%%DTCROOT%%/admin/inc/nav.php -%%DTCROOT%%/admin/inc/package-installer.png -%%DTCROOT%%/admin/inc/submit_root_querys.php -%%DTCROOT%%/admin/inc/adddomain.png -%%DTCROOT%%/admin/inc/arial.ttf -%%DTCROOT%%/admin/inc/databases.png +%%DTCROOT%%/admin/inc/img_alt.php +%%DTCROOT%%/admin/inc/img_alt_skin.php +%%DTCROOT%%/admin/inc/imglong.png +%%DTCROOT%%/admin/inc/imgshort.png +%%DTCROOT%%/admin/inc/mailboxs.png %%DTCROOT%%/admin/inc/mailing-lists.png +%%DTCROOT%%/admin/inc/my-account.png %%DTCROOT%%/admin/inc/nameservers.png +%%DTCROOT%%/admin/inc/nav.php %%DTCROOT%%/admin/inc/nickhandles.png +%%DTCROOT%%/admin/inc/package-installer.png %%DTCROOT%%/admin/inc/password.png %%DTCROOT%%/admin/inc/reseller.png +%%DTCROOT%%/admin/inc/ssh-accounts.png %%DTCROOT%%/admin/inc/stats.png %%DTCROOT%%/admin/inc/subdomains.png +%%DTCROOT%%/admin/inc/submit_root_querys.php +%%DTCROOT%%/admin/inc/ticket.png %%DTCROOT%%/admin/inc/tools.png +%%DTCROOT%%/admin/inc/virtual-server.png +%%DTCROOT%%/admin/memgraph/createrrd.sh +%%DTCROOT%%/admin/memgraph/get_meminfo.sh +%%DTCROOT%%/admin/netusegraph/createrrd.sh +%%DTCROOT%%/admin/netusegraph/get_net_usage.sh +%%DTCROOT%%/admin/queuegraph/count_postfix.sh +%%DTCROOT%%/admin/queuegraph/count_qmail.sh +%%DTCROOT%%/admin/queuegraph/createrrd.sh +%%DTCROOT%%/admin/reminders_msg/shared_expired_already.txt +%%DTCROOT%%/admin/reminders_msg/shared_expired_last_warning.txt +%%DTCROOT%%/admin/reminders_msg/shared_expired_shutdown.txt +%%DTCROOT%%/admin/reminders_msg/shared_expired_today.txt +%%DTCROOT%%/admin/reminders_msg/shared_will_expire.txt +%%DTCROOT%%/admin/reminders_msg/vps_expired_already.txt +%%DTCROOT%%/admin/reminders_msg/vps_expired_last_warning.txt +%%DTCROOT%%/admin/reminders_msg/vps_expired_shutdown.txt +%%DTCROOT%%/admin/reminders_msg/vps_expired_today.txt +%%DTCROOT%%/admin/reminders_msg/vps_will_expire.txt %%DTCROOT%%/admin/tables/admin.sql %%DTCROOT%%/admin/tables/backup.sql %%DTCROOT%%/admin/tables/clients.sql @@ -65,22 +104,37 @@ %%DTCROOT%%/admin/tables/groups.sql %%DTCROOT%%/admin/tables/handle.sql %%DTCROOT%%/admin/tables/http_accounting.sql +%%DTCROOT%%/admin/tables/ip_port_service.sql +%%DTCROOT%%/admin/tables/mailinglist.sql %%DTCROOT%%/admin/tables/nameservers.sql %%DTCROOT%%/admin/tables/new_admin.sql %%DTCROOT%%/admin/tables/paiement.sql %%DTCROOT%%/admin/tables/pending_queries.sql +%%DTCROOT%%/admin/tables/pending_renewal.sql %%DTCROOT%%/admin/tables/pop_access.sql %%DTCROOT%%/admin/tables/product.sql %%DTCROOT%%/admin/tables/secpayconf.sql %%DTCROOT%%/admin/tables/smtp_logs.sql +%%DTCROOT%%/admin/tables/ssh_access.sql +%%DTCROOT%%/admin/tables/ssh_groups.sql +%%DTCROOT%%/admin/tables/ssh_user_group.sql %%DTCROOT%%/admin/tables/subdomain.sql +%%DTCROOT%%/admin/tables/tik_admins.sql +%%DTCROOT%%/admin/tables/tik_cats.sql +%%DTCROOT%%/admin/tables/tik_queries.sql +%%DTCROOT%%/admin/tables/vps.sql +%%DTCROOT%%/admin/tables/vps_ip.sql +%%DTCROOT%%/admin/tables/vps_server.sql %%DTCROOT%%/admin/tables/whitelist.sql %%DTCROOT%%/admin/tables/whois.sql -%%DTCROOT%%/admin/tables/mailinglist.sql +%%DTCROOT%%/admin/tables/scheduled_updates.sql +%%DTCROOT%%/admin/ip_change.sh %%DTCROOT%%/admin/dtc_db.php %%DTCROOT%%/admin/restor_db.php %%DTCROOT%%/client/bw_per_month.php %%DTCROOT%%/client/dynip.php +%%DTCROOT%%/client/enets-notify.php +%%DTCROOT%%/client/enets_pay_icon.gif %%DTCROOT%%/client/favicon.ico %%DTCROOT%%/client/img2.php %%DTCROOT%%/client/index.php @@ -88,39 +142,46 @@ %%DTCROOT%%/client/login.php %%DTCROOT%%/client/new_account.php %%DTCROOT%%/client/new_account_form.php +%%DTCROOT%%/client/new_account_renewal.php %%DTCROOT%%/client/paypal.php %%DTCROOT%%/client/secpaycallback_worldpay.php +%%DTCROOT%%/client/inc/adddomain.png %%DTCROOT%%/client/inc/database.png +%%DTCROOT%%/client/inc/databases.png +%%DTCROOT%%/client/inc/dedic-server.png %%DTCROOT%%/client/inc/dns.png %%DTCROOT%%/client/inc/domain.png +%%DTCROOT%%/client/inc/domains.png %%DTCROOT%%/client/inc/floppy.png %%DTCROOT%%/client/inc/folder.png +%%DTCROOT%%/client/inc/ftp-accounts.png %%DTCROOT%%/client/inc/help.png %%DTCROOT%%/client/inc/home.png %%DTCROOT%%/client/inc/img.php +%%DTCROOT%%/client/inc/img_alt.php +%%DTCROOT%%/client/inc/img_alt_skin.php +%%DTCROOT%%/client/inc/imglong.png +%%DTCROOT%%/client/inc/imgshort.png %%DTCROOT%%/client/inc/mail.png -%%DTCROOT%%/client/inc/man.png -%%DTCROOT%%/client/inc/package-installer.png -%%DTCROOT%%/client/inc/stat.png -%%DTCROOT%%/client/inc/tool.png -%%DTCROOT%%/client/inc/tst_icon.png -%%DTCROOT%%/client/inc/adddomain.png -%%DTCROOT%%/client/inc/arial.ttf -%%DTCROOT%%/client/inc/databases.png -%%DTCROOT%%/client/inc/domains.png -%%DTCROOT%%/client/inc/ftp-accounts.png %%DTCROOT%%/client/inc/mailboxs.png %%DTCROOT%%/client/inc/mailing-lists.png +%%DTCROOT%%/client/inc/man.png %%DTCROOT%%/client/inc/my-account.png %%DTCROOT%%/client/inc/nameservers.png %%DTCROOT%%/client/inc/nickhandles.png +%%DTCROOT%%/client/inc/package-installer.png %%DTCROOT%%/client/inc/password.png %%DTCROOT%%/client/inc/reseller.png +%%DTCROOT%%/client/inc/ssh-accounts.png +%%DTCROOT%%/client/inc/stat.png %%DTCROOT%%/client/inc/stats.png %%DTCROOT%%/client/inc/subdomains.png +%%DTCROOT%%/client/inc/ticket.png +%%DTCROOT%%/client/inc/tool.png %%DTCROOT%%/client/inc/tools.png +%%DTCROOT%%/client/inc/tst_icon.png +%%DTCROOT%%/client/inc/virtual-server.png %%DTCROOT%%/doc/changelog -%%DTCROOT%%/doc/INSTALL %%DTCROOT%%/doc/LICENSE %%DTCROOT%%/doc/bind_conf/etc/bind/db.1.2.3.4 %%DTCROOT%%/doc/bind_conf/etc/bind/db.0 @@ -130,14 +191,19 @@ %%DTCROOT%%/doc/bind_conf/etc/bind/db.root %%DTCROOT%%/doc/bind_conf/etc/named.conf %%DTCROOT%%/doc/bind_conf/db.root -%%DTCROOT%%/doc/changelog.Debian -%%DTCROOT%%/doc/copyright -%%DTCROOT%%/doc/.#todo.1.8 +%%DTCROOT%%/doc/README.gentoo %%DTCROOT%%/doc/todo -%%DTCROOT%%/doc/upgrade_sql_from_beta.sql +%%DTCROOT%%/doc/update_stable_rtag.sh %%DTCROOT%%/doc/daemonconf_howto/ftp_http_logging_to_mysql %%DTCROOT%%/doc/daemonconf_howto/my_init.d_qmail.startup.script %%DTCROOT%%/doc/daemonconf_howto/qmail_anti_spam_measures +%%DTCROOT%%/doc/dtc_storefront/README +%%DTCROOT%%/doc/dtc_storefront/dtc_storefront/dbconnect.php +%%DTCROOT%%/doc/dtc_storefront/dtc_storefront.php +%%DTCROOT%%/doc/dtc_storefront/gplhost-testimonials-delete.php +%%DTCROOT%%/doc/dtc_storefront/gplhost-testimonials-record.php +%%DTCROOT%%/doc/dtc_storefront/gplhost-testimonials-validate.php +%%DTCROOT%%/doc/dtc_storefront/gplhost-testimonials.php %%DTCROOT%%/doc/html/en/addzone.png %%DTCROOT%%/doc/html/en/1.html %%DTCROOT%%/doc/html/en/2.html @@ -181,17 +247,25 @@ %%DTCROOT%%/doc/html/fr/menudtc.png %%DTCROOT%%/doc/html/fr/newadmin.png %%DTCROOT%%/doc/html/fr/page_top.html -%%DTCROOT%%/doc/ssl_cert.sh.txt +%%DTCROOT%%/doc/iglobalwall/doc.txt +%%DTCROOT%%/doc/iglobalwall/iglobalwall.tar.gz +%%DTCROOT%%/doc/iglobalwall/mail_header.rar +%%DTCROOT%%/doc/dns_transfer.sh +%%DTCROOT%%/doc/build_debian_upload.sh %%DTCROOT%%/email/index.php %%DTCROOT%%/email/api.php +%%DTCROOT%%/email/inc/domain.png +%%DTCROOT%%/email/inc/domains.png %%DTCROOT%%/email/inc/img.php %%DTCROOT%%/email/login.php %%DTCROOT%%/email/submit_to_sql_dtcemail.php -%%DTCROOT%%/email/gfx -%%DTCROOT%%/email/imgcache -%%DTCROOT%%/shared/404_template/index.php +%%DTCROOT%%/Makefile +%%DTCROOT%%/shared/404_template/expired.php %%DTCROOT%%/shared/404_template/404.php +%%DTCROOT%%/shared/404_template/index.php %%DTCROOT%%/shared/autoSQLconfig.php +%%DTCROOT%%/shared/cyradm.php +%%DTCROOT%%/shared/default_admin_site.php %%DTCROOT%%/shared/dtc_lib.php %%DTCROOT%%/shared/upgrade_sql.php %%DTCROOT%%/shared/drawlib/anotherDtc.php @@ -223,9 +297,15 @@ %%DTCROOT%%/shared/dtcrm/srs_base.php %%DTCROOT%%/shared/dtcrm/srs_nameserver.php %%DTCROOT%%/shared/dtcrm/srs_registernames.php +%%DTCROOT%%/shared/dtcrm/strings.php %%DTCROOT%%/shared/dtcrm/submit_to_sql.php %%DTCROOT%%/shared/dtcrm/todo -%%DTCROOT%%/shared/dtcrm/strings.php +%%DTCROOT%%/shared/dtcrm/webnic.cc/domainQuery.php +%%DTCROOT%%/shared/dtcrm/webnic.cc/domainRegistration.php +%%DTCROOT%%/shared/dtcrm/webnic.cc/test.php +%%DTCROOT%%/shared/dtcrm/webnic.cc/webnic_base.php +%%DTCROOT%%/shared/dtcrm/webnic.cc/webnic_settings.php +%%DTCROOT%%/shared/dtcrm/webnic.cc/webnic_submit.php %%DTCROOT%%/shared/gfx/dtc_logo.gif %%DTCROOT%%/shared/gfx/dtc.css %%DTCROOT%%/shared/gfx/bar/middle_n.png @@ -248,10 +328,14 @@ %%DTCROOT%%/shared/gfx/dtc/generate_web2.gif %%DTCROOT%%/shared/gfx/dtc/reinit_named.gif %%DTCROOT%%/shared/gfx/dtc_logo_small.gif +%%DTCROOT%%/shared/gfx/generate_pass.png +%%DTCROOT%%/shared/gfx/see_password.png %%DTCROOT%%/shared/gfx/stock_add_24.png %%DTCROOT%%/shared/gfx/stock_apply_20.png %%DTCROOT%%/shared/gfx/stock_save_24.png %%DTCROOT%%/shared/gfx/stock_trash_24.png +%%DTCROOT%%/shared/gfx/tucows.jpg +%%DTCROOT%%/shared/gfx/wz_tooltip.js %%DTCROOT%%/shared/gfx/language/en/pub/banner_alight.gif %%DTCROOT%%/shared/gfx/language/en/button_en.gif %%DTCROOT%%/shared/gfx/language/de.gif @@ -262,7 +346,10 @@ %%DTCROOT%%/shared/gfx/language/hu.gif %%DTCROOT%%/shared/gfx/language/it.gif %%DTCROOT%%/shared/gfx/language/nl.gif +%%DTCROOT%%/shared/gfx/language/pl.png +%%DTCROOT%%/shared/gfx/language/pt.gif %%DTCROOT%%/shared/gfx/language/ru.gif +%%DTCROOT%%/shared/gfx/language/se.png %%DTCROOT%%/shared/gfx/language/zh.gif %%DTCROOT%%/shared/gfx/language/fr/pub/banner_alight.gif %%DTCROOT%%/shared/gfx/language/fr/button_fr.gif @@ -270,17 +357,25 @@ %%DTCROOT%%/shared/gfx/language/nl/button_en.gif %%DTCROOT%%/shared/gfx/language/ru/pub/banner_alight.gif %%DTCROOT%%/shared/gfx/language/ru/button_en.gif -%%DTCROOT%%/shared/gfx/language/pl.png %%DTCROOT%%/shared/gfx/menu/admins.png %%DTCROOT%%/shared/gfx/menu/bw_icon.png +%%DTCROOT%%/shared/gfx/menu/client-interface.png %%DTCROOT%%/shared/gfx/menu/config.gif %%DTCROOT%%/shared/gfx/menu/config_panel.png %%DTCROOT%%/shared/gfx/menu/crm.png %%DTCROOT%%/shared/gfx/menu/daemons.png +%%DTCROOT%%/shared/gfx/menu/domain-config.png %%DTCROOT%%/shared/gfx/menu/product_manager.png %%DTCROOT%%/shared/gfx/menu/recycle.gif -%%DTCROOT%%/shared/gfx/menu/users.gif +%%DTCROOT%%/shared/gfx/menu/renewals.png %%DTCROOT%%/shared/gfx/menu/user-editor.png +%%DTCROOT%%/shared/gfx/menu/users.gif +%%DTCROOT%%/shared/gfx/pagetop/dtc_banner.gif +%%DTCROOT%%/shared/gfx/pagetop/dtc_banner_end.gif +%%DTCROOT%%/shared/gfx/pagetop/dtc_logo.gif +%%DTCROOT%%/shared/gfx/pagetop/logoend.gif +%%DTCROOT%%/shared/gfx/pagetop/logofond.gif +%%DTCROOT%%/shared/gfx/pagetop/logostart.gif %%DTCROOT%%/shared/gfx/securepay/poweredByWorldPay.gif %%DTCROOT%%/shared/gfx/skin/darkblue/background.gif %%DTCROOT%%/shared/gfx/skin/darkblue/bgcolor.php @@ -324,6 +419,8 @@ %%DTCROOT%%/shared/gfx/skin/green2/corner_2.gif %%DTCROOT%%/shared/gfx/skin/green2/corner_3.gif %%DTCROOT%%/shared/gfx/skin/green2/corner_4.gif +%%DTCROOT%%/shared/gfx/skin/green2/imglong.png +%%DTCROOT%%/shared/gfx/skin/green2/imgshort.png %%DTCROOT%%/shared/gfx/skin/green2/skin.css %%DTCROOT%%/shared/gfx/skin/green2/skin.php %%DTCROOT%%/shared/gfx/skin/green_gpl/icons/debian.gif @@ -362,6 +459,8 @@ %%DTCROOT%%/shared/gfx/skin/iglobal/corner_bottom_right.gif %%DTCROOT%%/shared/gfx/skin/iglobal/corner_top_left.gif %%DTCROOT%%/shared/gfx/skin/iglobal/corner_top_right.gif +%%DTCROOT%%/shared/gfx/skin/iglobal/imglong.png +%%DTCROOT%%/shared/gfx/skin/iglobal/imgshort.png %%DTCROOT%%/shared/gfx/skin/iglobal/skin.css %%DTCROOT%%/shared/gfx/skin/iglobal/skin.php %%DTCROOT%%/shared/gfx/skin/muedgrey/amp_style.css @@ -376,6 +475,8 @@ %%DTCROOT%%/shared/gfx/skin/muedgrey/corner_3.gif %%DTCROOT%%/shared/gfx/skin/muedgrey/corner_4.gif %%DTCROOT%%/shared/gfx/skin/muedgrey/degrade.jpg +%%DTCROOT%%/shared/gfx/skin/muedgrey/imglong.png +%%DTCROOT%%/shared/gfx/skin/muedgrey/imgshort.png %%DTCROOT%%/shared/gfx/skin/muedgrey/skin.css %%DTCROOT%%/shared/gfx/skin/muedgrey/skin.php %%DTCROOT%%/shared/gfx/skin/ruffdogs_mozilla/background.png @@ -390,16 +491,11 @@ %%DTCROOT%%/shared/gfx/skin/tex/bgcolor.php %%DTCROOT%%/shared/gfx/skin/tex/bgtitlewin.png %%DTCROOT%%/shared/gfx/skin/tex/bgwin.png +%%DTCROOT%%/shared/gfx/skin/tex/imglong.png +%%DTCROOT%%/shared/gfx/skin/tex/imgshort.png +%%DTCROOT%%/shared/gfx/skin/tex/pagetop.html %%DTCROOT%%/shared/gfx/skin/tex/skin.css %%DTCROOT%%/shared/gfx/skin/tex/skin.php -%%DTCROOT%%/shared/gfx/skin/tex/pagetop.html -%%DTCROOT%%/shared/gfx/pagetop/dtc_banner.gif -%%DTCROOT%%/shared/gfx/pagetop/dtc_banner_end.gif -%%DTCROOT%%/shared/gfx/pagetop/dtc_logo.gif -%%DTCROOT%%/shared/gfx/pagetop/logoend.gif -%%DTCROOT%%/shared/gfx/pagetop/logofond.gif -%%DTCROOT%%/shared/gfx/pagetop/logostart.gif -%%DTCROOT%%/shared/gfx/tucows.jpg %%DTCROOT%%/shared/inc/forms/admin_stats.php %%DTCROOT%%/shared/inc/forms/database.php %%DTCROOT%%/shared/inc/forms/dns.php @@ -408,55 +504,97 @@ %%DTCROOT%%/shared/inc/forms/email.php %%DTCROOT%%/shared/inc/forms/ftp.php %%DTCROOT%%/shared/inc/forms/lists.php +%%DTCROOT%%/shared/inc/forms/lists_strings.php %%DTCROOT%%/shared/inc/forms/my_account.php %%DTCROOT%%/shared/inc/forms/packager.php -%%DTCROOT%%/shared/inc/forms/root_admin.php -%%DTCROOT%%/shared/inc/forms/subdomain.php %%DTCROOT%%/shared/inc/forms/reseller.php +%%DTCROOT%%/shared/inc/forms/root_admin.php +%%DTCROOT%%/shared/inc/forms/ssh.php +%%DTCROOT%%/shared/inc/forms/subdomain.php +%%DTCROOT%%/shared/inc/forms/ticket.php +%%DTCROOT%%/shared/inc/forms/tools.php +%%DTCROOT%%/shared/inc/forms/vps.php +%%DTCROOT%%/shared/inc/forms/vps_strings.php %%DTCROOT%%/shared/inc/accounting.php %%DTCROOT%%/shared/inc/dbconect.php +%%DTCROOT%%/shared/inc/domain_export.php %%DTCROOT%%/shared/inc/draw.php %%DTCROOT%%/shared/inc/fetch.php %%DTCROOT%%/shared/inc/fetchmail.php +%%DTCROOT%%/shared/inc/nusoap.php +%%DTCROOT%%/shared/inc/skin.class.php %%DTCROOT%%/shared/inc/submit_to_sql.php +%%DTCROOT%%/shared/inc/tree_mem_to_db.php +%%DTCROOT%%/shared/inc/vps.php %%DTCROOT%%/shared/inc/sql/database.php +%%DTCROOT%%/shared/inc/sql/database_strings.php %%DTCROOT%%/shared/inc/sql/dns.php %%DTCROOT%%/shared/inc/sql/domain_info.php +%%DTCROOT%%/shared/inc/sql/domain_info_strings.php %%DTCROOT%%/shared/inc/sql/email.php +%%DTCROOT%%/shared/inc/sql/email_strings.php %%DTCROOT%%/shared/inc/sql/ftp.php -%%DTCROOT%%/shared/inc/sql/subdomain.php -%%DTCROOT%%/shared/inc/sql/reseller.php +%%DTCROOT%%/shared/inc/sql/ftp_strings.php %%DTCROOT%%/shared/inc/sql/lists.php -%%DTCROOT%%/shared/inc/.#submit_to_sql.php.1.26 -%%DTCROOT%%/shared/inc/tree_mem_to_db.php -%%DTCROOT%%/shared/package-installer/phpbb/phpBB-2.0.17.tar.bz2 -%%DTCROOT%%/shared/package-installer/phpbb/dtc-pkg-info.php -%%DTCROOT%%/shared/package-installer/phpbb/dtc-pkg-install.php +%%DTCROOT%%/shared/inc/sql/reseller.php +%%DTCROOT%%/shared/inc/sql/ssh.php +%%DTCROOT%%/shared/inc/sql/ssh_strings.php +%%DTCROOT%%/shared/inc/sql/subdomain.php +%%DTCROOT%%/shared/inc/sql/subdomain_strings.php +%%DTCROOT%%/shared/inc/sql/ticket.php +%%DTCROOT%%/shared/inc/sql/vps.php +%%DTCROOT%%/shared/inc/sql/vps_strings.php +%%DTCROOT%%/shared/package-installer/drupal/drupal-4.7.2.tar.gz +%%DTCROOT%%/shared/package-installer/drupal/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/drupal/dtc-pkg-install.php %%DTCROOT%%/shared/package-installer/horde/dtc-pkg-info.php -%%DTCROOT%%/shared/package-installer/horde/horde-3.0.4.tar.gz %%DTCROOT%%/shared/package-installer/horde/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/horde/horde-3.0.4.tar.gz +%%DTCROOT%%/shared/package-installer/joomla/Joomla_1.0.8-Stable-Full_Package.tar.bz2 +%%DTCROOT%%/shared/package-installer/joomla/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/joomla/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/joomla_pl/Joomla_1.0.10_rev2.tar.bz2 +%%DTCROOT%%/shared/package-installer/joomla_pl/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/joomla_pl/dtc-pkg-install.php %%DTCROOT%%/shared/package-installer/oscommerce/dtc-pkg-info.php %%DTCROOT%%/shared/package-installer/oscommerce/dtc-pkg-install.php %%DTCROOT%%/shared/package-installer/oscommerce/oscommerce-2.2ms2.tar.gz +%%DTCROOT%%/shared/package-installer/oscommerce-creloaded/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/oscommerce-creloaded/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/oscommerce-creloaded/oscommerce-creloaded_6.15-1.tar.gz +%%DTCROOT%%/shared/package-installer/phpbb/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/phpbb/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/phpbb/phpBB-2.0.17.tar.bz2 %%DTCROOT%%/shared/package-installer/phpnuke/dtc-pkg-info.php %%DTCROOT%%/shared/package-installer/phpnuke/dtc-pkg-install.php %%DTCROOT%%/shared/package-installer/phpnuke/phpnuke-7.7.tar.gz -%%DTCROOT%%/shared/package-installer/drupal/drupal-4.6.3.tar.gz -%%DTCROOT%%/shared/package-installer/drupal/dtc-pkg-info.php -%%DTCROOT%%/shared/package-installer/drupal/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/phpsurveyor/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/phpsurveyor/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/phpsurveyor/phpsurveyor.tar.gz +%%DTCROOT%%/shared/package-installer/smf/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/smf/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/smf/smf.tar.bz2 +%%DTCROOT%%/shared/package-installer/vtiger/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/vtiger/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/vtiger/vtigercrm-5.0.0.tar.gz +%%DTCROOT%%/shared/package-installer/wanewsletter/dtc-pkg-info.php +%%DTCROOT%%/shared/package-installer/wanewsletter/dtc-pkg-install.php +%%DTCROOT%%/shared/package-installer/wanewsletter/wanewsletter-2.3.0.tar.gz +%%DTCROOT%%/shared/securepay/gateways/enets.php %%DTCROOT%%/shared/securepay/gateways/paypal.php %%DTCROOT%%/shared/securepay/gateways/worldpay.php %%DTCROOT%%/shared/securepay/RENAME_ME_paiement_config.php %%DTCROOT%%/shared/securepay/paiement.php %%DTCROOT%%/shared/securepay/pay_functions.php %%DTCROOT%%/shared/template/dtc_logo.gif -%%DTCROOT%%/shared/template/index.php %%DTCROOT%%/shared/template/favicon.ico +%%DTCROOT%%/shared/template/index.php +%%DTCROOT%%/shared/vars/clear_lang_array.php +%%DTCROOT%%/shared/vars/error_strings.php %%DTCROOT%%/shared/vars/global_vars.php %%DTCROOT%%/shared/vars/lang.php %%DTCROOT%%/shared/vars/strings.php %%DTCROOT%%/shared/vars/table_names.php -%%DTCROOT%%/shared/default_admin_site.php %%DTCROOT%%/shared/dtc_version.php %%DTCROOT%%/admin/gfx %%DTCROOT%%/admin/imgcache @@ -464,13 +602,21 @@ %%DTCROOT%%/client/imgcache sbin/dtc-install sbin/dtc-deinstall +/share @dirrm %%DTCROOT%%/shared/vars @dirrm %%DTCROOT%%/shared/template @dirrm %%DTCROOT%%/shared/securepay/gateways @dirrm %%DTCROOT%%/shared/securepay +@dirrm %%DTCROOT%%/shared/package-installer/wanewsletter +@dirrm %%DTCROOT%%/shared/package-installer/vtiger +@dirrm %%DTCROOT%%/shared/package-installer/smf +@dirrm %%DTCROOT%%/shared/package-installer/phpsurveyor @dirrm %%DTCROOT%%/shared/package-installer/phpnuke @dirrm %%DTCROOT%%/shared/package-installer/phpbb +@dirrm %%DTCROOT%%/shared/package-installer/oscommerce-creloaded @dirrm %%DTCROOT%%/shared/package-installer/oscommerce +@dirrm %%DTCROOT%%/shared/package-installer/joomla_pl +@dirrm %%DTCROOT%%/shared/package-installer/joomla @dirrm %%DTCROOT%%/shared/package-installer/horde @dirrm %%DTCROOT%%/shared/package-installer/drupal @dirrm %%DTCROOT%%/shared/package-installer @@ -478,7 +624,6 @@ sbin/dtc-deinstall @dirrm %%DTCROOT%%/shared/inc/forms @dirrm %%DTCROOT%%/shared/inc @dirrm %%DTCROOT%%/shared/imgcache -@dirrm %%DTCROOT%%/shared/gfx/usermenu @dirrm %%DTCROOT%%/shared/gfx/skin/tex @dirrm %%DTCROOT%%/shared/gfx/skin/ruffdogs_mozilla @dirrm %%DTCROOT%%/shared/gfx/skin/muedgrey @@ -505,6 +650,7 @@ sbin/dtc-deinstall @dirrm %%DTCROOT%%/shared/gfx/dtc @dirrm %%DTCROOT%%/shared/gfx/bar @dirrm %%DTCROOT%%/shared/gfx +@dirrm %%DTCROOT%%/shared/dtcrm/webnic.cc @dirrm %%DTCROOT%%/shared/dtcrm/srs @dirrm %%DTCROOT%%/shared/dtcrm @dirrm %%DTCROOT%%/shared/drawlib @@ -512,22 +658,28 @@ sbin/dtc-deinstall @dirrm %%DTCROOT%%/shared @dirrm %%DTCROOT%%/email/inc @dirrm %%DTCROOT%%/email +@dirrm %%DTCROOT%%/doc/iglobalwall @dirrm %%DTCROOT%%/doc/html/fr @dirrm %%DTCROOT%%/doc/html/en @dirrm %%DTCROOT%%/doc/html +@dirrm %%DTCROOT%%/doc/dtc_storefront/dtc_storefront +@dirrm %%DTCROOT%%/doc/dtc_storefront @dirrm %%DTCROOT%%/doc/daemonconf_howto @dirrm %%DTCROOT%%/doc/bind_conf/etc/bind @dirrm %%DTCROOT%%/doc/bind_conf/etc @dirrm %%DTCROOT%%/doc/bind_conf @dirrm %%DTCROOT%%/doc @dirrm %%DTCROOT%%/client/inc -@dirrm %%DTCROOT%%/client/gateways @dirrm %%DTCROOT%%/client @dirrm %%DTCROOT%%/admin/tables +@dirrm %%DTCROOT%%/admin/reminders_msg +@dirrm %%DTCROOT%%/admin/queuegraph +@dirrm %%DTCROOT%%/admin/netusegraph +@dirrm %%DTCROOT%%/admin/memgraph @dirrm %%DTCROOT%%/admin/inc @dirrm %%DTCROOT%%/admin/genfiles @dirrm %%DTCROOT%%/admin/dtcrm -@dirrm %%DTCROOT%%/admin +@dirrm %%DTCROOT%%/admin/cpugraph @dirrm %%DTCROOT%%/etc/zones @dirrm %%DTCROOT%%/etc @dirrm %%DTCROOT%%