diff --git a/lib/configfiles/gentoo.inc.php b/lib/configfiles/gentoo.inc.php deleted file mode 100644 index ef253fed..00000000 --- a/lib/configfiles/gentoo.inc.php +++ /dev/null @@ -1,436 +0,0 @@ - (2003-2009) - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Configfiles - * - */ - -// Try to guess user/group from settings' email UID/GID -$vmail_user=posix_getpwuid(Settings::Get('system.vmail_uid')); -$vmail_group=posix_getgrgid(Settings::Get('system.vmail_gid')); - -/* If one of them are not set, call it 'vmail' and suggest creating user/group - * in scripts. */ -if ($vmail_user === false) { - $vmail_username="vmail"; -} else { - $vmail_username=$vmail_user['name']; -} -if ($vmail_group === false) { - $vmail_groupname="vmail"; -} else { - $vmail_groupname=$vmail_group['name']; -} - -return array( - 'gentoo' => array( - 'label' => 'Gentoo', - 'services' => array( - 'http' => array( - 'label' => $lng['admin']['configfiles']['http'], - 'daemons' => array( - 'apache2' => array( - 'label' => 'Apache2 Webserver', - 'commands' => array( - $configcommand['vhost'], - 'chown root:0 ' . Settings::Get('system.apacheconf_vhost'), - 'chmod 0600 ' . Settings::Get('system.apacheconf_vhost'), - $configcommand['diroptions'], - 'chown root:0 ' . Settings::Get('system.apacheconf_diroptions'), - 'chmod 0600 ' . Settings::Get('system.apacheconf_diroptions'), - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir') - ), - 'files' => ((int)Settings::Get('phpfpm.enabled') == 1) ? - array( - 'etc_apache2_modules.d_70_fastcgi.conf' => '/etc/apache2/modules.d/70_fastcgi.conf' - ) - : - null, - 'restart' => array( - 'rc-update add apache2 default', - '/etc/init.d/apache2 restart' - ) - ), - 'lighttpd' => array( - 'label' => 'Lighttpd Webserver', - 'commands_1' => array( - 'emerge -av lighttpd' - ), - 'files' => array( - 'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf' - ), - 'commands_2' => array( - $configcommand['vhost'], - $configcommand['diroptions'], - $configcommand['v_inclighty'], - $configcommand['d_inclighty'], - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'rc-update add lighttpd default' - ), - 'restart' => array( - '/etc/init.d/lighttpd restart' - ) - ), - 'nginx' => array( - 'label' => 'Nginx Webserver', - 'commands_1' => array( - 'emerge nginx', - ), - 'files' => array( - 'etc_nginx_nginx.conf' => '/etc/nginx/nginx.conf', - 'etc_init.d_php-fcgi' => '/etc/init.d/php-fcgi' - ), - 'commands_2' => array( - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod u+x /etc/init.d/php-fcgi', - 'rc-update add nginx default' - ), - 'restart' => array( - '/etc/init.d/nginx restart' - ) - ), - ) - ), - 'dns' => array( - 'label' => $lng['admin']['configfiles']['dns'], - 'daemons' => array( - 'bind' => array( - 'label' => 'Bind9 Nameserver', - 'files' => array( - 'etc_bind_default.zone' => '/etc/bind/default.zone' - ), - 'commands' => array( - 'echo "include \"' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf\";" >> /etc/bind/named.conf', - 'touch ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chown named:0 ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chmod 0600 ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'rc-update add named default' - ), - 'restart' => array( - '/etc/init.d/named restart' - ) - ), - ) - ), - 'smtp' => array( - 'label' => $lng['admin']['configfiles']['smtp'], - 'daemons' => array( - 'postfix_courier' => array( - 'label' => 'Postfix/Courier', - 'commands_1' => array( - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'echo "mail-mta/postfix -dovecot-sasl sasl" >> /etc/portage/package.use', - 'emerge -av postfix', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'chmod 0750 ' . Settings::Get('system.vmail_homedir'), - 'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo', - 'touch /etc/postfix/main.cf', - 'touch /etc/sasl2/smtpd.conf', - 'chown root:root /etc/postfix/main.cf', - 'chown root:root /etc/sasl2/smtpd.conf', - 'chmod 0644 /etc/postfix/main.cf', - 'chmod 0600 /etc/sasl2/smtpd.conf', - 'for suffix in {alias,mailbox,uid,gid}_maps mailbox_domains sender_permissions; do', - ' touch /etc/postfix/mysql-virtual_${suffix}.cf', - ' chown root:postfix /etc/postfix/mysql-virtual_${suffix}.cf', - ' chmod 0640 /etc/postfix/mysql-virtual_${suffix}.cf', - 'done' - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf', - 'etc_postfix_mysql-virtual_uid_maps.cf' => '/etc/postfix/mysql-virtual_uid_maps.cf', - 'etc_postfix_mysql-virtual_gid_maps.cf' => '/etc/postfix/mysql-virtual_gid_maps.cf', - 'etc_sasl2_smtpd.conf' => '/etc/sasl2/smtpd.conf' - ), - 'commands_2' => array( - 'rc-update add postfix default' - ), - 'restart' => array( - '/etc/init.d/postfix restart' - ) - ), - 'postfix_dovecot' => array( - 'label' => 'Postfix/Dovecot', - 'commands_1' => array( - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'echo "mail-mta/postfix dovecot-sasl -sasl" >> /etc/portage/package.use', - 'emerge -av postfix', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'chmod 0750 ' . Settings::Get('system.vmail_homedir'), - 'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo', - 'mv /etc/postfix/master.cf /etc/postfix/master.cf.gentoo', - 'touch /etc/postfix/{main,master}.cf', - 'chown root:root /etc/postfix/{main,master}.cf', - 'chmod 0644 /etc/postfix/{main,master}.cf', - 'for suffix in {alias,mailbox,uid,gid}_maps mailbox_domains sender_permissions; do', - ' touch /etc/postfix/mysql-virtual_${suffix}.cf', - ' chown root:postfix /etc/postfix/mysql-virtual_${suffix}.cf', - ' chmod 0640 /etc/postfix/mysql-virtual_${suffix}.cf', - 'done' - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_master.cf' => '/etc/postfix/master.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf', - 'etc_postfix_mysql-virtual_uid_maps.cf' => '/etc/postfix/mysql-virtual_uid_maps.cf', - 'etc_postfix_mysql-virtual_gid_maps.cf' => '/etc/postfix/mysql-virtual_gid_maps.cf' - ), - 'commands_2' => array( - 'rc-update add postfix default' - ), - 'restart' => array( - '/etc/init.d/postfix restart' - ) - ), - 'postfix_mxaccess' => array( - 'label' => 'Postfix MX-Access (anti spam)', - 'files' => array( - 'etc_postfix_mx_access' => '/etc/postfix/mx_access', - 'etc_postfix_main.cf' => '/etc/postfix/main.cf' - ), - 'commands_1' => array( - 'postmap /etc/postfix/mx_access' - ), - 'restart' => array( - 'newaliases', - '/etc/init.d/postfix restart' - ) - ), - 'dkim' => array( - 'label' => 'DomainKey filter', - 'commands_1' => array( - 'emerge dkim-milter', - 'emerge --config mail-filter/dkim-milter', - 'mkdir -p /etc/postfix/dkim' - ), - 'files' => array( - 'dkim-filter.conf' => '/etc/mail/dkim-filter/dkim-filter.conf' - ), - 'commands_2' => array( - 'echo "smtpd_milters = inet:localhost:8891 -milter_macro_daemon_name = SIGNING -milter_default_action = accept" >> /etc/postfix/main.cf', - 'rc-update add dkim-filter default' - ), - 'restart' => array( - '/etc/init.d/postfix restart' - ) - ) - ) - ), - 'mail' => array( - 'label' => $lng['admin']['configfiles']['mail'], - 'daemons' => array( - 'courier' => array( - 'label' => 'Courier-IMAP (POP3/IMAP)', - 'commands_1' => array( - 'rm /etc/courier/authlib/authdaemonrc', - 'rm /etc/courier/authlib/authmysqlrc', - 'rm /etc/courier-imap/pop3d', - 'rm /etc/courier-imap/imapd', - 'rm /etc/courier-imap/pop3d-ssl', - 'rm /etc/courier-imap/imapd-ssl', - 'touch /etc/courier/authlib/authdaemonrc', - 'touch /etc/courier/authlib/authmysqlrc', - 'touch /etc/courier-imap/pop3d', - 'touch /etc/courier-imap/imapd', - 'touch /etc/courier-imap/pop3d-ssl', - 'touch /etc/courier-imap/imapd-ssl' - ), - 'files' => array( - 'etc_courier_authlib_authdaemonrc' => '/etc/courier/authlib/authdaemonrc', - 'etc_courier_authlib_authmysqlrc' => '/etc/courier/authlib/authmysqlrc', - 'etc_courier-imap_pop3d' => '/etc/courier-imap/pop3d', - 'etc_courier-imap_imapd' => '/etc/courier-imap/imapd', - 'etc_courier-imap_pop3d-ssl' => '/etc/courier-imap/pop3d-ssl', - 'etc_courier-imap_imapd-ssl' => '/etc/courier-imap/imapd-ssl' - ), - 'commands_2' => array( - 'chown root:0 /etc/courier/authlib/authdaemonrc', - 'chown root:0 /etc/courier/authlib/authmysqlrc', - 'chown root:0 /etc/courier-imap/pop3d', - 'chown root:0 /etc/courier-imap/imapd', - 'chown root:0 /etc/courier-imap/pop3d-ssl', - 'chown root:0 /etc/courier-imap/imapd-ssl', - 'chmod 0600 /etc/courier/authlib/authdaemonrc', - 'chmod 0600 /etc/courier/authlib/authmysqlrc', - 'chmod 0600 /etc/courier-imap/pop3d', - 'chmod 0600 /etc/courier-imap/imapd', - 'chmod 0600 /etc/courier-imap/pop3d-ssl', - 'chmod 0600 /etc/courier-imap/imapd-ssl', - 'rc-update add courier-authlib default', - 'rc-update add courier-pop3d default', - 'rc-update add courier-imapd default' - ), - 'restart' => array( - '/etc/init.d/courier-authlib restart', - '/etc/init.d/courier-pop3d restart', - '/etc/init.d/courier-imapd restart' - ) - ), - 'dovecot' => array( - 'label' => 'Dovecot', - 'commands_1' => array( - 'echo "net-mail/dovecot mysql" >> /etc/portage/package.use', - 'emerge -av dovecot', - 'mv /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.gentoo', - 'mv /etc/dovecot/dovecot-sql.conf /etc/dovecot/dovecot-sql.conf.gentoo', - 'touch /etc/dovecot/dovecot.conf', - 'touch /etc/dovecot/dovecot-sql.conf', - ), - 'files' => array( - 'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf', - 'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf' - ), - 'commands_2' => array( - 'chmod 0640 /etc/dovecot/dovecot-sql.conf', - 'rc-update add dovecot default' - ), - 'restart' => array( - '/etc/init.d/dovecot restart' - ) - ) - ) - ), - 'ftp' => array( - 'label' => $lng['admin']['configfiles']['ftp'], - 'daemons' => array( - 'proftpd' => array( - 'label' => 'ProFTPd', - 'commands_1' => array( - 'echo "net-ftp/proftpd mysql" >> /etc/portage/package.use', - 'emerge -av proftpd', - 'touch /etc/proftpd/proftpd.conf' - ), - 'files' => array( - 'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf' - ), - 'commands_2' => array( - 'chown root:0 /etc/proftpd/proftpd.conf', - 'chmod 0600 /etc/proftpd/proftpd.conf', - 'rc-update add proftpd default' - ), - 'restart' => array( - '/etc/init.d/proftpd restart' - ) - ), - 'pureftpd' => array( - 'label' => 'PureFTPD', - 'commands_1' => array( - 'emerge pure-ftpd' - ), - 'files' => array( - 'etc_conf.d_pure-ftpd' => '/etc/conf.d/pure-ftpd', - 'etc_pureftpd-mysql.conf' => '/etc/pureftpd-mysql.conf' - ), - 'commands_2' => array( - 'chown root:0 /etc/conf.d/pure-ftpd', - 'chmod 0644 /etc/conf.d/pure-ftpd', - 'chown root:0 /etc/pureftpd-mysql.conf', - 'chmod 0600 /etc/pureftpd-mysql.conf', - 'rc-update add pure-ftpd default' - ), - 'restart' => array( - '/etc/init.d/pure-ftpd restart' - ) - ) - ) - ), - 'etc' => array( - 'label' => $lng['admin']['configfiles']['etc'], - 'daemons' => array( - 'cron' => array( - 'label' => 'Crond (cronscript)', - 'commands_1' => array( - 'touch /etc/cron.d/froxlor', - 'chown root:0 /etc/cron.d/froxlor', - 'chmod 0640 /etc/cron.d/froxlor' - ), - 'files' => array( - 'etc_cron.d_froxlor' => '/etc/cron.d/froxlor' - ), - 'restart' => array( - Settings::Get('system.crondreload') - ) - ), - 'awstats' => array( - 'label' => 'Awstats', - 'commands' => array( - 'emerge awstats', - 'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - '# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself', - 'rm /etc/cron.d/awstats' - ), - ), - 'libnss' => array( - 'label' => 'libnss (system login with mysql)', - 'commands_1' => array( - 'emerge -av libnss-mysql' - ), - 'files' => array( - 'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg', - 'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg', - 'etc_nsswitch.conf' => '/etc/nsswitch.conf', - ), - 'commands_2' => array( - 'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg', - 'rc-update add nscd default' - ), - 'restart' => array( - '/etc/init.d/nscd restart' - ) - ), - 'logrotate' => array( - 'label' => 'Logrotate', - 'commands_1' => array( - 'emerge -av app-admin/logrotate', - 'touch /etc/logrotate.d/froxlor', - 'chmod 644 /etc/logrotate.d/froxlor' - ), - 'files' => array( - 'etc_logrotated_froxlor' => '/etc/logrotate.d/froxlor' - ), - 'commands_2' => array( - '# emerge automatically adds a daily cronjob for logrotate', - '# you do not have to do anything else :)' - ) - ) - ) - ) - ) - ) -); diff --git a/lib/configfiles/precise.inc.php b/lib/configfiles/precise.inc.php deleted file mode 100644 index 176f271b..00000000 --- a/lib/configfiles/precise.inc.php +++ /dev/null @@ -1,421 +0,0 @@ - (2003-2009) - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Configfiles - * - */ - -// Try to guess user/group from settings' email UID/GID -$vmail_user=posix_getpwuid(Settings::Get('system.vmail_uid')); -$vmail_group=posix_getgrgid(Settings::Get('system.vmail_gid')); - -/* If one of them are not set, call it 'vmail' and suggest creating user/group - * in scripts. */ -if ($vmail_user === false) { - $vmail_username="vmail"; -} else { - $vmail_username=$vmail_user['name']; -} -if ($vmail_group === false) { - $vmail_groupname="vmail"; -} else { - $vmail_groupname=$vmail_group['name']; -} - -return array( - 'ubuntu_precise' => array( - 'label' => 'Ubuntu 12.04 (Precise)', - 'services' => array( - 'http' => array( - 'label' => $lng['admin']['configfiles']['http'], - 'daemons' => array( - 'apache2' => array( - 'label' => 'Apache 2', - 'commands' => array( - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'a2dismod userdir' - ), - 'files' => ((int)Settings::Get('phpfpm.enabled') == 1) ? - array( - 'etc_apache2_mods-enabled_fastcgi.conf' => '/etc/apache2/mods-enabled/fastcgi.conf' - ) - : - null, - 'restart' => array( - '/etc/init.d/apache2 restart' - ), - ), - 'lighttpd' => array( - 'label' => 'Lighttpd Webserver', - 'commands_1' => array( - 'apt-get install lighttpd', - ), - 'files' => array( - 'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf', - ), - 'commands_2' => array( - $configcommand['vhost'], - $configcommand['diroptions'], - $configcommand['v_inclighty'], - $configcommand['d_inclighty'], - 'lighty-disable-mod cgi', - 'lighty-disable-mod fastcgi', - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir') - ), - 'restart' => array( - '/etc/init.d/lighttpd restart' - ), - ), - 'nginx' => array( - 'label' => 'Nginx Webserver', - 'commands_1' => array( - 'apt-get install nginx php5-cgi', - ), - 'files' => array( - 'etc_nginx_nginx.conf' => '/etc/nginx/nginx.conf', - 'etc_init.d_php-fcgi' => '/etc/init.d/php-fcgi' - ), - 'commands_2' => array( - 'rm /etc/nginx/sites-enabled/default', - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod u+x /etc/init.d/php-fcgi' - ), - 'restart' => array( - '/etc/init.d/php-fcgi start', - '/etc/init.d/nginx restart' - ) - ), - ), - ), - 'dns' => array( - 'label' => $lng['admin']['configfiles']['dns'], - 'daemons' => array( - 'bind' => array( - 'label' => 'Bind9', - 'commands' => array( - 'apt-get install bind9', - 'echo "include \"' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf\";" >> /etc/bind/named.conf', - 'touch ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chown root:bind ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chmod 0644 ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' - ), - 'restart' => array( - '/etc/init.d/bind9 restart' - ) - ), - 'powerdns' => array( - 'label' => 'PowerDNS', - 'files' => array( - 'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf', - 'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf', - ), - 'restart' => array( - '/etc/init.d/pdns restart' - ) - ), - ) - ), - 'smtp' => array( - 'label' => $lng['admin']['configfiles']['smtp'], - 'daemons' => array( - 'postfix_courier' => array( - 'label' => 'Postfix/Courier', - 'commands' => array( - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql', - 'mkdir -p /var/spool/postfix/etc/pam.d', - 'mkdir -p /var/spool/postfix/var/run/mysqld', - 'touch /etc/postfix/mysql-virtual_alias_maps.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'touch /etc/postfix/mysql-virtual_sender_permissions.cf', - 'touch /etc/postfix/sasl/smtpd.conf', - 'chown root:root /etc/postfix/main.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chown root:root /etc/postfix/sasl/smtpd.conf', - 'chmod 0644 /etc/postfix/main.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chmod 0600 /etc/postfix/sasl/smtpd.conf', - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf', - 'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf' - ), - 'restart' => array( - 'newaliases', - '/etc/init.d/postfix restart' - ) - ), - 'dkim' => array( - 'label' => 'DomainKey filter', - 'commands_1' => array( - 'apt-get install dkim-filter', - 'mkdir -p /etc/postfix/dkim' - ), - 'files' => array( - 'dkim-filter.conf' => '/etc/dkim-filter.conf' - ), - 'commands_2' => array( - 'echo "milter_default_action = accept" >> /etc/postfix/main.cf', - 'echo "milter_protocol = 2" >> /etc/postfix/main.cf', - 'echo "smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf', - 'echo "non_smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf' - ), - 'restart' => array( - '/etc/init.d/dkim-filter restart', - '/etc/init.d/postfix restart' - ) - ), - 'postfix_dovecot' => array( - 'label' => 'Postfix/Dovecot', - 'commands' => array( - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'apt-get install postfix postfix-mysql', - 'mkdir -p /var/spool/postfix/etc/pam.d', - 'mkdir -p /var/spool/postfix/var/run/mysqld', - 'touch /etc/postfix/mysql-virtual_alias_maps.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'touch /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chown root:root /etc/postfix/main.cf', - 'chown root:root /etc/postfix/master.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chmod 0644 /etc/postfix/main.cf', - 'chmod 0644 /etc/postfix/master.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf' - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_master.cf' => '/etc/postfix/master.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf' - ), - 'restart' => array( - '/etc/init.d/postfix restart', - 'newaliases' - ) - ), - 'postfix_mxaccess' => array( - 'label' => 'Postfix MX-Access (anti spam)', - 'files' => array( - 'etc_postfix_mx_access' => '/etc/postfix/mx_access', - 'etc_postfix_main.cf' => '/etc/postfix/main.cf' - ), - 'commands_1' => array( - 'postmap /etc/postfix/mx_access' - ), - 'restart' => array( - '/etc/init.d/postfix restart' - ) - ), - 'exim4' => array( - 'label' => 'Exim4', - 'commands_1' => array( - 'dpkg-reconfigure exim4-config', - '# choose "no configuration at this time" and "splitted configuration files" in the dialog' - ), - 'files' => array( - 'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul', - 'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config', - 'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options', - 'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config', - 'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config' - ), - 'commands_2' => array( - 'chmod o-rx /var/lib/exim4', - 'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options' - ), - 'restart' => array( - '/etc/init.d/exim4 restart' - ) - ) - ) - ), - 'mail' => array( - 'label' => $lng['admin']['configfiles']['mail'], - 'daemons' => array( - 'courier' => array( - 'label' => 'Courier', - 'commands' => array( - 'apt-get install courier-pop courier-imap courier-authlib-mysql' - ), - 'files' => array( - 'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc', - 'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc' - ), - 'restart' => array( - '/etc/init.d/courier-authdaemon restart', - '/etc/init.d/courier-pop restart' - ) - ), - 'dovecot' => array( - 'label' => 'Dovecot', - 'commands_1' => array( - 'apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix dovecot-mysql dovecot-managesieved dovecot-sieve mail-stack-delivery' - ), - 'files' => array( - - 'etc_dovecot_conf.d_01_mail_stack_delivery.conf' => '/etc/dovecot/conf.d/01-mail-stack-delivery.conf', - 'etc_dovecot_conf.d_10_auth.conf' => '/etc/dovecot/conf.d/10-auth.conf', - 'etc_dovecot_conf.d_auth-sql.conf.ext' => '/etc/dovecot/conf.d/auth-sql.conf.ext', - 'etc_dovecot_dovecot-sql.conf.ext' => '/etc/dovecot/dovecot-sql.conf.ext' - ), - 'commands_2' => array( - 'chmod 0640 /etc/dovecot/dovecot-sql.conf.ext' - ), - 'restart' => array( - '/etc/init.d/dovecot restart' - ) - ) - ) - ), - 'ftp' => array( - 'label' => $lng['admin']['configfiles']['ftp'], - 'daemons' => array( - 'proftpd' => array( - 'label' => 'ProFTPd', - 'commands' => array( - 'apt-get install proftpd-basic proftpd-mod-mysql' - ), - 'files' => array( - 'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf', - 'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf', - 'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf' - ), - 'restart' => array( - '/etc/init.d/proftpd restart' - ) - ), - 'pure-ftpd' => array( - 'label' => 'Pure FTPd', - 'commands_1' => array( - 'apt-get install pure-ftpd-common pure-ftpd-mysql' - ), - 'files' => array( - 'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID', - 'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile', - 'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous', - 'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime', - 'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone', - 'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication', - 'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf', - 'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof', - 'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind', - 'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common' - ), - 'commands_2' => array( - 'chmod 0640 /etc/pure-ftpd/db/mysql.conf' - ), - 'restart' => array( - '/etc/init.d/pure-ftpd-mysql restart' - ) - ), - ) - ), - 'etc' => array( - 'label' => $lng['admin']['configfiles']['etc'], - 'daemons' => array( - 'cron' => array( - 'label' => 'Crond (cronscript)', - 'files' => array( - 'etc_cron.d_froxlor' => '/etc/cron.d/froxlor' - ), - 'restart' => array( - Settings::Get('system.crondreload') - ) - ), - 'awstats' => array( - 'label' => 'Awstats', - 'commands' => array( - 'apt-get install awstats', - 'cp /usr/share/awstats/tools/awstats_buildstaticpages.pl '.makeCorrectDir(Settings::Get('system.awstats_path')), - 'mv '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.conf').' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - '# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself', - 'rm /etc/cron.d/awstats' - ), - ), - 'libnss' => array( - 'label' => 'libnss-bg (system login with mysql)', - 'commands' => array( - 'apt-get install libnss-mysql-bg nscd', - 'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg' - ), - 'files' => array( - 'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg', - 'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg', - 'etc_nsswitch.conf' => '/etc/nsswitch.conf', - ), - 'restart' => array( - '/etc/init.d/nscd restart' - ) - ), - 'logrotate' => array( - 'label' => 'Logrotate', - 'commands_1' => array( - 'apt-get install logrotate', - 'touch /etc/logrotate.d/froxlor', - 'chmod 644 /etc/logrotate.d/froxlor' - ), - 'files' => array( - 'etc_logrotated_froxlor' => '/etc/logrotate.d/froxlor' - ), - 'commands_2' => array( - '# apt automatically adds a daily cronjob for logrotate', - '# you do not have to do anything else :)' - ) - ) - ) - ) - ) - ) -); diff --git a/lib/configfiles/rhel7.inc.php b/lib/configfiles/rhel7.inc.php deleted file mode 100644 index 9c6f5c4b..00000000 --- a/lib/configfiles/rhel7.inc.php +++ /dev/null @@ -1,169 +0,0 @@ - (2014-) - * @author Froxlor team (2014-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Configfiles - * - */ - -// Try to guess user/group from settings' email UID/GID -$vmail_user=posix_getpwuid(Settings::Get('system.vmail_uid')); -$vmail_group=posix_getgrgid(Settings::Get('system.vmail_gid')); - -/* If one of them are not set, call it 'vmail' and suggest creating user/group - * in scripts. */ -if ($vmail_user === false) { - $vmail_username="vmail"; -} else { - $vmail_username=$vmail_user['name']; -} -if ($vmail_group === false) { - $vmail_groupname="vmail"; -} else { - $vmail_groupname=$vmail_group['name']; -} - -return array( - 'rhel7' => array( - 'label' => 'RHEL / CentOS 7', - 'services' => array( - 'http' => array( - 'label' => $lng['admin']['configfiles']['http'], - 'daemons' => array( - 'apache' => array( - 'label' => 'Apache 2.4', - 'commands' => array( - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '' - ), - 'restart' => array( - 'systemctl reload-or-restart httpd.service' - ) - ), - ), - ), - 'smtp' => array( - 'label' => $lng['admin']['configfiles']['smtp'], - 'daemons' => array( - 'postfix' => array( - 'label' => 'Postfix 2.10', - 'commands_install' => array( - 'yum install postfix', - 'systemctl enable postfix.service', - ), - 'commands' => array( - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'touch /etc/postfix/mysql-virtual_alias_maps.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'touch /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chown root:root /etc/postfix/mysql-*.cf', - 'chmod 0600 /etc/postfix/mysql-*.cf', - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_master.cf' => '/etc/postfix/master.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf' - ), - 'restart' => array( - 'newaliases', - 'systemctl reload-or-restart postfix.service' - ) - ), - ) - ), - 'mail' => array( - 'label' => $lng['admin']['configfiles']['mail'], - 'daemons' => array( - 'dovecot' => array( - 'label' => 'Dovecot 2.2', - 'commands_install' => array( - 'yum install dovecot dovecot-mysql dovecot-pigeonhole', - 'systemctl enable dovecot.service', - ), - 'commands' => array( - 'touch /etc/dovecot/dovecot-sql.conf.ext', - 'chmod 0600 /etc/dovecot/dovecot-sql.conf.ext', - ), - 'files' => array( - 'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf', - 'etc_dovecot_dovecot-sql.conf.ext' => '/etc/dovecot/dovecot-sql.conf.ext', - 'etc_dovecot_conf.d_10-auth.conf' => '/etc/dovecot/conf.d/10-auth.conf', - 'etc_dovecot_conf.d_10-logging.conf' => '/etc/dovecot/conf.d/10-logging.conf', - 'etc_dovecot_conf.d_10-mail.conf' => '/etc/dovecot/conf.d/10-mail.conf', - 'etc_dovecot_conf.d_10-master.conf' => '/etc/dovecot/conf.d/10-master.conf', - 'etc_dovecot_conf.d_10-ssl.conf' => '/etc/dovecot/conf.d/10-ssl.conf', - 'etc_dovecot_conf.d_15-lda.conf' => '/etc/dovecot/conf.d/15-lda.conf', - 'etc_dovecot_conf.d_15-mailboxes.conf' => '/etc/dovecot/conf.d/15-mailboxes.conf', - 'etc_dovecot_conf.d_20-imap.conf' => '/etc/dovecot/conf.d/20-imap.conf', - 'etc_dovecot_conf.d_20-lmtp.conf' => '/etc/dovecot/conf.d/20-lmtp.conf', - 'etc_dovecot_conf.d_20-managesieve.conf' => '/etc/dovecot/conf.d/20-managesieve.conf', - 'etc_dovecot_conf.d_20-pop3.conf' => '/etc/dovecot/conf.d/20-pop3.conf', - 'etc_dovecot_conf.d_90-sieve.conf' => '/etc/dovecot/conf.d/90-sieve.conf', - ), - 'restart' => array( - 'systemctl reload-or-restart dovecot.service', - ) - ), - ) - ), - 'ftp' => array( - 'label' => $lng['admin']['configfiles']['ftp'], - 'daemons' => array( - 'proftpd' => array( - 'label' => 'ProFTPd 1.3', - 'commands_install' => array( - 'yum install proftpd proftpd-mysql', - 'systemctl enable proftpd.service', - ), - 'files' => array( - 'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf' - ), - 'restart' => array( - 'systemctl reload-or-restart proftpd.service' - ) - ), - ) - ), - 'etc' => array( - 'label' => $lng['admin']['configfiles']['etc'], - 'daemons' => array( - 'cron' => array( - 'label' => 'Crond (cronscript)', - 'files' => array( - 'etc_cron.d_froxlor' => '/etc/cron.d/froxlor' - ), - 'restart' => array( - 'systemctl reload-or-restart crond.service' - ) - ), - 'awstats' => array( - 'label' => 'Awstats', - 'commands' => array( - 'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - '# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself' - ) - ) - ) - ) - ) - ) -); diff --git a/lib/configfiles/trusty.inc.php b/lib/configfiles/trusty.inc.php deleted file mode 100644 index 6b84f909..00000000 --- a/lib/configfiles/trusty.inc.php +++ /dev/null @@ -1,416 +0,0 @@ - (2003-2009) - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Configfiles - * - */ - -// Try to guess user/group from settings' email UID/GID -$vmail_user=posix_getpwuid(Settings::Get('system.vmail_uid')); -$vmail_group=posix_getgrgid(Settings::Get('system.vmail_gid')); - -/* If one of them are not set, call it 'vmail' and suggest creating user/group - * in scripts. */ -if ($vmail_user === false) { - $vmail_username="vmail"; -} else { - $vmail_username=$vmail_user['name']; -} -if ($vmail_group === false) { - $vmail_groupname="vmail"; -} else { - $vmail_groupname=$vmail_group['name']; -} - -return array( - 'ubuntu_trusty' => array( - 'label' => 'Ubuntu 14.04 (Trusty)', - 'services' => array( - 'http' => array( - 'label' => $lng['admin']['configfiles']['http'], - 'daemons' => array( - 'apache2' => array( - 'label' => 'Apache 2', - 'commands' => array( - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'a2dismod userdir' - ), - 'files' => ((int)Settings::Get('phpfpm.enabled') == 1) ? - array( - 'etc_apache2_mods-enabled_fastcgi.conf' => '/etc/apache2/mods-enabled/fastcgi.conf' - ) - : - null, - 'restart' => array( - 'service apache2 restart' - ), - ), - 'lighttpd' => array( - 'label' => 'Lighttpd Webserver', - 'commands_1' => array( - 'apt-get install lighttpd', - ), - 'files' => array( - 'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf', - ), - 'commands_2' => array( - $configcommand['vhost'], - $configcommand['diroptions'], - $configcommand['v_inclighty'], - $configcommand['d_inclighty'], - 'lighty-disable-mod cgi', - 'lighty-disable-mod fastcgi', - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir') - ), - 'restart' => array( - 'service lighttpd restart' - ), - ), - 'nginx' => array( - 'label' => 'Nginx Webserver', - 'commands_1' => array( - 'apt-get install nginx php5-cgi php5-cli', - ), - 'files' => array( - 'etc_nginx_nginx.conf' => '/etc/nginx/nginx.conf', - 'etc_init.d_php-fcgi' => '/etc/init.d/php-fcgi' - ), - 'commands_2' => array( - 'rm /etc/nginx/sites-enabled/default', - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod u+x /etc/init.d/php-fcgi' - ), - 'restart' => array( - 'service php-fcgi start', - 'service nginx restart' - ) - ), - ), - ), - 'dns' => array( - 'label' => $lng['admin']['configfiles']['dns'], - 'daemons' => array( - 'bind' => array( - 'label' => 'Bind9', - 'commands' => array( - 'apt-get install bind9', - 'echo "include \"' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf\";" >> /etc/bind/named.conf', - 'touch ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chown root:bind ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chmod 0644 ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' - ), - 'restart' => array( - 'service bind9 restart' - ) - ), - 'powerdns' => array( - 'label' => 'PowerDNS', - 'files' => array( - 'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf', - 'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf', - ), - 'restart' => array( - 'service pdns restart' - ) - ), - ) - ), - 'smtp' => array( - 'label' => $lng['admin']['configfiles']['smtp'], - 'daemons' => array( - 'postfix_courier' => array( - 'label' => 'Postfix/Courier', - 'commands' => array( - 'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql', - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'mkdir -p /var/spool/postfix/etc/pam.d', - 'mkdir -p /var/spool/postfix/var/run/mysqld', - 'touch /etc/postfix/mysql-virtual_alias_maps.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'touch /etc/postfix/mysql-virtual_sender_permissions.cf', - 'touch /etc/postfix/sasl/smtpd.conf', - 'chown root:root /etc/postfix/main.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chown root:root /etc/postfix/sasl/smtpd.conf', - 'chmod 0644 /etc/postfix/main.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chmod 0600 /etc/postfix/sasl/smtpd.conf', - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf', - 'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf' - ), - 'restart' => array( - 'newaliases', - 'service postfix restart' - ) - ), - 'dkim' => array( - 'label' => 'DomainKey filter', - 'commands_1' => array( - 'apt-get install dkim-filter', - 'mkdir -p /etc/postfix/dkim' - ), - 'files' => array( - 'dkim-filter.conf' => '/etc/dkim-filter.conf' - ), - 'commands_2' => array( - 'echo "milter_default_action = accept" >> /etc/postfix/main.cf', - 'echo "milter_protocol = 2" >> /etc/postfix/main.cf', - 'echo "smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf', - 'echo "non_smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf' - ), - 'restart' => array( - 'service dkim-filter restart', - 'service postfix restart' - ) - ), - 'postfix_dovecot' => array( - 'label' => 'Postfix/Dovecot', - 'commands' => array( - 'apt-get install postfix postfix-mysql', - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'mkdir -p /var/spool/postfix/etc/pam.d', - 'mkdir -p /var/spool/postfix/var/run/mysqld', - 'touch /etc/postfix/mysql-virtual_alias_maps.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'touch /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chown root:root /etc/postfix/main.cf', - 'chown root:root /etc/postfix/master.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chmod 0644 /etc/postfix/main.cf', - 'chmod 0644 /etc/postfix/master.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf' - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_master.cf' => '/etc/postfix/master.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf' - ), - 'restart' => array( - 'newaliases', - 'service postfix restart' - ) - ), - 'postfix_mxaccess' => array( - 'label' => 'Postfix MX-Access (anti spam)', - 'files' => array( - 'etc_postfix_mx_access' => '/etc/postfix/mx_access', - 'etc_postfix_main.cf' => '/etc/postfix/main.cf' - ), - 'commands_1' => array( - 'postmap /etc/postfix/mx_access' - ), - 'restart' => array( - 'service postfix restart' - ) - ), - 'exim4' => array( - 'label' => 'Exim4', - 'commands_1' => array( - 'dpkg-reconfigure exim4-config', - '# choose "no configuration at this time" and "splitted configuration files" in the dialog' - ), - 'files' => array( - 'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul', - 'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config', - 'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options', - 'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config', - 'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config' - ), - 'commands_2' => array( - 'chmod o-rx /var/lib/exim4', - 'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options' - ), - 'restart' => array( - 'service exim4 restart' - ) - ) - ) - ), - 'mail' => array( - 'label' => $lng['admin']['configfiles']['mail'], - 'daemons' => array( - 'courier' => array( - 'label' => 'Courier', - 'commands' => array( - 'apt-get install courier-pop courier-imap courier-authlib-mysql' - ), - 'files' => array( - 'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc', - 'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc' - ), - 'restart' => array( - 'service courier-authdaemon restart', - 'service courier-pop restart' - ) - ), - 'dovecot' => array( - 'label' => 'Dovecot', - 'commands_1' => array( - 'apt-get install dovecot-imapd dovecot-pop3d dovecot-mysql mail-stack-delivery' - ), - 'files' => array( - 'etc_dovecot_conf.d_01_mail_stack_delivery.conf' => '/etc/dovecot/conf.d/01-mail-stack-delivery.conf', - 'etc_dovecot_conf.d_10_auth.conf' => '/etc/dovecot/conf.d/10-auth.conf', - 'etc_dovecot_dovecot-sql.conf.ext' => '/etc/dovecot/dovecot-sql.conf.ext' - ), - 'restart' => array( - 'service dovecot restart' - ) - ) - ) - ), - 'ftp' => array( - 'label' => $lng['admin']['configfiles']['ftp'], - 'daemons' => array( - 'proftpd' => array( - 'label' => 'ProFTPd', - 'commands' => array( - 'apt-get install proftpd-basic proftpd-mod-mysql' - ), - 'files' => array( - 'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf', - 'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf', - 'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf' - ), - 'restart' => array( - 'service proftpd restart' - ) - ), - 'pure-ftpd' => array( - 'label' => 'Pure FTPd', - 'commands_1' => array( - 'apt-get install pure-ftpd-common pure-ftpd-mysql' - ), - 'files' => array( - 'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID', - 'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile', - 'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous', - 'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime', - 'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone', - 'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication', - 'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf', - 'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof', - 'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind', - 'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common' - ), - 'commands_2' => array( - 'chmod 0640 /etc/pure-ftpd/db/mysql.conf' - ), - 'restart' => array( - 'service pure-ftpd-mysql restart' - ) - ), - ) - ), - 'etc' => array( - 'label' => $lng['admin']['configfiles']['etc'], - 'daemons' => array( - 'cron' => array( - 'label' => 'Crond (cronscript)', - 'files' => array( - 'etc_cron.d_froxlor' => '/etc/cron.d/froxlor' - ), - 'restart' => array( - Settings::Get('system.crondreload') - ) - ), - 'awstats' => array( - 'label' => 'Awstats', - 'commands' => array( - 'apt-get install awstats', - 'cp /usr/share/awstats/tools/awstats_buildstaticpages.pl '.makeCorrectDir(Settings::Get('system.awstats_path')), - 'mv '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.conf').' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - '# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself', - 'rm /etc/cron.d/awstats' - ), - ), - 'libnss' => array( - 'label' => 'libnss-bg (system login with mysql)', - 'commands' => array( - 'apt-get install libnss-mysql-bg nscd', - 'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg' - ), - 'files' => array( - 'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg', - 'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg', - 'etc_nsswitch.conf' => '/etc/nsswitch.conf', - ), - 'restart' => array( - 'service nscd restart' - ) - ), - 'logrotate' => array( - 'label' => 'Logrotate', - 'commands_1' => array( - 'apt-get install logrotate', - 'touch /etc/logrotate.d/froxlor', - 'chmod 644 /etc/logrotate.d/froxlor' - ), - 'files' => array( - 'etc_logrotated_froxlor' => '/etc/logrotate.d/froxlor' - ), - 'commands_2' => array( - '# apt automatically adds a daily cronjob for logrotate', - '# you do not have to do anything else :)' - ) - ) - ) - ) - ) - ) -); diff --git a/lib/configfiles/wheezy.inc.php b/lib/configfiles/wheezy.inc.php deleted file mode 100644 index de5317cd..00000000 --- a/lib/configfiles/wheezy.inc.php +++ /dev/null @@ -1,457 +0,0 @@ - (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Configfiles - * - */ - -// Try to guess user/group from settings' email UID/GID -$vmail_user=posix_getpwuid(Settings::Get('system.vmail_uid')); -$vmail_group=posix_getgrgid(Settings::Get('system.vmail_gid')); - -/* If one of them are not set, call it 'vmail' and suggest creating user/group - * in scripts. */ -if ($vmail_user === false) { - $vmail_username="vmail"; -} else { - $vmail_username=$vmail_user['name']; -} -if ($vmail_group === false) { - $vmail_groupname="vmail"; -} else { - $vmail_groupname=$vmail_group['name']; -} - -return array( - 'debian_wheezy' => array( - 'label' => 'Debian 7.0 (Wheezy)', - 'services' => array( - 'http' => array( - 'label' => $lng['admin']['configfiles']['http'], - 'daemons' => array( - 'apache2' => array( - 'label' => 'Apache 2', - 'commands' => array( - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'a2dismod userdir' - ), - 'files' => ((int)Settings::Get('phpfpm.enabled') == 1) ? - array( - 'etc_apache2_mods-enabled_fastcgi.conf' => '/etc/apache2/mods-enabled/fastcgi.conf' - ) - : - null, - 'restart' => array( - '/etc/init.d/apache2 restart' - ), - ), - 'lighttpd' => array( - 'label' => 'Lighttpd Webserver', - 'commands_1' => array( - 'apt-get install lighttpd', - ), - 'files' => array( - 'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf', - ), - 'commands_2' => array( - $configcommand['vhost'], - $configcommand['diroptions'], - $configcommand['v_inclighty'], - $configcommand['d_inclighty'], - 'lighty-disable-mod cgi', - 'lighty-disable-mod fastcgi', - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir') - ), - 'restart' => array( - '/etc/init.d/lighttpd restart' - ) - ), - 'nginx' => array( - 'label' => 'Nginx Webserver', - 'commands_1' => array( - 'apt-get install nginx php5-cgi', - ), - 'files' => array( - 'etc_nginx_nginx.conf' => '/etc/nginx/nginx.conf', - 'etc_init.d_php-fcgi' => '/etc/init.d/php-fcgi' - ), - 'commands_2' => array( - 'rm /etc/nginx/sites-enabled/default', - 'mkdir -p ' . Settings::Get('system.documentroot_prefix'), - 'mkdir -p ' . Settings::Get('system.logfiles_directory'), - (Settings::Get('system.deactivateddocroot') != '') ? 'mkdir -p ' . Settings::Get('system.deactivateddocroot') : '', - 'mkdir -p ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod 1777 ' . Settings::Get('system.mod_fcgid_tmpdir'), - 'chmod u+x /etc/init.d/php-fcgi' - ), - 'restart' => array( - '/etc/init.d/php-fcgi start', - '/etc/init.d/nginx restart' - ) - ) - ) - ), - 'dns' => array( - 'label' => $lng['admin']['configfiles']['dns'], - 'daemons' => array( - 'bind' => array( - 'label' => 'Bind9', - 'commands' => array( - 'apt-get install bind9', - 'echo "include \"' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf\";" >> /etc/bind/named.conf.local', - 'touch ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chown root:bind ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf', - 'chmod 0644 ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' - ), - 'restart' => array( - '/etc/init.d/bind9 restart' - ) - ), - 'powerdns' => array( - 'label' => 'PowerDNS', - 'files' => array( - 'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf', - 'etc_powerdns_bindbackend.conf' => '/etc/powerdns/bindbackend.conf', - ), - 'restart' => array( - '/etc/init.d/pdns restart' - ) - ), - ) - ), - 'smtp' => array( - 'label' => $lng['admin']['configfiles']['smtp'], - 'daemons' => array( - 'postfix_courier' => array( - 'label' => 'Postfix/Courier', - 'commands' => array( - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' '.$vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . Settings::Get('system.vmail_homedir'), - 'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql', - 'mkdir -p /var/spool/postfix/etc/pam.d', - 'mkdir -p /var/spool/postfix/var/run/mysqld', - 'touch /etc/postfix/mysql-virtual_alias_maps.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'touch /etc/postfix/mysql-virtual_sender_permissions.cf', - 'touch /etc/postfix/sasl/smtpd.conf', - 'chown root:root /etc/postfix/main.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chown root:root /etc/postfix/sasl/smtpd.conf', - 'chmod 0644 /etc/postfix/main.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chmod 0600 /etc/postfix/sasl/smtpd.conf', - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf', - 'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf', - 'etc_aliases' => '/etc/aliases' - ), - 'restart' => array( - 'newaliases', - '/etc/init.d/postfix restart' - ) - ), - 'dkim' => array( - 'label' => 'DomainKey filter', - 'commands_1' => array( - 'apt-get install opendkim', - 'mkdir -p /etc/postfix/dkim' - ), - 'files' => array( - 'opendkim.conf' => '/etc/opendkim.conf' - ), - 'commands_2' => array( - 'echo "milter_default_action = accept" >> /etc/postfix/main.cf', - 'echo "milter_protocol = 6" >> /etc/postfix/main.cf', - 'echo "smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf', - 'echo "non_smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf' - ), - 'restart' => array( - '/etc/init.d/opendkim restart', - '/etc/init.d/postfix restart' - ) - ), - 'postfix_dovecot' => array( - 'label' => 'Postfix/Dovecot', - 'commands' => array( - ($vmail_group === false) ? 'groupadd -g ' . Settings::Get('system.vmail_gid') . ' ' . $vmail_groupname : '', - ($vmail_user === false) ? 'useradd -u ' . Settings::Get('system.vmail_uid') . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '', - 'mkdir -p ' . Settings::Get('system.vmail_homedir'), - 'chown -R ' . $vmail_username . ':' . $vmail_groupname . ' ' . Settings::Get('system.vmail_homedir'), - 'apt-get install postfix postfix-mysql', - 'mkdir -p /var/spool/postfix/etc/pam.d', - 'mkdir -p /var/spool/postfix/var/run/mysqld', - 'touch /etc/postfix/mysql-virtual_alias_maps.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'touch /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'touch /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chown root:root /etc/postfix/main.cf', - 'chown root:root /etc/postfix/master.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf', - 'chmod 0644 /etc/postfix/main.cf', - 'chmod 0644 /etc/postfix/master.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf', - 'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf' - ), - 'files' => array( - 'etc_postfix_main.cf' => '/etc/postfix/main.cf', - 'etc_postfix_master.cf' => '/etc/postfix/master.cf', - 'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf', - 'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf', - 'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf', - 'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf', - 'etc_aliases' => '/etc/aliases' - ), - 'restart' => array( - 'newaliases', - '/etc/init.d/postfix restart' - ) - ), - 'postfix_mxaccess' => array( - 'label' => 'Postfix MX-Access (anti spam)', - 'files' => array( - 'etc_postfix_mx_access' => '/etc/postfix/mx_access', - 'etc_postfix_main.cf' => '/etc/postfix/main.cf' - ), - 'commands_1' => array( - 'postmap /etc/postfix/mx_access' - ), - 'restart' => array( - '/etc/init.d/postfix restart' - ) - ), - 'exim4' => array( - 'label' => 'Exim4', - 'commands_1' => array( - 'dpkg-reconfigure exim4-config', - '# choose "no configuration at this time" and "splitted configuration files" in the dialog' - ), - 'files' => array( - 'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt', - 'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config', - 'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options', - 'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config', - 'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config' - ), - 'commands_2' => array( - 'chmod o-rx /var/lib/exim4', - 'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options' - ), - 'restart' => array( - '/etc/init.d/exim4 restart' - ) - ) - ) - ), - 'mail' => array( - 'label' => $lng['admin']['configfiles']['mail'], - 'daemons' => array( - 'courier' => array( - 'label' => 'Courier', - 'commands' => array( - 'apt-get install courier-pop courier-imap courier-authlib-mysql' - ), - 'files' => array( - 'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc', - 'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc' - ), - 'restart' => array( - '/etc/init.d/courier-authdaemon restart', - '/etc/init.d/courier-pop restart' - ) - ), - 'dovecot' => array( - 'label' => 'Dovecot', - 'commands_1' => array( - 'apt-get install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-managesieved dovecot-sieve' - ), - 'files' => array( - 'etc_dovecot_conf.d_10-auth.conf' => '/etc/dovecot/conf.d/10-auth.conf', - 'etc_dovecot_conf.d_10-mail.conf' => '/etc/dovecot/conf.d/10-mail.conf', - 'etc_dovecot_conf.d_10-master.conf' => '/etc/dovecot/conf.d/10-master.conf', - 'etc_dovecot_conf.d_15-lda.conf' => '/etc/dovecot/conf.d/15-lda.conf', - 'etc_dovecot_conf.d_20-imap.conf' => '/etc/dovecot/conf.d/20-imap.conf', - 'etc_dovecot_conf.d_20-pop3.conf' => '/etc/dovecot/conf.d/20-pop3.conf', - 'etc_dovecot_conf.d_20-managesieve.conf' => '/etc/dovecot/20-managesieve.conf', - 'etc_dovecot_conf.d_90-sieve.conf' => '/etc/dovecot/90-sieve.conf', - 'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf', - 'etc_dovecot_dovecot-sql.conf.ext' => '/etc/dovecot/dovecot-sql.conf.ext' - ), - 'restart' => array( - '/etc/init.d/dovecot restart' - ) - ) - ) - ), - 'ftp' => array( - 'label' => $lng['admin']['configfiles']['ftp'], - 'daemons' => array( - 'proftpd' => array( - 'label' => 'ProFTPd', - 'commands' => array( - 'apt-get install proftpd-basic proftpd-mod-mysql' - ), - 'files' => array( - 'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf', - 'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf', - 'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf' - ), - 'restart' => array( - '/etc/init.d/proftpd restart' - ) - ), - 'pure-ftpd' => array( - 'label' => 'Pure FTPd', - 'commands_1' => array( - 'apt-get install pure-ftpd-common pure-ftpd-mysql' - ), - 'files' => array( - 'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID', - 'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile', - 'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous', - 'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime', - 'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone', - 'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication', - 'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf', - 'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof', - 'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind', - 'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common' - ), - 'commands_2' => array( - 'chmod 0640 /etc/pure-ftpd/db/mysql.conf' - ), - 'restart' => array( - '/etc/init.d/pure-ftpd-mysql restart' - ) - ), - ) - ), - 'etc' => array( - 'label' => $lng['admin']['configfiles']['etc'], - 'daemons' => array( - 'cron' => array( - 'label' => 'Crond (cronscript)', - 'files' => array( - 'etc_cron.d_froxlor' => '/etc/cron.d/froxlor' - ), - 'restart' => array( - Settings::Get('system.crondreload') - ) - ), - 'awstats' => array( - 'label' => 'Awstats', - 'commands' => array( - 'apt-get install awstats', - 'cp /usr/share/awstats/tools/awstats_buildstaticpages.pl '.makeCorrectDir(Settings::Get('system.awstats_path')), - 'mv '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.conf').' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - 'sed -i.bak \'s|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|\' '.makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.model.conf'), - '# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself', - 'rm /etc/cron.d/awstats' - ), - ), - 'libnss' => array( - 'label' => 'libnss (system login with mysql)', - 'commands' => array( - 'apt-get install libnss-mysql-bg nscd', - 'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg' - ), - 'files' => array( - 'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg', - 'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg', - 'etc_nsswitch.conf' => '/etc/nsswitch.conf', - ), - 'restart' => array( - '/etc/init.d/nscd restart' - ) - ), - 'logrotate' => array( - 'label' => 'Logrotate', - 'commands_1' => array( - 'apt-get install logrotate', - 'touch /etc/logrotate.d/froxlor', - 'chmod 644 /etc/logrotate.d/froxlor' - ), - 'files' => array( - 'etc_logrotated_froxlor' => '/etc/logrotate.d/froxlor' - ), - 'commands_2' => array( - '# apt automatically adds a daily cronjob for logrotate', - '# you do not have to do anything else :)' - ) - ), - 'fcgid' => array( - 'label' => 'FCGID', - 'commands' => array( - 'apt-get install apache2-suexec libapache2-mod-fcgid php5-cgi', - 'a2enmod suexec fcgid', - (Settings::Get('system.mod_fcgid_ownvhost') == '1') ? 'groupadd -f '.Settings::Get('system.mod_fcgid_httpgroup') : null, - (Settings::Get('system.mod_fcgid_ownvhost') == '1') ? 'useradd -s /bin/false -g '.Settings::Get('system.mod_fcgid_httpgroup').' '.Settings::Get('system.mod_fcgid_httpuser') : null, - (Settings::Get('system.mod_fcgid_ownvhost') == '1') ? 'chown -R '.Settings::Get('system.mod_fcgid_httpuser').':'.Settings::Get('system.mod_fcgid_httpgroup').' '.FROXLOR_INSTALL_DIR : null, - (Settings::Get('system.mod_fcgid_ownvhost') == '1') ? 'mkdir -p '.makeCorrectDir(Settings::Get('system.mod_fcgid_configdir')) : null, - (Settings::Get('system.mod_fcgid_ownvhost') == '1') ? 'mkdir -p '.makeCorrectDir(Settings::Get('system.mod_fcgid_tmpdir')) : null, - (Settings::Get('system.mod_fcgid_ownvhost') == '1') ? 'a2dismod php5' : null - ), - 'restart' => array( - Settings::Get('system.apachereload_command') - ) - ), - 'php-fpm' => array( - 'label' => 'PHP-FPM', - 'commands' => array( - (Settings::Get('system.webserver') == 'apache2') ? '# add "non-free" after all occurrences of "main" in /etc/apt/sources.list' : null, - (Settings::Get('system.webserver') == 'apache2') ? '# this is needed for libapache2-mod-fastcgi to install' : null, - 'apt-get install '.((Settings::Get('system.webserver') == 'apache2') ? 'apache2-suexec libapache2-mod-fastcgi ' : '') . 'php5-fpm', - 'rm /etc/php5/fpm/pool.d/www.conf', - (Settings::Get('system.webserver') == 'apache2') ? 'a2enmod suexec fastcgi actions' : null, - (Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'groupadd -f '.Settings::Get('phpfpm.vhost_httpgroup') : null, - (Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'useradd -s /bin/false -g '.Settings::Get('phpfpm.vhost_httpgroup').' '.Settings::Get('phpfpm.vhost_httpuser') : null, - (Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'usermod -aG '.Settings::Get('phpfpm.vhost_httpgroup').' '.Settings::Get('system.httpuser') : null, - (Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'chown -R '.Settings::Get('phpfpm.vhost_httpuser').':'.Settings::Get('phpfpm.vhost_httpgroup').' '.FROXLOR_INSTALL_DIR : null, - (Settings::Get('system.webserver') == 'apache2' && Settings::Get('phpfpm.enabled_ownvhost') == '1') ? 'a2dismod php5' : null - ), - 'restart' => array( - Settings::Get('system.apachereload_command') - ) - ) - ) - ) - ) - ) -);