diff --git a/install/debian/apache2-pma.conf b/install/debian/apache2-pma.conf new file mode 100644 index 000000000..2a8f69e25 --- /dev/null +++ b/install/debian/apache2-pma.conf @@ -0,0 +1,42 @@ +# phpMyAdmin default Apache configuration + +Alias /phpmyadmin /usr/share/phpmyadmin + + + Options FollowSymLinks + DirectoryIndex index.php + + + AddType application/x-httpd-php .php + + php_flag magic_quotes_gpc Off + php_flag track_vars On + php_flag register_globals Off + php_admin_flag allow_url_fopen Off + php_value include_path . + php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp + php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext + + + + +# Authorize for setup + + + AuthType Basic + AuthName "phpMyAdmin Setup" + AuthUserFile /etc/phpmyadmin/htpasswd.setup + + Require valid-user + + +# Disallow web access to directories that don't need it + + Order Deny,Allow + Deny from All + + + Order Deny,Allow + Deny from All + + diff --git a/install/debian/apache2-status.conf b/install/debian/apache2-status.conf new file mode 100644 index 000000000..da9d96333 --- /dev/null +++ b/install/debian/apache2-status.conf @@ -0,0 +1,8 @@ +Listen 127.0.0.1:8081 + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + Allow from all + diff --git a/install/debian/apache2-webmail.conf b/install/debian/apache2-webmail.conf new file mode 100644 index 000000000..a0c87bcc6 --- /dev/null +++ b/install/debian/apache2-webmail.conf @@ -0,0 +1,40 @@ +Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/ +Alias /roundcube /var/lib/roundcube +Alias /webmail /var/lib/roundcube + +# Access to tinymce files + + Options Indexes MultiViews FollowSymLinks + AllowOverride None + Order allow,deny + allow from all + + + + Options +FollowSymLinks + # This is needed to parse /var/lib/roundcube/.htaccess. See its + # content before setting AllowOverride to None. + AllowOverride All + order allow,deny + allow from all + + +# Protecting basic directories: + + Options -FollowSymLinks + AllowOverride None + + + + Options -FollowSymLinks + AllowOverride None + Order allow,deny + Deny from all + + + + Options -FollowSymLinks + AllowOverride None + Order allow,deny + Deny from all + diff --git a/install/debian/apache2.conf b/install/debian/apache2.conf new file mode 100644 index 000000000..140acee09 --- /dev/null +++ b/install/debian/apache2.conf @@ -0,0 +1,87 @@ +# It is split into several files forming the configuration hierarchy outlined +# below, all located in the /etc/apache2/ directory: +# +# /etc/apache2/ +# |-- apache2.conf +# | `-- ports.conf +# |-- mods-enabled +# | |-- *.load +# | `-- *.conf +# |-- conf.d +# | `-- * + +# Global configuration +LockFile ${APACHE_LOCK_DIR}/accept.lock +PidFile ${APACHE_PID_FILE} +Timeout 30 +KeepAlive Off +MaxKeepAliveRequests 100 +KeepAliveTimeout 10 + + + StartServers 8 + MinSpareServers 5 + MaxSpareServers 20 + ServerLimit 256 + MaxClients 200 + MaxRequestsPerChild 4000 + + + + StartServers 2 + MinSpareThreads 25 + MaxSpareThreads 75 + ThreadLimit 64 + ThreadsPerChild 25 + MaxClients 200 + MaxRequestsPerChild 4000 + + + + StartServers 2 + MinSpareThreads 25 + MaxSpareThreads 75 + ThreadLimit 64 + ThreadsPerChild 25 + MaxClients 200 + MaxRequestsPerChild 4000 + + +# These need to be set in /etc/apache2/envvars +User ${APACHE_RUN_USER} +Group ${APACHE_RUN_GROUP} +#User www-data +#Group www-data + +AccessFileName .htaccess + + + Order allow,deny + Deny from all + Satisfy all + + +DefaultType None +HostnameLookups Off + +ErrorLog ${APACHE_LOG_DIR}/error.log +LogLevel warn + +# Include module configuration: +Include mods-enabled/*.load +Include mods-enabled/*.conf + +# Include list of ports to listen on and which to use for name based vhosts +Include ports.conf + +LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined +LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%h %l %u %t \"%r\" %>s %O" common +LogFormat "%{Referer}i -> %U" referer +LogFormat "%{User-agent}i" agent +LogFormat "%b" bytes + +Include conf.d/ + +# Include the virtual host configurations: +#Include sites-enabled/ diff --git a/install/debian/apache2.log b/install/debian/apache2.log new file mode 100644 index 000000000..27629d0dd --- /dev/null +++ b/install/debian/apache2.log @@ -0,0 +1,19 @@ +/var/log/apache2/*.log /var/log/apache2/domains/*log { + weekly + missingok + rotate 52 + compress + delaycompress + notifempty + create 640 root adm + sharedscripts + postrotate + /etc/init.d/apache2 reload > /dev/null || true + [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid` + endscript + prerotate + if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ + run-parts /etc/logrotate.d/httpd-prerotate; \ + fi; \ + endscript +} diff --git a/install/debian/apache2.readme.txt b/install/debian/apache2.readme.txt new file mode 100644 index 000000000..b8d05cbe1 --- /dev/null +++ b/install/debian/apache2.readme.txt @@ -0,0 +1,11 @@ +# +# _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| +# _| _| _| _| _| _| _| +# _| _| _|_|_| _|_| _| _|_|_|_| +# _| _| _| _| _| _| _| +# _| _|_|_|_| _|_|_| _| _| _| +# +# +# Server is manager by Vesta Control Panel. +# See /etc/apache2/conf.d/vesta.conf to get a full list of running vhosts. +# diff --git a/install/debian/certificate.crt b/install/debian/certificate.crt new file mode 100644 index 000000000..4a3230ac2 --- /dev/null +++ b/install/debian/certificate.crt @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDqjCCApICCQCBAQdAxoNnAjANBgkqhkiG9w0BAQUFADCBljELMAkGA1UEBhMC +VVMxFjAUBgNVBAgMDU1hc3NhY2h1c2V0dHMxEzARBgNVBAcMClN3YW1wc2NvdHQx +EDAOBgNVBAoMB1Zlc3RhQ1AxCzAJBgNVBAsMAklUMRowGAYDVQQDDBFwYW5lbC52 +ZXN0YWNwLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B2ZXN0YWNwLmNvbTAeFw0x +MzA5MjMwNzA0NDVaFw0xNDA5MjMwNzA0NDVaMIGWMQswCQYDVQQGEwJVUzEWMBQG +A1UECAwNTWFzc2FjaHVzZXR0czETMBEGA1UEBwwKU3dhbXBzY290dDEQMA4GA1UE +CgwHVmVzdGFDUDELMAkGA1UECwwCSVQxGjAYBgNVBAMMEXBhbmVsLnZlc3RhY3Au +Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHZlc3RhY3AuY29tMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvu84meigHrwPmzEbFpKe/o8FTKwO5w1VL0HU +ILVW5EBGT76VEBqpWC+x0QrChHit14FV7m+hZRvhhkulXrknChTTNA500EVNZ5Wb +UpDWezZDivTKAHzzq0aUwKB230Tz+k3j+duBcbzwFwirnDXb5dE5RqzBOhiIvDw9 +mjP66UyH8RxFF+pTAPlcF18zWak7KnaDreyGknzy7m+Zqs07uLnb0wTgcwIcqREP +eqgw0E8xrEdjz1N9HIvxi+glfnjNgHja3cCYhe9ZCpDDr9ERXrEcULrqRuch6Zfv +QKoscG4dankbq0V4DfpMBYMTvFvFLLp/uWvwLjunzfu37XmBLQIDAQABMA0GCSqG +SIb3DQEBBQUAA4IBAQBl+GF4Ii+7cW0tWVTsDh0Kw+rjc9bEA0eF4p3LBLEsFRkP +Yeqp2t0g8RTAAiq3OyUWYISzOX8xu0i56/3jUFazABBjz0P0w2A0BfRZS5TAEwxJ +TS9zAgobBuLtTh3FDJJIRXLJOKLJZVUmi6D+8QIQVOox0925tMIxGc9CxLK05bIc +HUYdHsn1gDwmTWem/XED559eWV/vGnvf3Ea0EHU76kTQaLPkul2y8BTbbLaHSw96 +1xFc8x9gqxWTT70YmBpZIApmSzvOGVXqTduMY/CeEbmigo1/1i2YMVjePFEDYnmE +/f6rNQrtM9kgtE+glWdA7zHlaigKl3SVof1ETStB +-----END CERTIFICATE----- diff --git a/install/debian/certificate.key b/install/debian/certificate.key new file mode 100644 index 000000000..eb913d684 --- /dev/null +++ b/install/debian/certificate.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAvu84meigHrwPmzEbFpKe/o8FTKwO5w1VL0HUILVW5EBGT76V +EBqpWC+x0QrChHit14FV7m+hZRvhhkulXrknChTTNA500EVNZ5WbUpDWezZDivTK +AHzzq0aUwKB230Tz+k3j+duBcbzwFwirnDXb5dE5RqzBOhiIvDw9mjP66UyH8RxF +F+pTAPlcF18zWak7KnaDreyGknzy7m+Zqs07uLnb0wTgcwIcqREPeqgw0E8xrEdj +z1N9HIvxi+glfnjNgHja3cCYhe9ZCpDDr9ERXrEcULrqRuch6ZfvQKoscG4dankb +q0V4DfpMBYMTvFvFLLp/uWvwLjunzfu37XmBLQIDAQABAoIBAF59YsSAJCWxqgOC +dMZh/z85JkVAbQuZRIvjhwg81eiVinZSedCDcUUMLXKnYYZPdrDM9+rM4dF4z843 +R3quJIzPq4n6kYK0mU7m8fwVY5+MRjbRV9qP+8LKZjlB8DIkHJ3FyEnRgKj5+NNd +Xhgra0y7kx3Pxrxqgdit80qJ6OVlN2gsMjUcDBhqQev9Xs8cKYjYc1uPtFw14B2G +5fsNE8cHJA+hH/aym7xTaEQlz/JOKn2GsH/dOhm3RM2QygdyrVOBBj6rKSi03LMb +7QOkDvZ3nBltxQKOqs2PkYyEAdqR4dMZIPNxye/k21iVovLeMVe4lG7BmNOD6XwB ++TOhYh0CgYEA9WyUeSNPP309Br65wg61GdapWmQIaj7HSZE06BWhp82PPwHaF1yY +p9hWgo6fDxwHiTSLeUqEPXJMaPG+RxvYFc7Lc3JjOKU4ezR9fqz01LLtWXHVVT/x +RZuogMyaDhIjhwMyu4mybpUMkBQ/B3DFufrzTv0y8ljAc0nlFsuXaPMCgYEAxymI +btxZFGES6UNG7ldEaihll9MpP22/VghUeAaia0qgnXlYkbngIIhGpGJUkvZ2pduE +tfw2S20k38qvrWXx/NhLxmiVSIvq5TFi/22dfT20kfrdCcnkrp/tRpeR72IrQ6Kx ++6l7QHV5Gjcc4rvNc8mw7itVu+StgCYx+koD9V8CgYA8sThaaLf9XGxOEbaAXgC9 +Pg+tcdV+6L2B3O33gvnyNGx7SWr0ogqCX4atTLXbF7RpYtwnB52CUJTC0x2aGjGq +2vQHPb95z6oTFdz/CaiWPRVjLDp0lZaF/0OBbpeeaS/uAIV4SUod/LAZpVgc7++F +2aB35TfHJNma6ShFJd3wrwKBgBH444DtjXRTVjuKgKodYeUahCBxQ7Wfl7aRxd2W +66027MuJGb78wQbuhUFsRimE6CwLZSxu+A9SaBNx3OyO2Ilyk1PyOBZ12dqY3FAk +eiPFH7hUpQGvIF3JvMW0A81QVIsj8V++aYrljuoYsxiaze128+pqKrBr8GQyDiyB +5V2NAoGBAIPWovM20cbx6LpEuFN5Pmkl500F6sTc8F3DQVRe3JhwVhqHQXv7tUE1 +VHMqpMybUQin8q/RXvJ0vr2sQEe2fVC2a0FWJTqww1eMwu1V9ppUJAfXfaYWY+XJ +4d3myajakr0Eh3ia+IrSBcMRJ2sD3sL5KQC6jbD0R8odex4syiu2 +-----END RSA PRIVATE KEY----- diff --git a/install/debian/clamd.conf b/install/debian/clamd.conf new file mode 100644 index 000000000..ea982697a --- /dev/null +++ b/install/debian/clamd.conf @@ -0,0 +1,61 @@ +#Automatically Generated by clamav-base postinst +#To reconfigure clamd run #dpkg-reconfigure clamav-base +#Please read /usr/share/doc/clamav-base/README.Debian.gz for details +LocalSocket /var/run/clamav/clamd.ctl +FixStaleSocket true +LocalSocketGroup clamav +LocalSocketMode 666 +# TemporaryDirectory is not set to its default /tmp here to make overriding +# the default with environment variables TMPDIR/TMP/TEMP possible +User clamav +AllowSupplementaryGroups true +ScanMail true +ScanArchive true +ArchiveBlockEncrypted false +MaxDirectoryRecursion 15 +FollowDirectorySymlinks false +FollowFileSymlinks false +ReadTimeout 180 +MaxThreads 12 +MaxConnectionQueueLength 15 +LogSyslog false +LogFacility LOG_LOCAL6 +LogClean false +LogVerbose true +PidFile /var/run/clamav/clamd.pid +DatabaseDirectory /var/lib/clamav +SelfCheck 3600 +Foreground false +Debug false +ScanPE true +ScanOLE2 true +ScanHTML true +DetectBrokenExecutables false +ExitOnOOM false +LeaveTemporaryFiles false +AlgorithmicDetection true +ScanELF true +IdleTimeout 30 +PhishingSignatures true +PhishingScanURLs true +PhishingAlwaysBlockSSLMismatch false +PhishingAlwaysBlockCloak false +DetectPUA false +ScanPartialMessages false +HeuristicScanPrecedence false +StructuredDataDetection false +CommandReadTimeout 5 +SendBufTimeout 200 +MaxQueue 100 +ExtendedDetectionInfo true +OLE2BlockMacros false +StreamMaxLength 25M +LogFile /var/log/clamav/clamav.log +LogTime true +LogFileUnlock false +LogFileMaxSize 0 +Bytecode true +BytecodeSecurity TrustSigned +BytecodeTimeout 60000 +OfficialDatabaseOnly false +CrossFilesystems true diff --git a/install/debian/dnsbl.conf b/install/debian/dnsbl.conf new file mode 100644 index 000000000..5166b255e --- /dev/null +++ b/install/debian/dnsbl.conf @@ -0,0 +1,2 @@ +bl.spamcop.net +zen.spamhaus.org diff --git a/install/debian/dovecot-conf.d.tar.gz b/install/debian/dovecot-conf.d.tar.gz new file mode 100644 index 000000000..a2f484874 Binary files /dev/null and b/install/debian/dovecot-conf.d.tar.gz differ diff --git a/install/debian/dovecot.conf b/install/debian/dovecot.conf new file mode 100644 index 000000000..0a8553510 --- /dev/null +++ b/install/debian/dovecot.conf @@ -0,0 +1,4 @@ +protocols = imap pop3 +listen = *, :: +base_dir = /var/run/dovecot/ +!include conf.d/*.conf diff --git a/install/debian/dovecot/conf.d/10-auth.conf b/install/debian/dovecot/conf.d/10-auth.conf new file mode 100644 index 000000000..dfcc83110 --- /dev/null +++ b/install/debian/dovecot/conf.d/10-auth.conf @@ -0,0 +1,4 @@ +disable_plaintext_auth = no +auth_verbose = yes +auth_mechanisms = plain login +!include auth-passwdfile.conf.ext diff --git a/install/debian/dovecot/conf.d/10-logging.conf b/install/debian/dovecot/conf.d/10-logging.conf new file mode 100644 index 000000000..a5f207d51 --- /dev/null +++ b/install/debian/dovecot/conf.d/10-logging.conf @@ -0,0 +1 @@ +log_path = /var/log/dovecot.log diff --git a/install/debian/dovecot/conf.d/10-mail.conf b/install/debian/dovecot/conf.d/10-mail.conf new file mode 100644 index 000000000..55313419e --- /dev/null +++ b/install/debian/dovecot/conf.d/10-mail.conf @@ -0,0 +1,4 @@ +mail_privileged_group = mail +mail_access_groups = mail +mail_location = maildir:%h/mail/%d/%n +pop3_uidl_format = %08Xu%08Xv diff --git a/install/debian/dovecot/conf.d/10-master.conf b/install/debian/dovecot/conf.d/10-master.conf new file mode 100644 index 000000000..a75a9aaa4 --- /dev/null +++ b/install/debian/dovecot/conf.d/10-master.conf @@ -0,0 +1,29 @@ +service imap-login { + inet_listener imap { + } + inet_listener imaps { + } +} + +service pop3-login { + inet_listener pop3 { + } + inet_listener pop3s { + } +} + + +service imap { +} + +service pop3 { +} + +service auth { + unix_listener auth-client { + group = mail + mode = 0660 + user = dovecot + } + user = dovecot +} diff --git a/install/debian/dovecot/conf.d/10-ssl.conf b/install/debian/dovecot/conf.d/10-ssl.conf new file mode 100644 index 000000000..e1d444239 --- /dev/null +++ b/install/debian/dovecot/conf.d/10-ssl.conf @@ -0,0 +1,3 @@ +ssl = yes +ssl_cert = = 2.1.4) : %v.%u + # Dovecot v0.99.x : %v.%u + # tpop3d : %Mf + # + # Note that Outlook 2003 seems to have problems with %v.%u format which was + # Dovecot's default, so if you're building a new server it would be a good + # idea to change this. %08Xu%08Xv should be pretty fail-safe. + # + #pop3_uidl_format = %08Xu%08Xv + + # Permanently save UIDLs sent to POP3 clients, so pop3_uidl_format changes + # won't change those UIDLs. Currently this works only with Maildir. + #pop3_save_uidl = no + + # What to do about duplicate UIDLs if they exist? + # allow: Show duplicates to clients. + # rename: Append a temporary -2, -3, etc. counter after the UIDL. + #pop3_uidl_duplicates = allow + + # POP3 logout format string: + # %i - total number of bytes read from client + # %o - total number of bytes sent to client + # %t - number of TOP commands + # %p - number of bytes sent to client as a result of TOP command + # %r - number of RETR commands + # %b - number of bytes sent to client as a result of RETR command + # %d - number of deleted messages + # %m - number of messages (before deletion) + # %s - mailbox size in bytes (before deletion) + # %u - old/new UIDL hash. may help finding out if UIDLs changed unexpectedly + #pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s + + # Maximum number of POP3 connections allowed for a user from each IP address. + # NOTE: The username is compared case-sensitively. + #mail_max_userip_connections = 10 + + # Space separated list of plugins to load (default is global mail_plugins). + #mail_plugins = $mail_plugins + + # Workarounds for various client bugs: + # outlook-no-nuls: + # Outlook and Outlook Express hang if mails contain NUL characters. + # This setting replaces them with 0x80 character. + # oe-ns-eoh: + # Outlook Express and Netscape Mail breaks if end of headers-line is + # missing. This option simply sends it if it's missing. + # The list is space-separated. + #pop3_client_workarounds = +} diff --git a/install/debian/dovecot/conf.d/auth-passwdfile.conf.ext b/install/debian/dovecot/conf.d/auth-passwdfile.conf.ext new file mode 100644 index 000000000..75e6e1152 --- /dev/null +++ b/install/debian/dovecot/conf.d/auth-passwdfile.conf.ext @@ -0,0 +1,9 @@ +passdb { + driver = passwd-file + args = scheme=MD5-CRYPT username_format=%n /etc/exim4/domains/%d/passwd +} + +userdb { + driver = passwd-file + args = username_format=%n /etc/exim4/domains/%d/passwd +} diff --git a/install/debian/exim4.conf.template b/install/debian/exim4.conf.template new file mode 100644 index 000000000..f2455ad3d --- /dev/null +++ b/install/debian/exim4.conf.template @@ -0,0 +1,337 @@ +########################################################################## +#SPAMASSASSIN = yes +SPAM_SCORE = 50 +CLAMD = yes +########################################################################## + +domainlist local_domains = dsearch;/etc/exim4/domains/ +domainlist relay_to_domains = dsearch;/etc/exim4/domains/ +hostlist relay_from_hosts = 127.0.0.1 +hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf +hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf +no_local_from_check +untrusted_set_sender = * +acl_smtp_connect = acl_check_spammers +acl_smtp_mail = acl_check_mail +acl_smtp_rcpt = acl_check_rcpt +acl_smtp_data = acl_check_data +acl_smtp_mime = acl_check_mime + +.ifdef SPAMASSASSIN +spamd_address = 127.0.0.1 783 +.endif + +.ifdef CLAMD +av_scanner = clamd: /var/run/clamav/clamd.ctl +.endif + +#tls_advertise_hosts = * +#tls_certificate = /usr/local/vesta/ssl/certificate.crt +#tls_privatekey = /usr/local/vesta/ssl/certificate.key + +daemon_smtp_ports = 25 : 465 : 587 : 2525 +tls_on_connect_ports = 465 +never_users = root +host_lookup = * +rfc1413_hosts = * +rfc1413_query_timeout = 5s +ignore_bounce_errors_after = 2d +timeout_frozen_after = 7d + +DKIM_DOMAIN = ${lc:${domain:$h_from:}} +DKIM_FILE = /etc/exim4/domains/${lc:${domain:$h_from:}}/dkim.pem +DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}} + + +########################################################################## +begin acl +########################################################################## +acl_check_spammers: + accept hosts = +whitelist + drop message = Your host in blacklist on this server. + log_message = Host in blacklist + hosts = +spammers + deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text + dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}} + accept + +acl_check_mail: + deny + condition = ${if eq{$sender_helo_name}{}} + message = HELO required before MAIL +# drop +# condition = ${if isip{$sender_helo_name}} +# message = Access denied - Invalid HELO name (See RFC2821 4.1.3) + drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid + condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}} + condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}} + delay = 45s +# drop +# condition = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}} +# condition = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}} +# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) + drop + condition = ${if isip{$sender_helo_name}} + message = Access denied - Invalid HELO name (See RFC2821 4.1.3) +# drop +# condition = ${if match{$sender_helo_name}{\N\.$\N}} +# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) +# drop message = "REJECTED - Bad HELO - Host impersonating [$sender_helo_name]" +# condition = ${if match{$sender_helo_name}{$primary_hostname}} + drop condition = ${if eq{[$interface_address]}{$sender_helo_name}} + message = $interface_address is _my_ address + accept + + +acl_check_rcpt: + accept hosts = : + + deny message = Restricted characters in address + domains = +local_domains + local_parts = ^[.] : ^.*[@%!/|] + + deny message = Restricted characters in address + domains = !+local_domains + local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./ + + require verify = sender + + accept hosts = +relay_from_hosts + control = submission + + accept authenticated = * + control = submission/domain= + + require message = relay not permitted + domains = +local_domains : +relay_to_domains + + deny message = smtp auth requried + sender_domains = +local_domains + !authenticated = * + + require verify = recipient + +.ifdef CLAMD + warn set acl_m0 = no + warn condition = ${if exists {/etc/exim4/domains/$domain/antivirus}{yes}{no}} + set acl_m0 = yes +.endif +.ifdef SPAMASSASSIN + warn set acl_m1 = no + warn condition = ${if exists {/etc/exim4/domains/$domain/antispam}{yes}{no}} + set acl_m1 = yes +.endif + accept + + +acl_check_data: +.ifdef CLAMD + deny message = Message contains a virus ($malware_name) and has been rejected + malware = * + condition = ${if eq{$acl_m0}{yes}{yes}{no}} +.endif + +.ifdef SPAMASSASSIN + warn + !authenticated = * + hosts = !+relay_from_hosts + condition = ${if < {$message_size}{100K}} + condition = ${if eq{$acl_m1}{yes}{yes}{no}} + spam = nobody:true/defer_ok + add_header = X-Spam-Score: $spam_score_int + add_header = X-Spam-Bar: $spam_bar + add_header = X-Spam-Report: $spam_report + set acl_m2 = $spam_score_int + warn + condition = ${if !eq{$acl_m2}{} {yes}{no}} + condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}} + add_header = X-Spam-Status: Yes + message = SpamAssassin detected spam (from $sender_address to $recipients). +.endif + accept + + +acl_check_mime: + deny message = Blacklisted file extension detected + condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + accept + +########################################################################## +begin authenticators +########################################################################## +dovecot_plain: + driver = dovecot + public_name = PLAIN + server_socket = /var/run/dovecot/auth-client + server_set_id = $auth1 + +dovecot_login: + driver = dovecot + public_name = LOGIN + server_socket = /var/run/dovecot/auth-client + server_set_id = $auth1 + +########################################################################## +begin routers +########################################################################## +#smarthost: +# driver = manualroute +# domains = ! +local_domains +# transport = remote_smtp +# route_list = * smartrelay.vestacp.com +# no_more +# no_verify + +dnslookup: + driver = dnslookup + domains = !+local_domains + transport = remote_smtp + no_more + +userforward: + driver = redirect + check_local_user + file = $home/.forward + allow_filter + no_verify + no_expn + check_ancestor + file_transport = address_file + pipe_transport = address_pipe + reply_transport = address_reply + +procmail: + driver = accept + check_local_user + require_files = ${local_part}:+${home}/.procmailrc:/usr/bin/procmail + transport = procmail + no_verify + +autoreplay: + driver = accept + require_files = /etc/exim4/domains/$domain/autoreply.${local_part}.msg + condition = ${if exists{/etc/exim4/domains/$domain/autoreply.${local_part}.msg}}{yes}{no}} + retry_use_local_part + transport = userautoreply + unseen + +aliases: + driver = redirect + headers_add = X-redirected: yes + data = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}}}} + require_files = /etc/exim4/domains/$domain/aliases + redirect_router = dnslookup + pipe_transport = address_pipe + unseen + +localuser_spam: + driver = accept + transport = local_spam_delivery + condition = ${if eq {${if match{$h_X-Spam-Status:}{\N^Yes\N}{yes}{no}}} {${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}{yes}{no_such_user}}}} + +localuser: + driver = accept + transport = local_delivery + condition = ${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}{true}{false}} + +catchall: + driver = redirect + headers_add = X-redirected: yes + require_files = /etc/exim4/domains/$domain/aliases + data = ${extract{1}{:}{${lookup{*@$domain}lsearch{/etc/exim4/domains/$domain/aliases}}}} + file_transport = local_delivery + redirect_router = dnslookup + +terminate_alias: + driver = accept + transport = devnull + condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}{true}{false}} + + +########################################################################## +begin transports +########################################################################## +remote_smtp: + driver = smtp + #helo_data = $sender_address_domain + dkim_domain = DKIM_DOMAIN + dkim_selector = mail + dkim_private_key = DKIM_PRIVATE_KEY + dkim_canon = relaxed + dkim_strict = 0 + + +procmail: + driver = pipe + command = "/usr/bin/procmail -d $local_part" + return_path_add + delivery_date_add + envelope_to_add + user = $local_part + initgroups + return_output + +local_delivery: + driver = appendfile + maildir_format + maildir_use_size_file + user = ${extract{2}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}} + group = mail + create_directory + directory_mode = 770 + mode = 660 + use_lockfile = no + delivery_date_add + envelope_to_add + return_path_add + directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part" + quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}M + quota_warn_threshold = 75% + +local_spam_delivery: + driver = appendfile + maildir_format + maildir_use_size_file + user = ${extract{2}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}} + group = mail + create_directory + directory_mode = 770 + mode = 660 + use_lockfile = no + delivery_date_add + envelope_to_add + return_path_add + directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.spam" + quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}M + quota_directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part" + quota_warn_threshold = 75% + +address_pipe: + driver = pipe + return_output + +address_file: + driver = appendfile + delivery_date_add + envelope_to_add + return_path_add + +address_reply: + driver = autoreply + +userautoreply: + driver = autoreply + file = /etc/exim4/domains/$domain/autoreply.${local_part}.msg + from = "${local_part}@${domain}" + subject = "${if def:h_Subject: {Autoreply: ${quote:${escape:$h_Subject:}}} {Autoreply Message}}" + to = "${sender_address}" + +devnull: + driver = appendfile + file = /dev/null + +########################################################################## +begin retry +* * F,2h,15m; G,16h,1h,1.5; F,4d,6h +########################################################################## +begin rewrite diff --git a/install/debian/freshclam.conf b/install/debian/freshclam.conf new file mode 100644 index 000000000..5e6ca56c1 --- /dev/null +++ b/install/debian/freshclam.conf @@ -0,0 +1,27 @@ +# Automatically created by the clamav-freshclam postinst +# Comments will get lost when you reconfigure the clamav-freshclam package + +DatabaseOwner clamav +UpdateLogFile /var/log/clamav/freshclam.log +LogVerbose false +LogSyslog false +LogFacility LOG_LOCAL6 +LogFileMaxSize 0 +LogTime true +Foreground false +Debug false +MaxAttempts 5 +DatabaseDirectory /var/lib/clamav +DNSDatabaseInfo current.cvd.clamav.net +AllowSupplementaryGroups false +PidFile /var/run/clamav/freshclam.pid +ConnectTimeout 30 +ReceiveTimeout 30 +TestDatabases yes +ScriptedUpdates yes +CompressLocalDatabase no +Bytecode true +# Check for new database 24 times a day +Checks 24 +DatabaseMirror db.local.clamav.net +DatabaseMirror database.clamav.net diff --git a/install/debian/my.cnf b/install/debian/my.cnf new file mode 100644 index 000000000..1b5ff1d24 --- /dev/null +++ b/install/debian/my.cnf @@ -0,0 +1,25 @@ +[client] +port=3306 +socket=/var/run/mysqld/mysqld.sock + +[mysqld_safe] +socket=/var/run/mysqld/mysqld.sock + +[mysqld] +user=mysql +pid-file=/var/run/mysqld/mysqld.pid +socket=/var/run/mysqld/mysqld.sock +port=3306 +basedir=/usr +datadir=/var/lib/mysql +tmpdir=/tmp +lc-messages-dir=/usr/share/mysql +log_error=/var/log/mysql/error.log +max_connections=200 +max_user_connections=30 +wait_timeout=30 +interactive_timeout=50 +long_query_time=5 +innodb_file_per_table + +!includedir /etc/mysql/conf.d/ diff --git a/install/debian/named.conf b/install/debian/named.conf new file mode 100644 index 000000000..ed6ece885 --- /dev/null +++ b/install/debian/named.conf @@ -0,0 +1,12 @@ +// This is the primary configuration file for the BIND DNS server named. +// +// Please read /usr/share/doc/bind9/README.Debian.gz for information on the +// structure of BIND configuration files in Debian, *BEFORE* you customize +// this configuration file. +// +// If you are just adding zones, please do that in /etc/bind/named.conf.local + +include "/etc/bind/named.conf.options"; +include "/etc/bind/named.conf.local"; +include "/etc/bind/named.conf.default-zones"; + diff --git a/install/debian/nginx-status.conf b/install/debian/nginx-status.conf new file mode 100644 index 000000000..c0bcd0691 --- /dev/null +++ b/install/debian/nginx-status.conf @@ -0,0 +1,9 @@ +server { + listen 127.0.0.1:8084 default; + server_name _; + server_name_in_redirect off; + location / { + stub_status on; + access_log off; + } +} diff --git a/install/debian/nginx.conf b/install/debian/nginx.conf new file mode 100644 index 000000000..dc6f63f43 --- /dev/null +++ b/install/debian/nginx.conf @@ -0,0 +1,99 @@ +# Server globals +user www-data; +worker_processes 2; +error_log /var/log/nginx/error.log; +pid /var/run/nginx.pid; + + +# Worker config +events { + worker_connections 1024; + use epoll; +} + + +http { + # Main settings + sendfile on; + tcp_nopush on; + tcp_nodelay on; + client_header_timeout 1m; + client_body_timeout 1m; + client_header_buffer_size 2k; + client_body_buffer_size 256k; + client_max_body_size 100m; + large_client_header_buffers 4 8k; + send_timeout 30; + keepalive_timeout 60 60; + reset_timedout_connection on; + server_tokens off; + server_name_in_redirect off; + server_names_hash_max_size 512; + server_names_hash_bucket_size 512; + + + # Log format + log_format main '$remote_addr - $remote_user [$time_local] $request ' + '"$status" $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + log_format bytes '$body_bytes_sent'; + #access_log /var/log/nginx/access.log main; + access_log off; + + + # Mime settings + include /etc/nginx/mime.types; + default_type application/octet-stream; + + + # Compression + gzip on; + gzip_comp_level 9; + gzip_min_length 512; + gzip_buffers 8 64k; + gzip_types text/plain text/css text/javascript + application/x-javascript; + gzip_proxied any; + + + # Proxy settings + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass_header Set-Cookie; + proxy_connect_timeout 90; + proxy_send_timeout 90; + proxy_read_timeout 90; + proxy_buffers 32 4k; + + + # SSL PCI Compliance + ssl_ciphers RC4:HIGH:!aNULL:!MD5:!kEDH; + ssl_session_cache shared:SSL:10m; + ssl_prefer_server_ciphers on; + + + # Error pages + error_page 403 /error/403.html; + error_page 404 /error/404.html; + error_page 502 503 504 /error/50x.html; + + + # Cache + proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=512m; + proxy_temp_path /var/cache/nginx/temp; + proxy_ignore_headers Expires Cache-Control; + proxy_cache_use_stale error timeout invalid_header http_502; + proxy_cache_valid any 3d; + + map $http_cookie $no_cache { + default 0; + ~SESS 1; + ~wordpress_logged_in 1; + } + + + # Wildcard include + include /etc/nginx/conf.d/*.conf; +} diff --git a/install/debian/nginx.readme.txt b/install/debian/nginx.readme.txt new file mode 100644 index 000000000..e5db79e79 --- /dev/null +++ b/install/debian/nginx.readme.txt @@ -0,0 +1,11 @@ +# +# _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| +# _| _| _| _| _| _| _| +# _| _| _|_|_| _|_| _| _|_|_|_| +# _| _| _| _| _| _| _| +# _| _|_|_|_| _|_|_| _| _| _| +# +# +# Server is manager by Vesta Control Panel. +# See /etc/nginx/conf.d/vesta.conf to get a full list of running vhosts. +# diff --git a/install/debian/packages.tar.gz b/install/debian/packages.tar.gz new file mode 100644 index 000000000..4b778dadc Binary files /dev/null and b/install/debian/packages.tar.gz differ diff --git a/install/debian/packages/default.pkg b/install/debian/packages/default.pkg new file mode 100644 index 000000000..29585bacb --- /dev/null +++ b/install/debian/packages/default.pkg @@ -0,0 +1,18 @@ +WEB_TEMPLATE='default' +PROXY_TEMPLATE='default' +DNS_TEMPLATE='default' +WEB_DOMAINS='100' +WEB_ALIASES='100' +DNS_DOMAINS='100' +DNS_RECORDS='100' +MAIL_DOMAINS='100' +MAIL_ACCOUNTS='100' +DATABASES='100' +CRON_JOBS='100' +DISK_QUOTA='10000' +BANDWIDTH='100000' +NS='ns1.localhost.ltd,ns2.localhost.ltd' +SHELL='nologin' +BACKUPS='3' +TIME='11:46:50' +DATE='2012-09-26' diff --git a/install/debian/packages/gainsboro.pkg b/install/debian/packages/gainsboro.pkg new file mode 100644 index 000000000..c3df50258 --- /dev/null +++ b/install/debian/packages/gainsboro.pkg @@ -0,0 +1,18 @@ +WEB_TEMPLATE='default' +PROXY_TEMPLATE='default' +DNS_TEMPLATE='default' +WEB_DOMAINS='10' +WEB_ALIASES='10' +DNS_DOMAINS='10' +DNS_RECORDS='10' +MAIL_DOMAINS='10' +MAIL_ACCOUNTS='10' +DATABASES='10' +CRON_JOBS='10' +DISK_QUOTA='10000' +BANDWIDTH='10000' +NS='ns1.localhost.ltd,ns2.localhost.ltd' +SHELL='nologin' +BACKUPS='1' +TIME='11:31:30' +DATE='2012-07-26' diff --git a/install/debian/packages/palegreen.pkg b/install/debian/packages/palegreen.pkg new file mode 100644 index 000000000..d08930f7b --- /dev/null +++ b/install/debian/packages/palegreen.pkg @@ -0,0 +1,18 @@ +WEB_TEMPLATE='hosting' +PROXY_TEMPLATE='hosting' +DNS_TEMPLATE='default' +WEB_DOMAINS='50' +WEB_ALIASES='50' +DNS_DOMAINS='50' +DNS_RECORDS='50' +MAIL_DOMAINS='50' +MAIL_ACCOUNTS='50' +DATABASES='50' +CRON_JOBS='50' +DISK_QUOTA='50000' +BANDWIDTH='50000' +NS='ns1.localhost.ltd,ns2.localhost.ltd' +SHELL='nologin' +BACKUPS='5' +TIME='07:49:47' +DATE='2013-06-10' diff --git a/install/debian/packages/slategrey.pkg b/install/debian/packages/slategrey.pkg new file mode 100644 index 000000000..15a17dcd3 --- /dev/null +++ b/install/debian/packages/slategrey.pkg @@ -0,0 +1,18 @@ +WEB_TEMPLATE='default' +PROXY_TEMPLATE='default' +DNS_TEMPLATE='default' +WEB_DOMAINS='100' +WEB_ALIASES='100' +DNS_DOMAINS='100' +DNS_RECORDS='100' +MAIL_DOMAINS='100' +MAIL_ACCOUNTS='100' +DATABASES='100' +CRON_JOBS='100' +DISK_QUOTA='10000' +BANDWIDTH='100000' +NS='ns1.localhost.ltd,ns2.localhost.ltd' +SHELL='nologin' +BACKUPS='3' +TIME='12:39:13' +DATE='2012-09-20' diff --git a/install/debian/pma.conf b/install/debian/pma.conf new file mode 100644 index 000000000..a643a065b --- /dev/null +++ b/install/debian/pma.conf @@ -0,0 +1,146 @@ + diff --git a/install/debian/roundcube-driver.php b/install/debian/roundcube-driver.php new file mode 100644 index 000000000..b8695bd17 --- /dev/null +++ b/install/debian/roundcube-driver.php @@ -0,0 +1,59 @@ + + */ + +class rcube_vesta_password +{ + function save($curpass, $passwd) + { + $rcmail = rcmail::get_instance(); + $vesta_host = $rcmail->config->get('password_vesta_host'); + + if (empty($vesta_host)) + { + $vesta_host = 'localhost'; + } + + $vesta_port = $rcmail->config->get('password_vesta_port'); + if (empty($vesta_port)) + { + $vesta_port = '8083'; + } + + $postvars = array( + 'email' => $_SESSION['username'], + 'password' => $curpass, + 'new' => $passwd + ); + + $postdata = http_build_query($postvars); + + $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL; + $send .= 'Host: ' . $vesta_host . PHP_EOL; + $send .= 'User-Agent: PHP Script' . PHP_EOL; + $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL; + $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL; + $send .= 'Connection: close' . PHP_EOL; + $send .= PHP_EOL; + $send .= $postdata . PHP_EOL . PHP_EOL; + + $fp = fsockopen('ssl://' . $vesta_host, $vesta_port); + fputs($fp, $send); + $result = fread($fp, 2048); + fclose($fp); + + if(strpos($result, 'ok') && !strpos($result, 'error')) + { + return PASSWORD_SUCCESS; + } + else { + return PASSWORD_ERROR; + } + + } +} diff --git a/install/debian/roundcube-main.conf b/install/debian/roundcube-main.conf new file mode 100644 index 000000000..2ac461203 --- /dev/null +++ b/install/debian/roundcube-main.conf @@ -0,0 +1,847 @@ +/sendmail or to syslog +$rcmail_config['smtp_log'] = true; + +// Log successful logins to /userlogins or to syslog +$rcmail_config['log_logins'] = false; + +// Log session authentication errors to /session or to syslog +$rcmail_config['log_session'] = false; + +// Log SQL queries to /sql or to syslog +$rcmail_config['sql_debug'] = false; + +// Log IMAP conversation to /imap or to syslog +$rcmail_config['imap_debug'] = false; + +// Log LDAP conversation to /ldap or to syslog +$rcmail_config['ldap_debug'] = false; + +// Log SMTP conversation to /smtp or to syslog +$rcmail_config['smtp_debug'] = false; + +// ---------------------------------- +// IMAP +// ---------------------------------- + +// the mail host chosen to perform the log-in +// leave blank to show a textbox at login, give a list of hosts +// to display a pulldown menu or set one host as string. +// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls:// +// Supported replacement variables: +// %n - http hostname ($_SERVER['SERVER_NAME']) +// %d - domain (http hostname without the first part) +// %s - domain name after the '@' from e-mail address provided at login screen +// For example %n = mail.domain.tld, %d = domain.tld +$rcmail_config['default_host'] = 'localhost'; + +// TCP port used for IMAP connections +$rcmail_config['default_port'] = 143; + +// IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use +// best server supported one) +$rcmail_config['imap_auth_type'] = null; + +// If you know your imap's folder delimiter, you can specify it here. +// Otherwise it will be determined automatically +$rcmail_config['imap_delimiter'] = null; + +// If IMAP server doesn't support NAMESPACE extension, but you're +// using shared folders or personal root folder is non-empty, you'll need to +// set these options. All can be strings or arrays of strings. +// Folders need to be ended with directory separator, e.g. "INBOX." +// (special directory "~" is an exception to this rule) +// These can be used also to overwrite server's namespaces +$rcmail_config['imap_ns_personal'] = null; +$rcmail_config['imap_ns_other'] = null; +$rcmail_config['imap_ns_shared'] = null; + +// By default IMAP capabilities are readed after connection to IMAP server +// In some cases, e.g. when using IMAP proxy, there's a need to refresh the list +// after login. Set to True if you've got this case. +$rcmail_config['imap_force_caps'] = false; + +// By default list of subscribed folders is determined using LIST-EXTENDED +// extension if available. Some servers (dovecot 1.x) returns wrong results +// for shared namespaces in this case. http://trac.roundcube.net/ticket/1486225 +// Enable this option to force LSUB command usage instead. +$rcmail_config['imap_force_lsub'] = false; + +// Some server configurations (e.g. Courier) doesn't list folders in all namespaces +// Enable this option to force listing of folders in all namespaces +$rcmail_config['imap_force_ns'] = false; + +// IMAP connection timeout, in seconds. Default: 0 (no limit) +$rcmail_config['imap_timeout'] = 0; + +// Optional IMAP authentication identifier to be used as authorization proxy +$rcmail_config['imap_auth_cid'] = null; + +// Optional IMAP authentication password to be used for imap_auth_cid +$rcmail_config['imap_auth_pw'] = null; + +// Type of IMAP indexes cache. Supported values: 'db', 'apc' and 'memcache'. +$rcmail_config['imap_cache'] = null; + +// Enables messages cache. Only 'db' cache is supported. +$rcmail_config['messages_cache'] = false; + + +// ---------------------------------- +// SMTP +// ---------------------------------- + +// SMTP server host (for sending mails). +// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls:// +// If left blank, the PHP mail() function is used +// Supported replacement variables: +// %h - user's IMAP hostname +// %n - http hostname ($_SERVER['SERVER_NAME']) +// %d - domain (http hostname without the first part) +// %z - IMAP domain (IMAP hostname without the first part) +// For example %n = mail.domain.tld, %d = domain.tld +$rcmail_config['smtp_server'] = ''; + +// SMTP port (default is 25; use 587 for STARTTLS or 465 for the +// deprecated SSL over SMTP (aka SMTPS)) +$rcmail_config['smtp_port'] = 25; + +// SMTP username (if required) if you use %u as the username Roundcube +// will use the current username for login +$rcmail_config['smtp_user'] = ''; + +// SMTP password (if required) if you use %p as the password Roundcube +// will use the current user's password for login +$rcmail_config['smtp_pass'] = ''; + +// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use +// best server supported one) +$rcmail_config['smtp_auth_type'] = ''; + +// Optional SMTP authentication identifier to be used as authorization proxy +$rcmail_config['smtp_auth_cid'] = null; + +// Optional SMTP authentication password to be used for smtp_auth_cid +$rcmail_config['smtp_auth_pw'] = null; + +// SMTP HELO host +// Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages +// Leave this blank and you will get the server variable 'server_name' or +// localhost if that isn't defined. +$rcmail_config['smtp_helo_host'] = ''; + +// SMTP connection timeout, in seconds. Default: 0 (no limit) +$rcmail_config['smtp_timeout'] = 0; + +// ---------------------------------- +// SYSTEM +// ---------------------------------- + +// THIS OPTION WILL ALLOW THE INSTALLER TO RUN AND CAN EXPOSE SENSITIVE CONFIG DATA. +// ONLY ENABLE IT IF YOU'RE REALLY SURE WHAT YOU'RE DOING! +$rcmail_config['enable_installer'] = false; + +// provide an URL where a user can get support for this Roundcube installation +// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE! +$rcmail_config['support_url'] = ''; + +// replace Roundcube logo with this image +// specify an URL relative to the document root of this Roundcube installation +$rcmail_config['skin_logo'] = null; + +// automatically create a new Roundcube user when log-in the first time. +// a new user will be created once the IMAP login succeeds. +// set to false if only registered users can use this service +$rcmail_config['auto_create_user'] = true; + +// use this folder to store log files (must be writeable for apache user) +// This is used by the 'file' log driver. +$rcmail_config['log_dir'] = '/var/log/roundcubemail/'; + +// use this folder to store temp files (must be writeable for apache user) +$rcmail_config['temp_dir'] = '${_tmppath}'; + +// lifetime of message cache +// possible units: s, m, h, d, w +$rcmail_config['message_cache_lifetime'] = '10d'; + +// enforce connections over https +// with this option enabled, all non-secure connections will be redirected. +// set the port for the ssl connection as value of this option if it differs from the default 443 +$rcmail_config['force_https'] = false; + +// tell PHP that it should work as under secure connection +// even if it doesn't recognize it as secure ($_SERVER['HTTPS'] is not set) +// e.g. when you're running Roundcube behind a https proxy +// this option is mutually exclusive to 'force_https' and only either one of them should be set to true. +$rcmail_config['use_https'] = false; + +// Allow browser-autocompletion on login form. +// 0 - disabled, 1 - username and host only, 2 - username, host, password +$rcmail_config['login_autocomplete'] = 0; + +// Forces conversion of logins to lower case. +// 0 - disabled, 1 - only domain part, 2 - domain and local part. +// If users authentication is not case-sensitive this must be enabled. +// After enabling it all user records need to be updated, e.g. with query: +// UPDATE users SET username = LOWER(username); +$rcmail_config['login_lc'] = 0; + +// Includes should be interpreted as PHP files +$rcmail_config['skin_include_php'] = false; + +// display software version on login screen +$rcmail_config['display_version'] = false; + +// Session lifetime in minutes +// must be greater than 'keep_alive'/60 +$rcmail_config['session_lifetime'] = 10; + +// session domain: .example.org +$rcmail_config['session_domain'] = ''; + +// session name. Default: 'roundcube_sessid' +$rcmail_config['session_name'] = null; + +// Backend to use for session storage. Can either be 'db' (default) or 'memcache' +// If set to memcache, a list of servers need to be specified in 'memcache_hosts' +// Make sure the Memcache extension (http://pecl.php.net/package/memcache) version >= 2.0.0 is installed +$rcmail_config['session_storage'] = 'db'; + +// Use these hosts for accessing memcached +// Define any number of hosts in the form of hostname:port or unix:///path/to/sock.file +$rcmail_config['memcache_hosts'] = null; // e.g. array( 'localhost:11211', '192.168.1.12:11211', 'unix:///var/tmp/memcached.sock' ); + +// check client IP in session athorization +$rcmail_config['ip_check'] = false; + +// check referer of incoming requests +$rcmail_config['referer_check'] = false; + +// X-Frame-Options HTTP header value sent to prevent from Clickjacking. +// Possible values: sameorigin|deny. Set to false in order to disable sending them +$rcmail_config['x_frame_options'] = 'sameorigin'; + +// this key is used to encrypt the users imap password which is stored +// in the session record (and the client cookie if remember password is enabled). +// please provide a string of exactly 24 chars. +$rcmail_config['des_key'] = 'vtIOjLZo9kffJoqzpSbm5r1r'; + +// Automatically add this domain to user names for login +// Only for IMAP servers that require full e-mail addresses for login +// Specify an array with 'host' => 'domain' values to support multiple hosts +// Supported replacement variables: +// %h - user's IMAP hostname +// %n - http hostname ($_SERVER['SERVER_NAME']) +// %d - domain (http hostname without the first part) +// %z - IMAP domain (IMAP hostname without the first part) +// For example %n = mail.domain.tld, %d = domain.tld +$rcmail_config['username_domain'] = ''; + +// This domain will be used to form e-mail addresses of new users +// Specify an array with 'host' => 'domain' values to support multiple hosts +// Supported replacement variables: +// %h - user's IMAP hostname +// %n - http hostname ($_SERVER['SERVER_NAME']) +// %d - domain (http hostname without the first part) +// %z - IMAP domain (IMAP hostname without the first part) +// For example %n = mail.domain.tld, %d = domain.tld +$rcmail_config['mail_domain'] = ''; + +// Password charset. +// Use it if your authentication backend doesn't support UTF-8. +// Defaults to ISO-8859-1 for backward compatibility +$rcmail_config['password_charset'] = 'ISO-8859-1'; + +// How many seconds must pass between emails sent by a user +$rcmail_config['sendmail_delay'] = 0; + +// Maximum number of recipients per message. Default: 0 (no limit) +$rcmail_config['max_recipients'] = 0; + +// Maximum allowednumber of members of an address group. Default: 0 (no limit) +// If 'max_recipients' is set this value should be less or equal +$rcmail_config['max_group_members'] = 0; + +// add this user-agent to message headers when sending +$rcmail_config['useragent'] = 'Roundcube Webmail/'.RCMAIL_VERSION; + +// use this name to compose page titles +$rcmail_config['product_name'] = 'Roundcube Webmail'; + +// try to load host-specific configuration +// see http://trac.roundcube.net/wiki/Howto_Config for more details +$rcmail_config['include_host_config'] = false; + +// path to a text file which will be added to each sent message +// paths are relative to the Roundcube root folder +$rcmail_config['generic_message_footer'] = ''; + +// path to a text file which will be added to each sent HTML message +// paths are relative to the Roundcube root folder +$rcmail_config['generic_message_footer_html'] = ''; + +// add a received header to outgoing mails containing the creators IP and hostname +$rcmail_config['http_received_header'] = false; + +// Whether or not to encrypt the IP address and the host name +// these could, in some circles, be considered as sensitive information; +// however, for the administrator, these could be invaluable help +// when tracking down issues. +$rcmail_config['http_received_header_encrypt'] = false; + +// This string is used as a delimiter for message headers when sending +// a message via mail() function. Leave empty for auto-detection +$rcmail_config['mail_header_delimiter'] = NULL; + +// number of chars allowed for line when wrapping text. +// text wrapping is done when composing/sending messages +$rcmail_config['line_length'] = 72; + +// send plaintext messages as format=flowed +$rcmail_config['send_format_flowed'] = true; + +// don't allow these settings to be overriden by the user +$rcmail_config['dont_override'] = array(); + +// Set identities access level: +// 0 - many identities with possibility to edit all params +// 1 - many identities with possibility to edit all params but not email address +// 2 - one identity with possibility to edit all params +// 3 - one identity with possibility to edit all params but not email address +$rcmail_config['identities_level'] = 0; + +// Mimetypes supported by the browser. +// attachments of these types will open in a preview window +// either a comma-separated list or an array: 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/pdf' +$rcmail_config['client_mimetypes'] = null; # null == default + +// mime magic database +$rcmail_config['mime_magic'] = null; + +// path to imagemagick identify binary +$rcmail_config['im_identify_path'] = null; + +// path to imagemagick convert binary +$rcmail_config['im_convert_path'] = null; + +// maximum size of uploaded contact photos in pixel +$rcmail_config['contact_photo_size'] = 160; + +// Enable DNS checking for e-mail address validation +$rcmail_config['email_dns_check'] = false; + +// ---------------------------------- +// PLUGINS +// ---------------------------------- + +// List of active plugins (in plugins/ directory) +$rcmail_config['plugins'] = array('password'); + +// ---------------------------------- +// USER INTERFACE +// ---------------------------------- + +// default messages sort column. Use empty value for default server's sorting, +// or 'arrival', 'date', 'subject', 'from', 'to', 'fromto', 'size', 'cc' +$rcmail_config['message_sort_col'] = ''; + +// default messages sort order +$rcmail_config['message_sort_order'] = 'DESC'; + +// These cols are shown in the message list. Available cols are: +// subject, from, to, fromto, cc, replyto, date, size, status, flag, attachment, 'priority' +$rcmail_config['list_cols'] = array('subject', 'status', 'fromto', 'date', 'size', 'flag', 'attachment'); + +// the default locale setting (leave empty for auto-detection) +// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR +$rcmail_config['language'] = null; + +// use this format for date display (date or strftime format) +$rcmail_config['date_format'] = 'Y-m-d'; + +// give this choice of date formats to the user to select from +$rcmail_config['date_formats'] = array('Y-m-d', 'd-m-Y', 'Y/m/d', 'm/d/Y', 'd/m/Y', 'd.m.Y', 'j.n.Y'); + +// use this format for time display (date or strftime format) +$rcmail_config['time_format'] = 'H:i'; + +// give this choice of time formats to the user to select from +$rcmail_config['time_formats'] = array('G:i', 'H:i', 'g:i a', 'h:i A'); + +// use this format for short date display (derived from date_format and time_format) +$rcmail_config['date_short'] = 'D H:i'; + +// use this format for detailed date/time formatting (derived from date_format and time_format) +$rcmail_config['date_long'] = 'Y-m-d H:i'; + +// store draft message is this mailbox +// leave blank if draft messages should not be stored +// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP) +$rcmail_config['drafts_mbox'] = 'Drafts'; + +// store spam messages in this mailbox +// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP) +$rcmail_config['junk_mbox'] = 'Junk'; + +// store sent message is this mailbox +// leave blank if sent messages should not be stored +// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP) +$rcmail_config['sent_mbox'] = 'Sent'; + +// move messages to this folder when deleting them +// leave blank if they should be deleted directly +// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP) +$rcmail_config['trash_mbox'] = 'Trash'; + +// display these folders separately in the mailbox list. +// these folders will also be displayed with localized names +// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP) +$rcmail_config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash'); + +// automatically create the above listed default folders on first login +$rcmail_config['create_default_folders'] = false; + +// protect the default folders from renames, deletes, and subscription changes +$rcmail_config['protect_default_folders'] = true; + +// if in your system 0 quota means no limit set this option to true +$rcmail_config['quota_zero_as_unlimited'] = false; + +// Make use of the built-in spell checker. It is based on GoogieSpell. +// Since Google only accepts connections over https your PHP installatation +// requires to be compiled with Open SSL support +$rcmail_config['enable_spellcheck'] = true; + +// Enables spellchecker exceptions dictionary. +// Setting it to 'shared' will make the dictionary shared by all users. +$rcmail_config['spellcheck_dictionary'] = false; + +// Set the spell checking engine. 'googie' is the default. 'pspell' is also available, +// but requires the Pspell extensions. When using Nox Spell Server, also set 'googie' here. +$rcmail_config['spellcheck_engine'] = 'googie'; + +// For a locally installed Nox Spell Server, please specify the URI to call it. +// Get Nox Spell Server from http://orangoo.com/labs/?page_id=72 +// Leave empty to use the Google spell checking service, what means +// that the message content will be sent to Google in order to check spelling +$rcmail_config['spellcheck_uri'] = ''; + +// These languages can be selected for spell checking. +// Configure as a PHP style hash array: array('en'=>'English', 'de'=>'Deutsch'); +// Leave empty for default set of available language. +$rcmail_config['spellcheck_languages'] = NULL; + +// Makes that words with all letters capitalized will be ignored (e.g. GOOGLE) +$rcmail_config['spellcheck_ignore_caps'] = false; + +// Makes that words with numbers will be ignored (e.g. g00gle) +$rcmail_config['spellcheck_ignore_nums'] = false; + +// Makes that words with symbols will be ignored (e.g. g@@gle) +$rcmail_config['spellcheck_ignore_syms'] = false; + +// Use this char/string to separate recipients when composing a new message +$rcmail_config['recipients_separator'] = ','; + +// don't let users set pagesize to more than this value if set +$rcmail_config['max_pagesize'] = 200; + +// Minimal value of user's 'keep_alive' setting (in seconds) +// Must be less than 'session_lifetime' +$rcmail_config['min_keep_alive'] = 60; + +// Enables files upload indicator. Requires APC installed and enabled apc.rfc1867 option. +// By default refresh time is set to 1 second. You can set this value to true +// or any integer value indicating number of seconds. +$rcmail_config['upload_progress'] = false; + +// Specifies for how many seconds the Undo button will be available +// after object delete action. Currently used with supporting address book sources. +// Setting it to 0, disables the feature. +$rcmail_config['undo_timeout'] = 0; + +// ---------------------------------- +// ADDRESSBOOK SETTINGS +// ---------------------------------- + +// This indicates which type of address book to use. Possible choises: +// 'sql' (default) and 'ldap'. +// If set to 'ldap' then it will look at using the first writable LDAP +// address book as the primary address book and it will not display the +// SQL address book in the 'Address Book' view. +$rcmail_config['address_book_type'] = 'sql'; + +// In order to enable public ldap search, configure an array like the Verisign +// example further below. if you would like to test, simply uncomment the example. +// Array key must contain only safe characters, ie. a-zA-Z0-9_ +$rcmail_config['ldap_public'] = array(); + +// If you are going to use LDAP for individual address books, you will need to +// set 'user_specific' to true and use the variables to generate the appropriate DNs to access it. +// +// The recommended directory structure for LDAP is to store all the address book entries +// under the users main entry, e.g.: +// +// o=root +// ou=people +// uid=user@domain +// mail=contact@contactdomain +// +// So the base_dn would be uid=%fu,ou=people,o=root +// The bind_dn would be the same as based_dn or some super user login. +/* + * example config for Verisign directory + * +$rcmail_config['ldap_public']['Verisign'] = array( + 'name' => 'Verisign.com', + // Replacement variables supported in host names: + // %h - user's IMAP hostname + // %n - http hostname ($_SERVER['SERVER_NAME']) + // %d - domain (http hostname without the first part) + // %z - IMAP domain (IMAP hostname without the first part) + // For example %n = mail.domain.tld, %d = domain.tld + 'hosts' => array('directory.verisign.com'), + 'port' => 389, + 'use_tls' => false, + 'ldap_version' => 3, // using LDAPv3 + 'user_specific' => false, // If true the base_dn, bind_dn and bind_pass default to the user's IMAP login. + // %fu - The full username provided, assumes the username is an email + // address, uses the username_domain value if not an email address. + // %u - The username prior to the '@'. + // %d - The domain name after the '@'. + // %dc - The domain name hierarchal string e.g. "dc=test,dc=domain,dc=com" + // %dn - DN found by ldap search when search_filter/search_base_dn are used + 'base_dn' => '', + 'bind_dn' => '', + 'bind_pass' => '', + // It's possible to bind for an individual address book + // The login name is used to search for the DN to bind with + 'search_base_dn' => '', + 'search_filter' => '', // e.g. '(&(objectClass=posixAccount)(uid=%u))' + // DN and password to bind as before searching for bind DN, if anonymous search is not allowed + 'search_bind_dn' => '', + 'search_bind_pw' => '', + // Default for %dn variable if search doesn't return DN value + 'search_dn_default' => '', + // Optional authentication identifier to be used as SASL authorization proxy + // bind_dn need to be empty + 'auth_cid' => '', + // SASL authentication method (for proxy auth), e.g. DIGEST-MD5 + 'auth_method' => '', + // Indicates if the addressbook shall be hidden from the list. + // With this option enabled you can still search/view contacts. + 'hidden' => false, + // Indicates if the addressbook shall not list contacts but only allows searching. + 'searchonly' => false, + // Indicates if we can write to the LDAP directory or not. + // If writable is true then these fields need to be populated: + // LDAP_Object_Classes, required_fields, LDAP_rdn + 'writable' => false, + // To create a new contact these are the object classes to specify + // (or any other classes you wish to use). + 'LDAP_Object_Classes' => array('top', 'inetOrgPerson'), + // The RDN field that is used for new entries, this field needs + // to be one of the search_fields, the base of base_dn is appended + // to the RDN to insert into the LDAP directory. + 'LDAP_rdn' => 'cn', + // The required fields needed to build a new contact as required by + // the object classes (can include additional fields not required by the object classes). + 'required_fields' => array('cn', 'sn', 'mail'), + 'search_fields' => array('mail', 'cn'), // fields to search in + // mapping of contact fields to directory attributes + // for every attribute one can specify the number of values (limit) allowed. + // default is 1, a wildcard * means unlimited + 'fieldmap' => array( + // Roundcube => LDAP:limit + 'name' => 'cn', + 'surname' => 'sn', + 'firstname' => 'givenName', + 'title' => 'title', + 'email' => 'mail:*', + 'phone:home' => 'homePhone', + 'phone:work' => 'telephoneNumber', + 'phone:mobile' => 'mobile', + 'phone:pager' => 'pager', + 'street' => 'street', + 'zipcode' => 'postalCode', + 'region' => 'st', + 'locality' => 'l', +// if you uncomment country, you need to modify 'sub_fields' above +// 'country' => 'c', + 'department' => 'departmentNumber', + 'notes' => 'description', +// these currently don't work: +// 'phone:workfax' => 'facsimileTelephoneNumber', +// 'photo' => 'jpegPhoto', +// 'organization' => 'o', +// 'manager' => 'manager', +// 'assistant' => 'secretary', + ), + // Map of contact sub-objects (attribute name => objectClass(es)), e.g. 'c' => 'country' + 'sub_fields' => array(), + 'sort' => 'cn', // The field to sort the listing by. + 'scope' => 'sub', // search mode: sub|base|list + 'filter' => '(objectClass=inetOrgPerson)', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act + 'fuzzy_search' => true, // server allows wildcard search + 'vlv' => false, // Enable Virtual List View to more efficiently fetch paginated data (if server supports it) + 'numsub_filter' => '(objectClass=organizationalUnit)', // with VLV, we also use numSubOrdinates to query the total number of records. Set this filter to get all numSubOrdinates attributes for counting + 'sizelimit' => '0', // Enables you to limit the count of entries fetched. Setting this to 0 means no limit. + 'timelimit' => '0', // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit. + 'referrals' => true|false, // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups + + // definition for contact groups (uncomment if no groups are supported) + // for the groups base_dn, the user replacements %fu, %u, $d and %dc work as for base_dn (see above) + // if the groups base_dn is empty, the contact base_dn is used for the groups as well + // -> in this case, assure that groups and contacts are separated due to the concernig filters! + 'groups' => array( + 'base_dn' => '', + 'scope' => 'sub', // search mode: sub|base|list + 'filter' => '(objectClass=groupOfNames)', + 'object_classes' => array("top", "groupOfNames"), + 'member_attr' => 'member', // name of the member attribute, e.g. uniqueMember + 'name_attr' => 'cn', // attribute to be used as group name + ), +); +*/ + +// An ordered array of the ids of the addressbooks that should be searched +// when populating address autocomplete fields server-side. ex: array('sql','Verisign'); +$rcmail_config['autocomplete_addressbooks'] = array('sql'); + +// The minimum number of characters required to be typed in an autocomplete field +// before address books will be searched. Most useful for LDAP directories that +// may need to do lengthy results building given overly-broad searches +$rcmail_config['autocomplete_min_length'] = 1; + +// Number of parallel autocomplete requests. +// If there's more than one address book, n parallel (async) requests will be created, +// where each request will search in one address book. By default (0), all address +// books are searched in one request. +$rcmail_config['autocomplete_threads'] = 0; + +// Max. numer of entries in autocomplete popup. Default: 15. +$rcmail_config['autocomplete_max'] = 15; + +// show address fields in this order +// available placeholders: {street}, {locality}, {zipcode}, {country}, {region} +$rcmail_config['address_template'] = '{street}
{locality} {zipcode}
{country} {region}'; + +// Matching mode for addressbook search (including autocompletion) +// 0 - partial (*abc*), default +// 1 - strict (abc) +// 2 - prefix (abc*) +// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode +$rcmail_config['addressbook_search_mode'] = 0; + +// ---------------------------------- +// USER PREFERENCES +// ---------------------------------- + +// Use this charset as fallback for message decoding +//$rcmail_config['default_charset'] = 'ISO-8859-1'; +$rcmail_config['default_charset'] = 'UTF-8'; + +// skin name: folder from skins/ +$rcmail_config['skin'] = 'larry'; + +// show up to X items in messages list view +$rcmail_config['mail_pagesize'] = 50; + +// show up to X items in contacts list view +$rcmail_config['addressbook_pagesize'] = 50; + +// sort contacts by this col (preferably either one of name, firstname, surname) +$rcmail_config['addressbook_sort_col'] = 'surname'; + +// the way how contact names are displayed in the list +// 0: display name +// 1: (prefix) firstname middlename surname (suffix) +// 2: (prefix) surname firstname middlename (suffix) +// 3: (prefix) surname, firstname middlename (suffix) +$rcmail_config['addressbook_name_listing'] = 0; + +// use this timezone to display date/time +// valid timezone identifers are listed here: php.net/manual/en/timezones.php +// 'auto' will use the browser's timezone settings +$rcmail_config['timezone'] = 'auto'; + +// prefer displaying HTML messages +$rcmail_config['prefer_html'] = true; + +// display remote inline images +// 0 - Never, always ask +// 1 - Ask if sender is not in address book +// 2 - Always show inline images +$rcmail_config['show_images'] = 0; + +// compose html formatted messages by default +// 0 - never, 1 - always, 2 - on reply to HTML message only +$rcmail_config['htmleditor'] = 0; + +// show pretty dates as standard +$rcmail_config['prettydate'] = true; + +// save compose message every 300 seconds (5min) +$rcmail_config['draft_autosave'] = 300; + +// default setting if preview pane is enabled +$rcmail_config['preview_pane'] = false; + +// Mark as read when viewed in preview pane (delay in seconds) +// Set to -1 if messages in preview pane should not be marked as read +$rcmail_config['preview_pane_mark_read'] = 0; + +// Clear Trash on logout +$rcmail_config['logout_purge'] = false; + +// Compact INBOX on logout +$rcmail_config['logout_expunge'] = false; + +// Display attached images below the message body +$rcmail_config['inline_images'] = true; + +// Encoding of long/non-ascii attachment names: +// 0 - Full RFC 2231 compatible +// 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default) +// 2 - Full 2047 compatible +$rcmail_config['mime_param_folding'] = 1; + +// Set true if deleted messages should not be displayed +// This will make the application run slower +$rcmail_config['skip_deleted'] = false; + +// Set true to Mark deleted messages as read as well as deleted +// False means that a message's read status is not affected by marking it as deleted +$rcmail_config['read_when_deleted'] = true; + +// Set to true to never delete messages immediately +// Use 'Purge' to remove messages marked as deleted +$rcmail_config['flag_for_deletion'] = false; + +// Default interval for keep-alive/check-recent requests (in seconds) +// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime' +$rcmail_config['keep_alive'] = 60; + +// If true all folders will be checked for recent messages +$rcmail_config['check_all_folders'] = false; + +// If true, after message delete/move, the next message will be displayed +$rcmail_config['display_next'] = false; + +// 0 - Do not expand threads +// 1 - Expand all threads automatically +// 2 - Expand only threads with unread messages +$rcmail_config['autoexpand_threads'] = 0; + +// When replying place cursor above original message (top posting) +$rcmail_config['top_posting'] = false; + +// When replying strip original signature from message +$rcmail_config['strip_existing_sig'] = true; + +// Show signature: +// 0 - Never +// 1 - Always +// 2 - New messages only +// 3 - Forwards and Replies only +$rcmail_config['show_sig'] = 1; + +// When replying or forwarding place sender's signature above existing message +$rcmail_config['sig_above'] = false; + +// Use MIME encoding (quoted-printable) for 8bit characters in message body +$rcmail_config['force_7bit'] = false; + +// Defaults of the search field configuration. +// The array can contain a per-folder list of header fields which should be considered when searching +// The entry with key '*' stands for all folders which do not have a specific list set. +// Please note that folder names should to be in sync with $rcmail_config['default_folders'] +$rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1)); + +// Defaults of the addressbook search field configuration. +$rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1); + +// 'Delete always' +// This setting reflects if mail should be always deleted +// when moving to Trash fails. This is necessary in some setups +// when user is over quota and Trash is included in the quota. +$rcmail_config['delete_always'] = false; + +// Directly delete messages in Junk instead of moving to Trash +$rcmail_config['delete_junk'] = false; + +// Behavior if a received message requests a message delivery notification (read receipt) +// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask) +// 3 = send automatically if sender is in addressbook, otherwise ask the user +// 4 = send automatically if sender is in addressbook, otherwise ignore +$rcmail_config['mdn_requests'] = 0; + +// Return receipt checkbox default state +$rcmail_config['mdn_default'] = 0; + +// Delivery Status Notification checkbox default state +$rcmail_config['dsn_default'] = 0; + +// Place replies in the folder of the message being replied to +$rcmail_config['reply_same_folder'] = false; + +// Sets default mode of Forward feature to "forward as attachment" +$rcmail_config['forward_attachment'] = false; + +// Defines address book (internal index) to which new contacts will be added +// By default it is the first writeable addressbook. +// Note: Use '0' for built-in address book. +$rcmail_config['default_addressbook'] = null; + +// Enables spell checking before sending a message. +$rcmail_config['spellcheck_before_send'] = false; + +// Skip alternative email addresses in autocompletion (show one address per contact) +$rcmail_config['autocomplete_single'] = false; + +// Default font for composed HTML message. +// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New, +// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana +$rcmail_config['default_font'] = ''; + +// end of config file diff --git a/install/debian/roundcube-pw.conf b/install/debian/roundcube-pw.conf new file mode 100644 index 000000000..0c82b1bc1 --- /dev/null +++ b/install/debian/roundcube-pw.conf @@ -0,0 +1,33 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %sdocroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + SSLRequireSSL + Options +Includes -Indexes +ExecCGI + php_admin_value open_basedir %docroot% + + + AllowOverride All + + SSLEngine on + SSLVerifyClient none + SSLCertificateFile %ssl_crt% + SSLCertificateKeyFile %ssl_key% + %ssl_ca_str%SSLCertificateChainFile %ssl_ca% + + + RMode config + RUidGid %user% %group% + RGroups www-data + + + AssignUserID %user% %group% + + + Include %home%/%user%/conf/web/s%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/basedir.tpl b/install/debian/templates/web/apache2/basedir.tpl new file mode 100755 index 000000000..07ec38c98 --- /dev/null +++ b/install/debian/templates/web/apache2/basedir.tpl @@ -0,0 +1,35 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %docroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + Options +Includes -Indexes +ExecCGI + php_admin_value open_basedir %docroot% + + + AllowOverride All + + + + RMode config + RUidGid %user% %group% + RGroups www-data + + + AssignUserID %user% %group% + + + Include %home%/%user%/conf/web/%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/default.stpl b/install/debian/templates/web/apache2/default.stpl new file mode 100755 index 000000000..da523c138 --- /dev/null +++ b/install/debian/templates/web/apache2/default.stpl @@ -0,0 +1,40 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %sdocroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + SSLRequireSSL + Options +Includes -Indexes +ExecCGI + + + AllowOverride All + + SSLEngine on + SSLVerifyClient none + SSLCertificateFile %ssl_crt% + SSLCertificateKeyFile %ssl_key% + %ssl_ca_str%SSLCertificateChainFile %ssl_ca% + + + RMode config + RUidGid %user% %group% + RGroups www-data + + + AssignUserID %user% %group% + + + Include %home%/%user%/conf/web/s%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/default.tpl b/install/debian/templates/web/apache2/default.tpl new file mode 100755 index 000000000..b95c1ee38 --- /dev/null +++ b/install/debian/templates/web/apache2/default.tpl @@ -0,0 +1,34 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %docroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + Options +Includes -Indexes +ExecCGI + + + AllowOverride All + + + + RMode config + RUidGid %user% %group% + RGroups www-data + + + AssignUserID %user% %group% + + + Include %home%/%user%/conf/web/%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/hosting.stpl b/install/debian/templates/web/apache2/hosting.stpl new file mode 100755 index 000000000..49af8fcef --- /dev/null +++ b/install/debian/templates/web/apache2/hosting.stpl @@ -0,0 +1,49 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %sdocroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + SSLRequireSSL + Options +Includes -Indexes +ExecCGI + php_admin_value upload_tmp_dir %home%/%user%/tmp + php_admin_value upload_max_filesize 10M + php_admin_value max_execution_time 20 + php_admin_value post_max_size 8M + php_admin_value memory_limit 32M + php_admin_flag mysql.allow_persistent off + php_admin_flag safe_mode off + php_admin_value session.save_path %home%/%user%/tmp + php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f %email%' + + + AllowOverride All + + php_admin_value open_basedir %home%/%user%/web:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/roundcubemail: + SSLEngine on + SSLVerifyClient none + SSLCertificateFile %ssl_crt% + SSLCertificateKeyFile %ssl_key% + %ssl_ca_str%SSLCertificateChainFile %ssl_ca% + + RMode config + RUidGid %user% %group% + RGroups www-data + + + AssignUserID %user% %group% + + + Include %home%/%user%/conf/web/s%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/hosting.tpl b/install/debian/templates/web/apache2/hosting.tpl new file mode 100755 index 000000000..8763b1a90 --- /dev/null +++ b/install/debian/templates/web/apache2/hosting.tpl @@ -0,0 +1,43 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %docroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + #SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + Options +Includes -Indexes +ExecCGI + php_admin_value upload_tmp_dir %home%/%user%/tmp + php_admin_value upload_max_filesize 10M + php_admin_value max_execution_time 20 + php_admin_value post_max_size 8M + php_admin_value memory_limit 32M + php_admin_flag mysql.allow_persistent off + php_admin_flag safe_mode off + php_admin_value session.save_path %home%/%user%/tmp + php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f %email%' + + + AllowOverride All + + php_admin_value open_basedir %home%/%user%/web:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/roundcubemail: + + RMode config + RUidGid %user% %group% + RGroups www-data + + + AssignUserID %user% %group% + + + Include %home%/%user%/conf/web/%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/phpcgi.sh b/install/debian/templates/web/apache2/phpcgi.sh new file mode 100755 index 000000000..6565e103d --- /dev/null +++ b/install/debian/templates/web/apache2/phpcgi.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Adding php wrapper +user="$1" +domain="$2" +ip="$3" +home_dir="$4" +docroot="$5" + +wrapper_script='#!/usr/bin/php-cgi -cphp5-cgi.ini' +wrapper_file="$home_dir/$user/web/$domain/cgi-bin/php" + +echo "$wrapper_script" > $wrapper_file +chown $user:$user $wrapper_file +chmod -f 751 $wrapper_file + +exit 0 diff --git a/install/debian/templates/web/apache2/phpcgi.stpl b/install/debian/templates/web/apache2/phpcgi.stpl new file mode 100755 index 000000000..58c4baf90 --- /dev/null +++ b/install/debian/templates/web/apache2/phpcgi.stpl @@ -0,0 +1,35 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %sdocroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + SSLRequireSSL + AllowOverride All + Options +Includes -Indexes +ExecCGI + Action phpcgi-script /cgi-bin/php + + SetHandler phpcgi-script + + + + AllowOverride All + + SSLEngine on + SSLVerifyClient none + SSLCertificateFile %ssl_crt% + SSLCertificateKeyFile %ssl_key% + %ssl_ca_str%SSLCertificateChainFile %ssl_ca% + + Include %home%/%user%/conf/web/s%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/phpcgi.tpl b/install/debian/templates/web/apache2/phpcgi.tpl new file mode 100755 index 000000000..21be2cdd7 --- /dev/null +++ b/install/debian/templates/web/apache2/phpcgi.tpl @@ -0,0 +1,28 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %docroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + Options +Includes -Indexes +ExecCGI + Action phpcgi-script /cgi-bin/php + + SetHandler phpcgi-script + + + + AllowOverride All + + Include %home%/%user%/conf/web/%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/phpfcgid.sh b/install/debian/templates/web/apache2/phpfcgid.sh new file mode 100755 index 000000000..e80582492 --- /dev/null +++ b/install/debian/templates/web/apache2/phpfcgid.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Adding php wrapper +user="$1" +domain="$2" +ip="$3" +home_dir="$4" +docroot="$5" + +wrapper_script="#!/bin/sh +PHPRC=/usr/local/lib +export PHPRC +export PHP_FCGI_MAX_REQUESTS=1000 +export PHP_FCGI_CHILDREN=20 +exec /usr/bin/php-cgi +" +wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi-starter" + +echo "$wrapper_script" > $wrapper_file +chown $user:$user $wrapper_file +chmod -f 751 $wrapper_file + +exit 0 diff --git a/install/debian/templates/web/apache2/phpfcgid.stpl b/install/debian/templates/web/apache2/phpfcgid.stpl new file mode 100755 index 000000000..20a580093 --- /dev/null +++ b/install/debian/templates/web/apache2/phpfcgid.stpl @@ -0,0 +1,36 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %sdocroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + SSLRequireSSL + AllowOverride All + Options +Includes -Indexes +ExecCGI + + SetHandler fcgid-script + + FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php + + + AllowOverride All + + php_admin_value open_basedir none + SSLEngine on + SSLVerifyClient none + SSLCertificateFile %ssl_crt% + SSLCertificateKeyFile %ssl_key% + %ssl_ca_str%SSLCertificateChainFile %ssl_ca% + + Include %home%/%user%/conf/web/s%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/apache2/phpfcgid.tpl b/install/debian/templates/web/apache2/phpfcgid.tpl new file mode 100755 index 000000000..72e7d8d44 --- /dev/null +++ b/install/debian/templates/web/apache2/phpfcgid.tpl @@ -0,0 +1,28 @@ + + + ServerName %domain_idn% + %alias_string% + ServerAdmin %email% + DocumentRoot %docroot% + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + Alias /vstats/ %home%/%user%/web/%domain%/stats/ + Alias /error/ %home%/%user%/web/%domain%/document_errors/ + SuexecUserGroup %user% %group% + CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes + CustomLog /var/log/%web_system%/domains/%domain%.log combined + ErrorLog /var/log/%web_system%/domains/%domain%.error.log + + AllowOverride All + Options +Includes -Indexes +ExecCGI + + SetHandler fcgid-script + + FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php + + + AllowOverride All + + Include %home%/%user%/conf/web/%web_system%.%domain%.conf* + + + diff --git a/install/debian/templates/web/awstats/awstats.tpl b/install/debian/templates/web/awstats/awstats.tpl new file mode 100755 index 000000000..274c5ed3f --- /dev/null +++ b/install/debian/templates/web/awstats/awstats.tpl @@ -0,0 +1,133 @@ +LogFile="/var/log/httpd/domains/%domain%.log" +LogType=W +LogFormat=1 +LogSeparator=" " +SiteDomain="%domain_idn%" +HostAliases="%alias_idn%" +DirData="%home%/%user%/web/%domain%/stats" +DirCgi="/vstats" +DirIcons="/vstats/icon" +AllowToUpdateStatsFromBrowser=0 +AllowFullYearView=2 +EnableLockForUpdate=1 +DNSStaticCacheFile="dnscache.txt" +DNSLastUpdateCacheFile="dnscachelastupdate.txt" +SkipDNSLookupFor="" +AllowAccessFromWebToAuthenticatedUsersOnly=0 +AllowAccessFromWebToFollowingAuthenticatedUsers="" +AllowAccessFromWebToFollowingIPAddresses="" +CreateDirDataIfNotExists=0 +BuildHistoryFormat=text +BuildReportFormat=html +SaveDatabaseFilesWithPermissionsForEveryone=0 +PurgeLogFile=0 +ArchiveLogRecords=0 +KeepBackupOfHistoricFiles=1 +DefaultFile="index.php index.html" +SkipHosts="127.0.0.1 +SkipUserAgents="" +SkipFiles="" +SkipReferrersBlackList="" +OnlyHosts="" +OnlyUserAgents="" +OnlyUsers="" +OnlyFiles="" +NotPageList="css js class gif jpg jpeg png bmp ico rss xml swf" +ValidHTTPCodes="200 304" +ValidSMTPCodes="1 250" +AuthenticatedUsersNotCaseSensitive=0 +URLNotCaseSensitive=0 +URLWithAnchor=0 +URLQuerySeparators="?;" +URLWithQuery=0 +URLWithQueryWithOnlyFollowingParameters="" +URLWithQueryWithoutFollowingParameters="" +URLReferrerWithQuery=0 +WarningMessages=1 +ErrorMessages="" +DebugMessages=0 +NbOfLinesForCorruptedLog=50 +WrapperScript="" +DecodeUA=0 +MiscTrackerUrl="/js/awstats_misc_tracker.js" +UseFramesWhenCGI=1 +DetailedReportsOnNewWindows=1 +Expires=3600 +MaxRowsInHTMLOutput=1000 +Lang="auto" +DirLang="./lang" +ShowMenu=1 +ShowSummary=UVPHB +ShowMonthStats=UVPHB +ShowDaysOfMonthStats=VPHB +ShowDaysOfWeekStats=PHB +ShowHoursStats=PHB +ShowDomainsStats=PHB +ShowHostsStats=PHBL +ShowAuthenticatedUsers=0 +ShowRobotsStats=HBL +ShowWormsStats=0 +ShowEMailSenders=0 +ShowEMailReceivers=0 +ShowSessionsStats=1 +ShowPagesStats=PBEX +ShowFileTypesStats=HB +ShowFileSizesStats=0 +ShowDownloadsStats=HB +ShowOSStats=1 +ShowBrowsersStats=1 +ShowScreenSizeStats=0 +ShowOriginStats=PH +ShowKeyphrasesStats=1 +ShowKeywordsStats=1 +ShowMiscStats=a +ShowHTTPErrorsStats=1 +ShowSMTPErrorsStats=0 +ShowClusterStats=0 +AddDataArrayMonthStats=1 +AddDataArrayShowDaysOfMonthStats=1 +AddDataArrayShowDaysOfWeekStats=1 +AddDataArrayShowHoursStats=1 +IncludeInternalLinksInOriginSection=0 +MaxNbOfDomain = 10 +MinHitDomain = 1 +MaxNbOfHostsShown = 10 +MinHitHost = 1 +MaxNbOfLoginShown = 10 +MinHitLogin = 1 +MaxNbOfRobotShown = 10 +MinHitRobot = 1 +MaxNbOfDownloadsShown = 10 +MinHitDownloads = 1 +MaxNbOfPageShown = 10 +MinHitFile = 1 +MaxNbOfOsShown = 10 +MinHitOs = 1 +MaxNbOfBrowsersShown = 10 +MinHitBrowser = 1 +MaxNbOfScreenSizesShown = 5 +MinHitScreenSize = 1 +MaxNbOfWindowSizesShown = 5 +MinHitWindowSize = 1 +MaxNbOfRefererShown = 10 +MinHitRefer = 1 +MaxNbOfKeyphrasesShown = 10 +MinHitKeyphrase = 1 +MaxNbOfKeywordsShown = 10 +MinHitKeyword = 1 +MaxNbOfEMailsShown = 20 +MinHitEMail = 1 +FirstDayOfWeek=0 +ShowFlagLinks="" +ShowLinksOnUrl=1 +UseHTTPSLinkForUrl="" +MaxLengthOfShownURL=64 +HTMLHeadSection="" +HTMLEndSection="" +MetaRobot=0 +Logo="awstats_logo6.png" +LogoLink="http://awstats.sourceforge.net" +BarWidth = 260 +BarHeight = 90 +StyleSheet="" +ExtraTrackedRowsLimit=500 diff --git a/install/debian/templates/web/awstats/index.tpl b/install/debian/templates/web/awstats/index.tpl new file mode 100755 index 000000000..9df9bb5cb --- /dev/null +++ b/install/debian/templates/web/awstats/index.tpl @@ -0,0 +1,10 @@ + + + + Awstats log analyzer + + + + + + diff --git a/install/debian/templates/web/awstats/nav.tpl b/install/debian/templates/web/awstats/nav.tpl new file mode 100755 index 000000000..f29bed68b --- /dev/null +++ b/install/debian/templates/web/awstats/nav.tpl @@ -0,0 +1,23 @@ + + + Awstats navigation + + + + + + + + +
vesta
+ +
+
+ + diff --git a/install/debian/templates/web/nginx/caching.stpl b/install/debian/templates/web/nginx/caching.stpl new file mode 100755 index 000000000..036dc6ee7 --- /dev/null +++ b/install/debian/templates/web/nginx/caching.stpl @@ -0,0 +1,44 @@ +server { + listen %ip%:%proxy_ssl_port%; + server_name %domain_idn% %alias_idn%; + ssl on; + ssl_certificate %ssl_pem%; + ssl_certificate_key %ssl_key%; + error_log /var/log/%web_system%/domains/%domain%.error.log error; + + location / { + proxy_pass http://%ip%:%web_port%; + + proxy_cache cache; + proxy_cache_valid 15m; + proxy_cache_valid 404 1m; + proxy_no_cache $no_cache; + proxy_cache_bypass $no_cache; + proxy_cache_bypass $cookie_session $http_x_update; + + location ~* ^.+\.(%proxy_extentions%)$ { + proxy_cache off; + root %docroot%; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; + expires max; + try_files $uri @fallback; + } + } + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location @fallback { + proxy_pass http://%ip%:%web_port%; + } + + location ~ /\.ht {return 404;} + location ~ /\.svn/ {return 404;} + location ~ /\.git/ {return 404;} + location ~ /\.hg/ {return 404;} + location ~ /\.bzr/ {return 404;} + + include %home%/%user%/conf/nginx.%domain%.conf*; +} diff --git a/install/debian/templates/web/nginx/caching.tpl b/install/debian/templates/web/nginx/caching.tpl new file mode 100755 index 000000000..04e38d445 --- /dev/null +++ b/install/debian/templates/web/nginx/caching.tpl @@ -0,0 +1,41 @@ +server { + listen %ip%:%proxy_port%; + server_name %domain_idn% %alias_idn%; + error_log /var/log/%web_system%/domains/%domain%.error.log error; + + location / { + proxy_pass http://%ip%:%web_port%; + + proxy_cache cache; + proxy_cache_valid 15m; + proxy_cache_valid 404 1m; + proxy_no_cache $no_cache; + proxy_cache_bypass $no_cache; + proxy_cache_bypass $cookie_session $http_x_update; + + location ~* ^.+\.(%proxy_extentions%)$ { + proxy_cache off; + root %docroot%; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; + expires max; + try_files $uri @fallback; + } + } + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location @fallback { + proxy_pass http://%ip%:%web_port%; + } + + location ~ /\.ht {return 404;} + location ~ /\.svn/ {return 404;} + location ~ /\.git/ {return 404;} + location ~ /\.hg/ {return 404;} + location ~ /\.bzr/ {return 404;} + + include %home%/%user%/conf/nginx.%domain%.conf*; +} diff --git a/install/debian/templates/web/nginx/default.stpl b/install/debian/templates/web/nginx/default.stpl new file mode 100755 index 000000000..fa5380606 --- /dev/null +++ b/install/debian/templates/web/nginx/default.stpl @@ -0,0 +1,36 @@ +server { + listen %ip%:%proxy_ssl_port%; + server_name %domain_idn% %alias_idn%; + ssl on; + ssl_certificate %ssl_pem%; + ssl_certificate_key %ssl_key%; + error_log /var/log/%web_system%/domains/%domain%.error.log error; + + location / { + proxy_pass https://%ip%:%web_ssl_port%; + location ~* ^.+\.(%proxy_extentions%)$ { + root %sdocroot%; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; + expires max; + try_files $uri @fallback; + } + } + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location @fallback { + proxy_pass https://%ip%:%web_ssl_port%; + } + + location ~ /\.ht {return 404;} + location ~ /\.svn/ {return 404;} + location ~ /\.git/ {return 404;} + location ~ /\.hg/ {return 404;} + location ~ /\.bzr/ {return 404;} + + include %home%/%user%/conf/web/snginx.%domain%.conf*; +} + diff --git a/install/debian/templates/web/nginx/default.tpl b/install/debian/templates/web/nginx/default.tpl new file mode 100755 index 000000000..4d5c774bc --- /dev/null +++ b/install/debian/templates/web/nginx/default.tpl @@ -0,0 +1,33 @@ +server { + listen %ip%:%proxy_port%; + server_name %domain_idn% %alias_idn%; + error_log /var/log/%web_system%/domains/%domain%.error.log error; + + location / { + proxy_pass http://%ip%:%web_port%; + location ~* ^.+\.(%proxy_extentions%)$ { + root %docroot%; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; + expires max; + try_files $uri @fallback; + } + } + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location @fallback { + proxy_pass http://%ip%:%web_port%; + } + + location ~ /\.ht {return 404;} + location ~ /\.svn/ {return 404;} + location ~ /\.git/ {return 404;} + location ~ /\.hg/ {return 404;} + location ~ /\.bzr/ {return 404;} + + include %home%/%user%/conf/web/nginx.%domain%.conf*; +} + diff --git a/install/debian/templates/web/nginx/hosting.sh b/install/debian/templates/web/nginx/hosting.sh new file mode 100755 index 000000000..eeed37ef9 --- /dev/null +++ b/install/debian/templates/web/nginx/hosting.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Changing public_html permission +user="$1" +domain="$2" +ip="$3" +home_dir="$4" +docroot="$5" + +chmod 755 $docroot + +exit 0 diff --git a/install/debian/templates/web/nginx/hosting.stpl b/install/debian/templates/web/nginx/hosting.stpl new file mode 100755 index 000000000..d778d6333 --- /dev/null +++ b/install/debian/templates/web/nginx/hosting.stpl @@ -0,0 +1,38 @@ +server { + listen %ip%:%proxy_ssl_port%; + server_name %domain_idn% %alias_idn%; + ssl on; + ssl_certificate %ssl_pem%; + ssl_certificate_key %ssl_key%; + error_log /var/log/%web_system%/domains/%domain%.error.log error; + + location / { + proxy_pass https://%ip%:%web_ssl_port%; + location ~* ^.+\.(%proxy_extentions%)$ { + root %sdocroot%; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; + expires max; + try_files $uri @fallback; + } + } + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location @fallback { + proxy_pass https://%ip%:%web_ssl_port%; + } + + location ~ /\.ht {return 404;} + location ~ /\.svn/ {return 404;} + location ~ /\.git/ {return 404;} + location ~ /\.hg/ {return 404;} + location ~ /\.bzr/ {return 404;} + + disable_symlinks if_not_owner from=%docroot%; + + include %home%/%user%/conf/web/snginx.%domain%.conf*; +} + diff --git a/install/debian/templates/web/nginx/hosting.tpl b/install/debian/templates/web/nginx/hosting.tpl new file mode 100755 index 000000000..15961c95c --- /dev/null +++ b/install/debian/templates/web/nginx/hosting.tpl @@ -0,0 +1,35 @@ +server { + listen %ip%:%proxy_port%; + server_name %domain_idn% %alias_idn%; + error_log /var/log/%web_system%/domains/%domain%.error.log error; + + location / { + proxy_pass http://%ip%:%web_port%; + location ~* ^.+\.(%proxy_extentions%)$ { + root %docroot%; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; + expires max; + try_files $uri @fallback; + } + } + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location @fallback { + proxy_pass http://%ip%:%web_port%; + } + + location ~ /\.ht {return 404;} + location ~ /\.svn/ {return 404;} + location ~ /\.git/ {return 404;} + location ~ /\.hg/ {return 404;} + location ~ /\.bzr/ {return 404;} + + disable_symlinks if_not_owner from=%docroot%; + + include %home%/%user%/conf/web/nginx.%domain%.conf*; +} + diff --git a/install/debian/templates/web/nginx/proxy_ip.tpl b/install/debian/templates/web/nginx/proxy_ip.tpl new file mode 100755 index 000000000..ae1956173 --- /dev/null +++ b/install/debian/templates/web/nginx/proxy_ip.tpl @@ -0,0 +1,9 @@ +server { + listen %ip%:%proxy_port% default; + server_name _; + #access_log /var/log/nginx/%ip%.log main; + location / { + proxy_pass http://%ip%:%web_port%; + } +} + diff --git a/install/debian/templates/web/skel/document_errors/403.html b/install/debian/templates/web/skel/document_errors/403.html new file mode 100755 index 000000000..9c3f6baab --- /dev/null +++ b/install/debian/templates/web/skel/document_errors/403.html @@ -0,0 +1,29 @@ + + + 403 — Forbidden + + + + + + +

%domain%

+ +

403

+

Forbidden

+
+ Unfortunately, you do not have permission to view this +
+ + + diff --git a/install/debian/templates/web/skel/document_errors/404.html b/install/debian/templates/web/skel/document_errors/404.html new file mode 100755 index 000000000..2cee77084 --- /dev/null +++ b/install/debian/templates/web/skel/document_errors/404.html @@ -0,0 +1,28 @@ + + + 404 — Not Found + + + + + + +

%domain%

+

404

+

Page Not Found

+
+ It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved. + You can start again from the home or go back to previous page. +
+ + diff --git a/install/debian/templates/web/skel/document_errors/50x.html b/install/debian/templates/web/skel/document_errors/50x.html new file mode 100755 index 000000000..85ba648b7 --- /dev/null +++ b/install/debian/templates/web/skel/document_errors/50x.html @@ -0,0 +1,29 @@ + + + 500 — Internal Sever Error + + + + + + +

%domain%

+ +

500

+

Internal Server Error

+
+ Sorry, something went wrong :( +
+ + + diff --git a/install/debian/templates/web/skel/public_html/index.html b/install/debian/templates/web/skel/public_html/index.html new file mode 100755 index 000000000..4f5bb7244 --- /dev/null +++ b/install/debian/templates/web/skel/public_html/index.html @@ -0,0 +1,26 @@ + + + %domain% — Coming Soon + + + + + + +

%domain%

+ + + + + diff --git a/install/debian/templates/web/skel/public_html/robots.txt b/install/debian/templates/web/skel/public_html/robots.txt new file mode 100755 index 000000000..00ee83dcf --- /dev/null +++ b/install/debian/templates/web/skel/public_html/robots.txt @@ -0,0 +1,3 @@ +# vestacp autogenerated robots.txt +User-agent: * +Crawl-delay: 10 diff --git a/install/debian/templates/web/skel/public_shtml/index.html b/install/debian/templates/web/skel/public_shtml/index.html new file mode 100755 index 000000000..4f5bb7244 --- /dev/null +++ b/install/debian/templates/web/skel/public_shtml/index.html @@ -0,0 +1,26 @@ + + + %domain% — Coming Soon + + + + + + +

%domain%

+ + + + + diff --git a/install/debian/templates/web/skel/public_shtml/robots.txt b/install/debian/templates/web/skel/public_shtml/robots.txt new file mode 100755 index 000000000..00ee83dcf --- /dev/null +++ b/install/debian/templates/web/skel/public_shtml/robots.txt @@ -0,0 +1,3 @@ +# vestacp autogenerated robots.txt +User-agent: * +Crawl-delay: 10 diff --git a/install/debian/templates/web/suspend/.htaccess b/install/debian/templates/web/suspend/.htaccess new file mode 100755 index 000000000..5a6df83fb --- /dev/null +++ b/install/debian/templates/web/suspend/.htaccess @@ -0,0 +1,2 @@ +ErrorDocument 403 /index.html +ErrorDocument 404 /index.html diff --git a/install/debian/templates/web/suspend/index.html b/install/debian/templates/web/suspend/index.html new file mode 100755 index 000000000..d5d299077 --- /dev/null +++ b/install/debian/templates/web/suspend/index.html @@ -0,0 +1,27 @@ + + + SUSPEND + + + + + + +

SUSPEND

+

Your site has been suspended

+
+ Please contact technical support departament. +
+ + + diff --git a/install/debian/templates/web/webalizer/webalizer.tpl b/install/debian/templates/web/webalizer/webalizer.tpl new file mode 100755 index 000000000..2e4fee3f8 --- /dev/null +++ b/install/debian/templates/web/webalizer/webalizer.tpl @@ -0,0 +1,110 @@ +HostName %domain_idn% +LogFile /var/log/httpd/domains/%domain%.log +OutputDir %home%/%user%/web/%domain%/stats +HistoryName %home%/%user%/web/%domain%/stats/%domain%.hist +Incremental yes +IncrementalName %home%/%user%/web/%domain%/stats/%domain%.current +PageType htm* +PageType cgi +PageType php +PageType shtml +DNSCache /var/lib/webalizer/dns_cache.db +DNSChildren 10 +Quiet yes +FoldSeqErr yes +IndexAlias index.php +HideURL *.gif +HideURL *.GIF +HideURL *.jpg +HideURL *.JPG +HideURL *.png +HideURL *.PNG +HideURL *.ra +SearchEngine abcsearch. terms= +SearchEngine alexa. q= +SearchEngine alltheweb. q= +SearchEngine alltheweb. query= +SearchEngine alot. q= +SearchEngine altavista. q= +SearchEngine aolsearch. query= +SearchEngine aport.ru r= +SearchEngine ask. q= +SearchEngine atlas.cz q= +SearchEngine bbc. q= +SearchEngine bing. q= +SearchEngine blingo. q= +SearchEngine blogs.yandex.ru text= +SearchEngine btopenworld query= +SearchEngine buscador.ya.com q= +SearchEngine busca. q= +SearchEngine business. query= +SearchEngine centrum.cz q= +SearchEngine chiff. q= +SearchEngine clusty. query= +SearchEngine comcast. q= +SearchEngine crawler. q= +SearchEngine cuil. q= +SearchEngine dmoz. search= +SearchEngine dogpile.com q= +SearchEngine dpxml qkw= +SearchEngine eureka. searchword= +SearchEngine euroseek. string= +SearchEngine exalead. q= +SearchEngine excite search= +SearchEngine ezilon. q= +SearchEngine fastbrowsersearch. q= +SearchEngine feedster.com q= +SearchEngine fireball.de q= +SearchEngine fireball. keyword= +SearchEngine freeserve. q= +SearchEngine gigablast. q= +SearchEngine gogo.ru q= +SearchEngine go.mail.ru q= +SearchEngine google. q= +SearchEngine hakia. q= +SearchEngine hotbot. query= +SearchEngine infoseek. qt= +SearchEngine iwon searchfor= +SearchEngine ixquick.com query= +SearchEngine joeant. keywords= +SearchEngine jyxo.cz s= +SearchEngine looksmart. key= +SearchEngine lycos. query= +SearchEngine mamma. q= +SearchEngine metacrawler q= +SearchEngine msn. MT= +SearchEngine msxml qkw= +SearchEngine mysearch. searchfor= +SearchEngine mywebsearch. searchfor= +SearchEngine netscape. q= +SearchEngine nigma.ru q= +SearchEngine northernlight. qr= +SearchEngine ntlworld. q= +SearchEngine orange. q= +SearchEngine overture. Keywords= +SearchEngine punto.ru text= +SearchEngine rambler. keyword= +SearchEngine search.aol. q= +SearchEngine search.babylon. q= +SearchEngine search.centrum. phrase= +SearchEngine search.conduit. q= +SearchEngine search.earthlink q= +SearchEngine search.icq. q= +SearchEngine search.live.com q= +SearchEngine search.rambler.ru words= +SearchEngine search.winamp. q= +SearchEngine searchy. q= +SearchEngine seznam.cz w= +SearchEngine snap. query= +SearchEngine teoma. q= +SearchEngine teradex.com q= +SearchEngine ukplus key= +SearchEngine verizon. q= +SearchEngine virginmedia. q= +SearchEngine voila. rdata= +SearchEngine webcrawler searchText= +SearchEngine web.search.naver. query= +SearchEngine wisenut q= +SearchEngine yahoo. p= +SearchEngine yandex. text= +SearchEngine yodao. q= diff --git a/install/debian/vesta.conf b/install/debian/vesta.conf new file mode 100644 index 000000000..00e205f55 --- /dev/null +++ b/install/debian/vesta.conf @@ -0,0 +1,22 @@ +WEB_SYSTEM='apache2' +WEB_RGROUPS='www-data' +WEB_PORT='8080' +WEB_SSL='mod_ssl' +WEB_SSL_PORT='8443' +PROXY_SYSTEM='nginx' +PROXY_PORT='80' +PROXY_SSL_PORT='443' +FTP_SYSTEM='vsftpd' +MAIL_SYSTEM='exim4' +IMAP_SYSTEM='dovecot' +ANTIVIRUS_SYSTEM='clamav-daemon' +ANTISPAM_SYSTEM='spamassassin' +DB_SYSTEM='mysql' +DNS_SYSTEM='bind9' +STATS_SYSTEM='webalizer,awstats' +BACKUP_SYSTEM='local' +CRON_SYSTEM='cron' +DISK_QUOTA='no' +REPOSITORY='cmmnt' +VERSION='0.9.8' +LANGUAGE='en' diff --git a/install/debian/vesta.log b/install/debian/vesta.log new file mode 100644 index 000000000..027a34396 --- /dev/null +++ b/install/debian/vesta.log @@ -0,0 +1,7 @@ +/usr/local/vesta/log/*.log { + missingok + notifempty + size 30k + yearly + create 0600 root root +} diff --git a/install/debian/vsftpd.conf b/install/debian/vsftpd.conf new file mode 100644 index 000000000..f5aab2f52 --- /dev/null +++ b/install/debian/vsftpd.conf @@ -0,0 +1,23 @@ +anonymous_enable=NO +local_enable=YES +write_enable=YES +local_umask=002 +anon_upload_enable=NO +dirmessage_enable=YES +xferlog_enable=YES +connect_from_port_20=YES +xferlog_std_format=YES +chroot_local_user=YES +listen=YES +pam_service_name=vsftpd +userlist_enable=NO +tcp_wrappers=YES +force_dot_files=YES +ascii_upload_enable=YES +ascii_download_enable=YES +#allow_writable_chroot=YES +allow_writeable_chroot=YES +seccomp_sandbox=NO +pasv_enable=YES +pasv_max_port=12100 +pasv_min_port=12000 diff --git a/install/debian/whmcs-module.php b/install/debian/whmcs-module.php new file mode 100644 index 000000000..b3b1710ee --- /dev/null +++ b/install/debian/whmcs-module.php @@ -0,0 +1,342 @@ + array( "Type" => "text", "Default" => "default"), + "SSH Access" => array( "Type" => "yesno", "Description" => "Tick to grant access", ), + "IP Address (optional)" => array( "Type" => "text" ), + ); + return $configarray; + +} + +function vesta_CreateAccount($params) { + + // Execute only if there is assigned server + if ($params["server"] == 1) { + + // Prepare variables + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-add-user', + 'arg1' => $params["username"], + 'arg2' => $params["password"], + 'arg3' => $params["clientsdetails"]["email"], + 'arg4' => $params["configoption1"], + 'arg5' => $params["clientsdetails"]["firstname"], + 'arg6' => $params["clientsdetails"]["lastname"], + ); + $postdata = http_build_query($postvars); + + // Create user account + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + + // Enable ssh access + if(($answer == 'OK') && ($params["configoption2"] == 'on')) { + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-change-user-shell', + 'arg1' => $params["username"], + 'arg2' => 'bash' + ); + $postdata = http_build_query($postvars); + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + } + + // Add domain + if(($answer == 'OK') && (!empty($params["domain"]))) { + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-add-domain', + 'arg1' => $params["username"], + 'arg2' => $params["domain"], + 'arg3' => $params["configoption3"], + ); + $postdata = http_build_query($postvars); + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + } + } + + if($answer == 'OK') { + $result = "success"; + } else { + $result = $answer; + } + return $result; + +} + +function vesta_TerminateAccount($params) { + + // Execute only if there is assigned server + if ($params["server"] == 1) { + + // Prepare variables + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-delete-user', + 'arg1' => $params["username"] + ); + $postdata = http_build_query($postvars); + + // Delete user account + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + } + + if($answer == 'OK') { + $result = "success"; + } else { + $result = $answer; + } + + return $result; + +} + +function vesta_SuspendAccount($params) { + + // Execute only if there is assigned server + if ($params["server"] == 1) { + + // Prepare variables + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-suspend-user', + 'arg1' => $params["username"] + ); + $postdata = http_build_query($postvars); + + // Susupend user account + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + } + + if($answer == 'OK') { + $result = "success"; + } else { + $result = $answer; + } + +} + +function vesta_UnsuspendAccount($params) { + + // Execute only if there is assigned server + if ($params["server"] == 1) { + + // Prepare variables + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-unsuspend-user', + 'arg1' => $params["username"] + ); + $postdata = http_build_query($postvars); + + // Unsusupend user account + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + } + + if($answer == 'OK') { + $result = "success"; + } else { + $result = $answer; + } + +} + +function vesta_ChangePassword($params) { + + // Execute only if there is assigned server + if ($params["server"] == 1) { + + // Prepare variables + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-change-user-password', + 'arg1' => $params["username"], + 'arg2' => $params["password"] + ); + $postdata = http_build_query($postvars); + + // Change user package + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + } + + if($answer == 'OK') { + $result = "success"; + } else { + $result = $answer; + } + return $result; + +} + +function vesta_ChangePackage($params) { + + // Execute only if there is assigned server + if ($params["server"] == 1) { + + // Prepare variables + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-change-user-package', + 'arg1' => $params["username"], + 'arg2' => $params["configoption1"] + ); + $postdata = http_build_query($postvars); + + // Change user package + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + } + + if($answer == 'OK') { + $result = "success"; + } else { + $result = $answer; + } + return $result; + +} + +function vesta_ClientArea($params) { + + $code = '
+ + + + +
'; + return $code; + +} + +function vesta_AdminLink($params) { + + $code = '
+ + + +
'; + return $code; + +} + +function vesta_LoginLink($params) { + + echo "control panel"; + +} + +function vesta_UsageUpdate($params) { + + // Prepare variables + $postvars = array( + 'user' => $params["serverusername"], + 'password' => $params["serverpassword"], + 'hash' => $params["serveraccesshash"], + 'cmd' => 'v-list-users', + 'arg1' => 'json' + ); + $postdata = http_build_query($postvars); + + // Get user stats + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':8083/api/'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); + $answer = curl_exec($curl); + + // Decode json data + $results = json_decode($answer, true); + + // Loop through results and update DB + foreach ($results AS $user=>$values) { + update_query("tblhosting",array( + "diskusage"=>$values['U_DISK'], + "disklimit"=>$values['DISK_QUOTA'], + "bwusage"=>$values['U_BANDWIDTH'], + "bwlimit"=>$values['BANDWIDTH'], + "lastupdate"=>"now()", + ),array("server"=>$params['serverid'], "username"=>$user)); + } + +} + +?> diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh new file mode 100644 index 000000000..70485ec25 --- /dev/null +++ b/install/vst-install-debian.sh @@ -0,0 +1,810 @@ +#!/bin/bash + +# Vesta Debian installer v.01 + +#----------------------------------------------------------# +# Variables&Functions # +#----------------------------------------------------------# +export PATH=$PATH:/sbin +export DEBIAN_FRONTEND=noninteractive +RHOST='apt.vestacp.com' +CHOST='c.vestacp.com' +VERSION='0.9.8/debian' +software="nginx apache2 apache2-utils apache2.2-common apache2-suexec-custom + libapache2-mod-ruid2 libapache2-mod-rpaf libapache2-mod-fcgid bind9 idn + mysql-server mysql-common mysql-client php5-common php5-cgi php5-mysql + libapache2-mod-php5 vsftpd mc exim4 exim4-daemon-heavy clamav-daemon flex + dovecot-imapd dovecot-pop3d phpMyAdmin awstats webalizer jwhois rssh git + spamassassin roundcube roundcube-mysql roundcube-plugins apparmor-utils + bc ftp lsof ntpdate rrdtool vesta vesta-nginx vesta-php" + +help() { + echo "usage: $0 [OPTIONS] + -e, --email Define email address + -h, --help Print this help and exit + -f, --force Force installation + -n, --noupdate Do not run apt-get upgrade command" + exit 1 +} + +# Password generator +gen_pass() { + MATRIX='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' + LENGTH=10 + while [ ${n:=1} -le $LENGTH ]; do + PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}" + let n+=1 + done + echo "$PASS" +} + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +# Translating argument to --gnu-long-options +for arg; do + delim="" + case "$arg" in + --help) args="${args}-h " ;; + --force) args="${args}-f " ;; + --email) args="${args}-e " ;; + --noupdate) args="${args}-n " ;; + *) [[ "${arg:0:1}" == "-" ]] || delim="\"" + args="${args}${delim}${arg}${delim} ";; + esac +done +eval set -- "$args" + +# Getopt +while getopts "dhfne:" Option; do + case $Option in + h) help ;; # Help + e) email=$OPTARG ;; # Set email + f) force='yes' ;; # Force apt-get install + n) noupdate='yes' ;; # Disable apt-get upgrade + *) help ;; # Default + esac +done + +# Am I root? +if [ "x$(id -u)" != 'x0' ]; then + echo 'Error: this script can only be executed by root' + exit 1 +fi + +# Check supported version +if [ -e '/etc/redhat-release' ] || [ -e '/etc/lsb-release' ]; then + echo 'Error: sorry, this installer can work only on Debian 7' + exit 1 +fi + +# Check supported OS +if [ "$(arch)" != 'x86_64' ]; then + arch='i386' +else + arch="amd64" +fi +os=$(head -n1 /etc/issue | cut -f 1 -d ' ') +if [[ "$(cut -f 1 -d . /etc/debian_version)" -eq '7' ]]; then + release="7" + codename="wheezy" +fi +if [ $codename != 'wheezy' ]; then + echo 'Error: only Debian 7 is supported' + exit 1 +fi + +# Check admin user account +if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" != 'yes' ]; then + echo "Error: user admin exists" + echo + echo 'Please remove admin user account before proceeding.' + echo 'If you want to do it automatically run installer with -f option:' + echo "Example: bash $0 --force" + exit 1 +fi + +# Check admin user account +if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" != 'yes' ]; then + echo "Error: user admin exists" + echo + echo 'Please remove admin user account before proceeding.' + echo 'If you want to do it automatically run installer with -f option:' + echo "Example: bash $0 --force" + exit 1 +fi + +# Check wget +if [ ! -e '/usr/bin/wget' ]; then + apt-get -y install wget + if [ $? -ne 0 ]; then + echo "Error: can't install wget" + exit 1 + fi +fi + +# Check repo availability +wget -q "$CHOST/$VERSION/vesta.conf" -O /dev/null +if [ $? -ne 0 ]; then + echo "Error: no access to repository" + exit 1 +fi + +# Check installed packages +tmpfile=$(mktemp -p /tmp) +dpkg --get-selections > $tmpfile +for pkg in exim4 mysql-server apache2 nginx vesta; do + if [ ! -z "$(grep $pkg $tmpfile)" ]; then + conflicts="$pkg $conflicts" + fi +done +rm -f $tmpfile +if [ ! -z "$conflicts" ] && [ -z "$force" ]; then + echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!' + echo + echo 'Following rpm packages are already installed:' + echo "$conflicts" + echo + echo 'It is highly recommended to remove them before proceeding.' + echo 'If you want to force installation run this script with -f option:' + echo "Example: bash $0 --force" + echo + echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!' + echo + exit 1 +fi + +# Check server type +memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9]) +if [ "$memory" -lt '350000' ] && [ -z "$force" ]; then + echo "Error: not enough memory to install Vesta Control Panel." + echo -e "\nMinimum RAM required: 350Mb" + echo 'If you want to force installation run this script with -f option:' + echo "Example: bash $0 --force" + exit 1 +fi +srv_type='micro' + +if [ "$memory" -gt '1000000' ]; then + srv_type='small' +fi + +if [ "$memory" -gt '3000000' ]; then + srv_type='medium' +fi + +if [ "$memory" -gt '7000000' ]; then + srv_type='large' +fi + +# Are you sure ? +if [ -z $email ]; then + clear + echo + echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| ' + echo ' _| _| _| _| _| _| _| ' + echo ' _| _| _|_|_| _|_| _| _|_|_|_| ' + echo ' _| _| _| _| _| _| _| ' + echo ' _| _|_|_|_| _|_|_| _| _| _| ' + echo + echo ' Vesta Control Panel' + echo + echo + echo 'Following software will be installed on your system:' + echo ' - Nginx frontend web server' + echo ' - Apache application web server' + echo ' - Bind DNS server' + echo ' - Exim mail server' + echo ' - Dovecot IMAP and POP3 server' + if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then + echo ' - Clam mail antivirus' + echo ' - SpamAssassin antispam' + fi + echo ' - MySQL database server' + echo ' - Vsftpd FTP server' + echo + echo ' * SELinux and Iptables will be disabled' + echo + + read -p 'Do you want to proceed? [y/n]): ' answer + if [ "$answer" != 'y' ] && [ "$answer" != 'Y' ]; then + echo 'Goodbye' + exit 1 + fi + + # Check email + read -p 'Please enter valid email address: ' email +fi + +# Validate email +local_part=$(echo $email | cut -s -f1 -d\@) +remote_host=$(echo $email | cut -s -f2 -d\@) +mx_failed=1 +if [ ! -z "$remote_host" ] && [ ! -z "$local_part" ]; then + /usr/bin/host -t mx "$remote_host" > /dev/null 2>&1 + mx_failed="$?" +fi + +if [ "$mx_failed" -eq 1 ]; then + echo "Error: email $email is not valid" + exit 1 +fi + + +#----------------------------------------------------------# +# Install repository # +#----------------------------------------------------------# +# Let's start +echo -e "\n\n\n\nInstallation will take about 15 minutes ...\n" +sleep 5 + +# Update system +if [ -z "$noupdate" ]; then + apt-get -y upgrade + if [ $? -ne 0 ]; then + echo 'Error: apt-get upgrade failed' + exit 1 + fi +fi + +# Install nginx repo +apt=/etc/apt/sources.list.d +echo "deb http://nginx.org/packages/debian/ $codename nginx" > $apt/nginx.list +wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key +apt-key add /tmp/nginx_signing.key + +# Install vesta repo +echo "deb http://$RHOST/$codename/ $codename vesta" > $apt/vesta.list +wget $CHOST/deb_signing.key -O deb_signing.key +apt-key add deb_signing.key + + +#----------------------------------------------------------# +# Backups # +#----------------------------------------------------------# + +# Prepare backup tree +vst_backups="/root/vst_install_backups/$(date +%s)" +mkdir -p $vst_backups/nginx +mkdir -p $vst_backups/apache2 +mkdir -p $vst_backups/mysql +mkdir -p $vst_backups/exim4 +mkdir -p $vst_backups/dovecot +mkdir -p $vst_backups/clamav +mkdir -p $vst_backups/spamassassin +mkdir -p $vst_backups/vsftpd +mkdir -p $vst_backups/bind +mkdir -p $vst_backups/vesta +mkdir -p $vst_backups/home + +# Backup sudoers +if [ -e '/etc/sudoers' ]; then + cp /etc/sudoers $vst_backups/ +fi + +# Backup nginx +service nginx stop > /dev/null 2>&1 +if [ -e '/etc/nginx/nginx.conf' ]; then + cp -r /etc/nginx/* $vst_backups/nginx/ +fi + +# Backup apache2 +service apache2 stop > /dev/null 2>&1 +if [ -e '/etc/apache2/apache2.conf' ]; then + cp -r /etc/apache2/* $vst_backups/apache2/ +fi + +# Backup bind9 +service bind9 stop > /dev/null 2>&1 +if [ -e '/etc/bind/named.conf' ]; then + cp -r /etc/bind/* $vst_backups/bind/ +fi + +# Backup vsftpd +service vsftpd stop > /dev/null 2>&1 +if [ -e '/etc/vsftpd.conf' ]; then + cp /etc/vsftpd.conf $vst_backups/vsftpd/ +fi + +# Backup exim4 +service exim4 stop > /dev/null 2>&1 +if [ -e '/etc/exim4/exim4.conf.template' ]; then + cp -r /etc/exim4/* $vst_backups/exim4/ +fi + +# Backup clamav +service clamav-daemon stop > /dev/null 2>&1 +if [ -e '/etc/clamav/clamd.conf' ]; then + cp -r /etc/clamav/* $vst_backups/clamav/ +fi + +# Backup SpamAssassin +service spamassassin stop > /dev/null 2>&1 +if [ -e '/etc/spamassassin/local.cf' ]; then + cp -r /etc/spamassassin/* $vst_backups/spamassassin/ +fi + +# Backup dovecot +service dovecot stop > /dev/null 2>&1 +if [ -e '/etc/dovecot.conf' ]; then + cp /etc/dovecot.conf $vst_backups/dovecot/ +fi +if [ -e '/etc/dovecot' ]; then + cp -r /etc/dovecot/* $vst_backups/dovecot/ +fi + +# Backup MySQL stuff +service mysql stop > /dev/null 2>&1 +if [ -e '/var/lib/mysql' ]; then + mv /var/lib/mysql $vst_backups/mysql/mysql_datadir +fi +if [ -e '/etc/mysql/my.cnf' ]; then + cp -r /etc/mysql/* $vst_backups/mysql/ +fi +if [ -e '/root/.my.cnf' ]; then + mv /root/.my.cnf $vst_backups/mysql/ +fi + +# Backup vesta +service vesta stop > /dev/null 2>&1 +if [ -e '/usr/local/vesta' ]; then + cp -r /usr/local/vesta/* $vst_backups/vesta/ + apt-get -y remove vesta* + apt-get -y purge vesta* + rm -rf /usr/local/vesta +fi + + +#----------------------------------------------------------# +# Install packages # +#----------------------------------------------------------# + +# Exclude heavy packages +if [ "$srv_type" = 'micro' ]; then + software=$(echo "$software" | sed -e 's/libapache2-mod-fcgid//') + software=$(echo "$software" | sed -e 's/clamav-daemon//') + software=$(echo "$software" | sed -e 's/spamassassin//') +fi + +if [ "$srv_type" = 'small' ]; then + software=$(echo "$software" | sed -e 's/clamav-daemon//') + software=$(echo "$software" | sed -e 's/spamassassin//') +fi + +# Install Vesta packages +apt-get update +apt-get -y install $software +if [ $? -ne 0 ]; then + echo 'Error: apt-get install failed' + exit 1 +fi + + +#----------------------------------------------------------# +# Configure system # +#----------------------------------------------------------# + +# Set writable permission on tmp directory +chmod 777 /tmp + +# Enable password auth +sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config +service ssh restart + +# AppArmor +aa-complain /usr/sbin/named + +# Disable awstats cron +rm -f /etc/cron.d/awstats + +# Set directory color +echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile + +# Register /sbin/nologin +echo "/sbin/nologin" >> /etc/shells + +# Sudo configuration +wget $CHOST/$VERSION/sudoers.conf -O /etc/sudoers +chmod 0440 /etc/sudoers + +# NTP Synchronization +echo '#!/bin/sh' > /etc/cron.daily/ntpdate +echo "$(which ntpdate) -s pool.ntp.org" >> /etc/cron.daily/ntpdate +chmod 775 /etc/cron.daily/ntpdate +ntpdate -s pool.ntp.org + +# Setup rssh +if [ -z "$(grep /usr/bin/rssh /etc/shells)" ]; then + echo /usr/bin/rssh >> /etc/shells +fi +sed -i 's/#allowscp/allowscp/' /etc/rssh.conf +sed -i 's/#allowsftp/allowsftp/' /etc/rssh.conf +sed -i 's/#allowrsync/allowrsync/' /etc/rssh.conf +chmod 755 /usr/bin/rssh + +# Nginx configuration +rm -f /etc/nginx/conf.d/*.conf +wget $CHOST/$VERSION/nginx.conf -O /etc/nginx/nginx.conf +wget $CHOST/$VERSION/nginx-status.conf -O /etc/nginx/conf.d/status.conf +touch /etc/nginx/conf.d/vesta.conf +update-rc.d nginx defaults +service nginx stop > /dev/null 2>&1 +service nginx start +if [ "$?" -ne 0 ]; then + echo "Error: nginx start failed" + exit 1 +fi + +# Apache configuration +wget $CHOST/$VERSION/apache2.conf -O /etc/apache2/apache2.conf +wget $CHOST/$VERSION/apache2-status.conf \ + -O /etc/apache2/mods-enabled/status.conf +wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 +rm -f /etc/apache2/conf.d/vesta.conf +echo > /etc/apache2/conf.d/vesta.conf +echo "# Powever by vesta" > /etc/apache2/sites-available/default +echo "# Powever by vestas" > /etc/apache2/sites-available/default-ssl +echo "# Powever by vestas" > /etc/apache2/ports.conf +touch /var/log/apache2/access.log +touch /var/log/apache2/error.log +mkdir -p /var/log/apache2/domains +chmod a+x /var/log/apache2 +chmod 640 /var/log/apache2/access.log +chmod 640 /var/log/apache2/error.log +chmod 751 /var/log/apache2/domains +a2enmod rewrite +a2enmod suexec +echo -e "/home\npublic_html/cgi-bin" > /etc/apache2/suexec/www-data +update-rc.d apache2 defaults +service apache2 stop > /dev/null 2>&1 +service apache2 start +if [ "$?" -ne 0 ]; then + echo "Error: apache2 start failed" + exit 1 +fi + +# Vsftpd configuration +wget $CHOST/$VERSION/vsftpd.conf -O /etc/vsftpd.conf +update-rc.d vsftpd defaults +service vsftpd stop > /dev/null 2>&1 +service vsftpd start +if [ "$?" -ne 0 ]; then + echo "Error: vsftpd start failed" + exit 1 +fi + +# MySQL configuration +mpass=$(gen_pass) +wget $CHOST/$VERSION/my.cnf -O /etc/mysql/my.cnf +mysql_install_db +update-rc.d mysql defaults +service mysql stop > /dev/null 2>&1 +service mysql start +if [ "$?" -ne 0 ]; then + echo "Error: mysql start failed" + exit 1 +fi +mysqladmin -u root password $mpass +echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf +chmod 600 /root/.my.cnf +mysql -e "DELETE FROM mysql.user WHERE User=''" +mysql -e "DROP DATABASE test" +mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" +mysql -e "DELETE FROM mysql.user WHERE user='' or password='';" +mysql -e "FLUSH PRIVILEGES" + +# Bind configuration +wget $CHOST/$VERSION/named.conf -O /etc/bind/named.conf +chown root:bind /etc/bind/named.conf +chmod 640 /etc/bind/named.conf +update-rc.d bind9 defaults +service bind9 stop > /dev/null 2>&1 +service bind9 start +if [ "$?" -ne 0 ]; then + echo "Error: bind9 start failed" + exit 1 +fi + +# Exim +wget $CHOST/$VERSION/exim4.conf.template -O /etc/exim4/exim4.conf.template +if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then + sed -i "s/^SPAMASSASSIN/#SPAMASSASSIN/g" /etc/exim4/exim4.conf.template + sed -i "s/^CLAMD/#CLAMD/g" /etc/exim4/exim4.conf.template +fi +wget $CHOST/$VERSION/dnsbl.conf -O /etc/exim4/dnsbl.conf +wget $CHOST/$VERSION/spam-blocks.conf -O /etc/exim4/spam-blocks.conf +touch /etc/exim4/white-blocks.conf +rm -rf /etc/exim4/domains +mkdir -p /etc/exim4/domains +chmod 640 /etc/exim4/exim4.conf.template +gpasswd -a Debian-exim mail +if [ -e /etc/init.d/sendmail ]; then + update-rc.d -f sendmail remove + service sendmail stop +fi +if [ -e /etc/init.d/postfix ]; then + update-rc.d -f postfix remove + service postfix stop +fi +rm -f /etc/alternatives/mta +ln -s /usr/sbin/exim4 /etc/alternatives/mta +update-rc.d exim4 defaults +service exim4 stop > /dev/null 2>&1 +service exim4 start +if [ "$?" -ne 0 ]; then + echo "Error: exim start failed" + exit +fi + +# Dovecot configuration +wget $CHOST/$VERSION/dovecot.conf -O /etc/dovecot/dovecot.conf +cd /etc/dovecot/ +wget $CHOST/$VERSION/dovecot-conf.d.tar.gz +rm -rf conf.d *.ext README +tar -xzf dovecot-conf.d.tar.gz +rm -f dovecot-conf.d.tar.gz +chown -R root:root /etc/dovecot +gpasswd -a dovecot mail +if [ "$codename" = 'precise' ]; then + dovecot_ssl_conf="/etc/dovecot/conf.d/10-ssl.conf" + echo "ssl = yes" > $dovecot_ssl_conf + echo "ssl_cert = > $dovecot_ssl_conf + echo "ssl_key = > $dovecot_ssl_conf +fi +update-rc.d dovecot defaults +service dovecot stop > /dev/null 2>&1 +service dovecot start +if [ "$?" -ne 0 ]; then + echo "Error: dovecot start failed" + exit 1 +fi + +# ClamAV configuration +if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then + wget $CHOST/$VERSION/clamd.conf -O /etc/clamav/clamd.conf + gpasswd -a clamav mail + gpasswd -a clamav Debian-exim + /usr/bin/freshclam + update-rc.d clamav-daemon defaults + service clamav-daemon stop > /dev/null 2>&1 + service clamav-daemon start + if [ "$?" -ne 0 ]; then + echo "Error: clamav start failed" + exit 1 + fi +fi + +# SpamAssassin configuration +if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then + update-rc.d spamassassin defaults + sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin + service spamassassin stop > /dev/null 2>&1 + service spamassassin start + if [ "$?" -ne 0 ]; then + echo "Error: spamassassin start failed" + exit 1 + fi +fi + +# php configuration +sed -i "s/;date.timezone =/date.timezone = UTC/g" /etc/php5/apache2/php.ini +sed -i "s/;date.timezone =/date.timezone = UTC/g" /etc/php5/cli/php.ini + +# phpMyAdmin configuration +wget $CHOST/$VERSION/apache2-pma.conf -O /etc/phpmyadmin/apache.conf +wget $CHOST/$VERSION/pma.conf -O /etc/phpmyadmin/config.inc.php +ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf +mv -f /etc/phpmyadmin/config-db.php /etc/phpmyadmin/config-db.php_ + +# Roundcube configuration +wget $CHOST/$VERSION/apache2-webmail.conf -O /etc/roundcube/apache.conf +wget $CHOST/$VERSION/roundcube-main.conf -O /etc/roundcube/main.inc.php +wget $CHOST/$VERSION/roundcube-db.conf -O /etc/roundcube/db.inc.php +wget $CHOST/$VERSION/roundcube-driver.php -O \ + /usr/share/roundcube/plugins/password/drivers/vesta.php +wget $CHOST/$VERSION/roundcube-pw.conf -O \ + /etc/roundcube/plugins/password/config.inc.php +r="$(gen_pass)" +mysql -e "CREATE DATABASE roundcube" +mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'" +sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php +mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql + +# Vesta configuration +echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh +chmod 755 /etc/profile.d/vesta.sh +source /etc/profile.d/vesta.sh +echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile +echo 'export PATH' >> /root/.bash_profile +source /root/.bash_profile +wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta + +# Directory tree +mkdir -p $VESTA/conf +mkdir -p $VESTA/log +mkdir -p $VESTA/ssl +mkdir -p $VESTA/data +mkdir -p $VESTA/data/ips +mkdir -p $VESTA/data/queue +mkdir -p $VESTA/data/users +touch $VESTA/data/queue/backup.pipe +touch $VESTA/data/queue/disk.pipe +touch $VESTA/data/queue/webstats.pipe +touch $VESTA/data/queue/restart.pipe +touch $VESTA/data/queue/traffic.pipe +chmod 750 $VESTA/conf +chmod 750 $VESTA/data/users +chmod 750 $VESTA/data/ips +chmod -R 750 $VESTA/data/queue +ln -s /usr/local/vesta/log /var/log/vesta +touch /var/log/vesta/system.log +touch /var/log/vesta/nginx-error.log +touch /var/log/vesta/auth.log +chmod 660 /var/log/vesta/* +adduser backup > /dev/null 2>&1 +mkdir -p /home/backup +chown backup:backup /home/backup +ln -s /home/backup /backup +chmod a+x /backup + +# vesta.conf +wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf +if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then + sed -i "s/clamav-daemon//g" $VESTA/conf/vesta.conf + sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf +fi + +# Templates +cd /usr/local/vesta/data +wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz +tar -xzf packages.tar.gz +rm -f packages.tar.gz +cd /usr/local/vesta/data +wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz +tar -xzf templates.tar.gz +rm -f templates.tar.gz +chmod -R 755 /usr/local/vesta/data/templates +cp templates/web/skel/public_html/index.html /var/www/ +sed -i 's/%domain%/It worked!/g' /var/www/index.html +if [ "$srv_type" = 'micro' ]; then + rm -f /usr/local/vesta/data/templates/web/apache2/phpfcgid.* +fi + +# Default SSL keys +cd /usr/local/vesta/ssl +wget $CHOST/$VERSION/certificate.crt -O certificate.crt +wget $CHOST/$VERSION/certificate.key -O certificate.key + +# Adding admin user +if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then + chattr -i /home/admin/conf > /dev/null 2>&1 + userdel -f admin + chattr -i /home/admin/conf + mv -f /home/admin $vst_backups/home/ + rm -f /tmp/sess_* +fi +if [ ! -z "$(grep ^admin: /etc/group)" ]; then + groupdel admin > /dev/null 2>&1 +fi +vpass=$(gen_pass) +$VESTA/bin/v-add-user admin $vpass $email default System Administrator +if [ $? -ne 0 ]; then + echo "Error: can't create admin user" + exit 1 +fi +$VESTA/bin/v-change-user-shell admin bash +$VESTA/bin/v-change-user-language admin en + +# Configure mysql host +$VESTA/bin/v-add-database-host mysql localhost root $mpass +$VESTA/bin/v-add-database admin default default $(gen_pass) mysql + +# Configuring system ips +$VESTA/bin/v-update-sys-ip + +# Get main ip +main_ip=$(ifconfig |grep 'inet addr:' |grep -v 127.0.0.1 |head -n1 | \ + cut -f2 -d: | cut -f1 -d ' ') + +# Get remote ip +vst_ip=$(wget vestacp.com/what-is-my-ip/ -O - 2>/dev/null) +if [ ! -z "$vst_ip" ] && [ "$vst_ip" != "$main_ip" ]; then + # Set NAT association + $VESTA/bin/v-change-sys-ip-nat $main_ip $vst_ip +fi +if [ -z "$vst_ip" ]; then + vst_ip=$main_ip +fi + +# Add default web domain +$VESTA/bin/v-add-web-domain admin default.domain $vst_ip + +# Add default dns domain +$VESTA/bin/v-add-dns-domain admin default.domain $vst_ip + +# Add default mail domain +$VESTA/bin/v-add-mail-domain admin default.domain + +# Configuring crond +command='sudo /usr/local/vesta/bin/v-update-sys-queue disk' +$VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command" +command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic' +$VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command" +command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats' +$VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command" +command='sudo /usr/local/vesta/bin/v-update-sys-queue backup' +$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" +command='sudo /usr/local/vesta/bin/v-backup-users' +$VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command" +command='sudo /usr/local/vesta/bin/v-update-user-stats' +$VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" +command='sudo /usr/local/vesta/bin/v-update-sys-rrd' +$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" + +# Build inititall rrd images +$VESTA/bin/v-update-sys-rrd + +# Start system service +update-rc.d vesta defaults +service vesta stop > /dev/null 2>&1 +service vesta start +if [ "$?" -ne 0 ]; then + echo "Error: vesta start failed" + exit 1 +fi + +# Send notification to vestacp.com +wget vestacp.com/notify/?$codename -O /dev/null + +# Send notification to admin email +echo -e "Congratulations, you have just successfully installed \ +the Vesta Control Panel + +You can login in Vesta with following credentials: + username: admin + password: $vpass + https://$vst_ip:8083 + +We hope that you enjoy your installation of Vesta. Please \ +feel free to contact us anytime if you have any questions. +Thank you. + +-- +Sincerely yours +vestacp.com team +" > $tmpfile + +send_mail="$VESTA/web/inc/mail-wrapper.php" +cat $tmpfile | $send_mail -s "Vesta Control Panel" $email +rm -f $tmpfile + +# Congrats +echo '=======================================================' +echo +echo +echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| ' +echo ' _| _| _| _| _| _| _| ' +echo ' _| _| _|_|_| _|_| _| _|_|_|_| ' +echo ' _| _| _| _| _| _| _| ' +echo ' _| _|_|_|_| _|_|_| _| _| _| ' +echo +echo +echo '-------------------------------' +echo " https://$vst_ip:8083" +echo ' username: admin' +echo " password: $vpass" +echo '-------------------------------' +echo +echo +echo 'Congratulations,' +echo 'you have successfully installed Vesta Control Panel.' +echo +echo + +# Tricky way to get new PATH variable +cd +bash + +#EOF