/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/ubuntu/roundcube-pw.conf b/install/ubuntu/roundcube-pw.conf
new file mode 100644
index 000000000..0c82b1bc1
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/basedir.tpl b/install/ubuntu/templates/web/apache2/basedir.tpl
new file mode 100755
index 000000000..07ec38c98
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/default.stpl b/install/ubuntu/templates/web/apache2/default.stpl
new file mode 100755
index 000000000..da523c138
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/default.tpl b/install/ubuntu/templates/web/apache2/default.tpl
new file mode 100755
index 000000000..b95c1ee38
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/hosting.stpl b/install/ubuntu/templates/web/apache2/hosting.stpl
new file mode 100755
index 000000000..49af8fcef
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/hosting.tpl b/install/ubuntu/templates/web/apache2/hosting.tpl
new file mode 100755
index 000000000..8763b1a90
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/phpcgi.sh b/install/ubuntu/templates/web/apache2/phpcgi.sh
new file mode 100755
index 000000000..6565e103d
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/phpcgi.stpl b/install/ubuntu/templates/web/apache2/phpcgi.stpl
new file mode 100755
index 000000000..58c4baf90
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/phpcgi.tpl b/install/ubuntu/templates/web/apache2/phpcgi.tpl
new file mode 100755
index 000000000..21be2cdd7
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/phpfcgid.sh b/install/ubuntu/templates/web/apache2/phpfcgid.sh
new file mode 100755
index 000000000..e80582492
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/phpfcgid.stpl b/install/ubuntu/templates/web/apache2/phpfcgid.stpl
new file mode 100755
index 000000000..20a580093
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/apache2/phpfcgid.tpl b/install/ubuntu/templates/web/apache2/phpfcgid.tpl
new file mode 100755
index 000000000..72e7d8d44
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/awstats/awstats.tpl b/install/ubuntu/templates/web/awstats/awstats.tpl
new file mode 100755
index 000000000..274c5ed3f
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/awstats/index.tpl b/install/ubuntu/templates/web/awstats/index.tpl
new file mode 100755
index 000000000..9df9bb5cb
--- /dev/null
+++ b/install/ubuntu/templates/web/awstats/index.tpl
@@ -0,0 +1,10 @@
+
+
+
+ Awstats log analyzer
+
+
+
diff --git a/install/ubuntu/templates/web/awstats/nav.tpl b/install/ubuntu/templates/web/awstats/nav.tpl
new file mode 100755
index 000000000..f29bed68b
--- /dev/null
+++ b/install/ubuntu/templates/web/awstats/nav.tpl
@@ -0,0 +1,23 @@
+
+
+ Awstats navigation
+
+
+
+
+
+  |
+
+ |
+
+
+
+
diff --git a/install/ubuntu/templates/web/nginx/caching.stpl b/install/ubuntu/templates/web/nginx/caching.stpl
new file mode 100755
index 000000000..036dc6ee7
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/nginx/caching.tpl b/install/ubuntu/templates/web/nginx/caching.tpl
new file mode 100755
index 000000000..04e38d445
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/nginx/default.stpl b/install/ubuntu/templates/web/nginx/default.stpl
new file mode 100755
index 000000000..fa5380606
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/nginx/default.tpl b/install/ubuntu/templates/web/nginx/default.tpl
new file mode 100755
index 000000000..4d5c774bc
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/nginx/hosting.sh b/install/ubuntu/templates/web/nginx/hosting.sh
new file mode 100755
index 000000000..eeed37ef9
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/nginx/hosting.stpl b/install/ubuntu/templates/web/nginx/hosting.stpl
new file mode 100755
index 000000000..d778d6333
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/nginx/hosting.tpl b/install/ubuntu/templates/web/nginx/hosting.tpl
new file mode 100755
index 000000000..15961c95c
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 000000000..ae1956173
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/skel/document_errors/403.html b/install/ubuntu/templates/web/skel/document_errors/403.html
new file mode 100755
index 000000000..9c3f6baab
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/skel/document_errors/404.html b/install/ubuntu/templates/web/skel/document_errors/404.html
new file mode 100755
index 000000000..2cee77084
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/skel/document_errors/50x.html b/install/ubuntu/templates/web/skel/document_errors/50x.html
new file mode 100755
index 000000000..85ba648b7
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/skel/public_html/index.html b/install/ubuntu/templates/web/skel/public_html/index.html
new file mode 100755
index 000000000..4f5bb7244
--- /dev/null
+++ b/install/ubuntu/templates/web/skel/public_html/index.html
@@ -0,0 +1,26 @@
+
+
+ %domain% — Coming Soon
+
+
+
+
+
+
+ %domain%
+
+
+
+
+
diff --git a/install/ubuntu/templates/web/skel/public_html/robots.txt b/install/ubuntu/templates/web/skel/public_html/robots.txt
new file mode 100755
index 000000000..00ee83dcf
--- /dev/null
+++ b/install/ubuntu/templates/web/skel/public_html/robots.txt
@@ -0,0 +1,3 @@
+# vestacp autogenerated robots.txt
+User-agent: *
+Crawl-delay: 10
diff --git a/install/ubuntu/templates/web/skel/public_shtml/index.html b/install/ubuntu/templates/web/skel/public_shtml/index.html
new file mode 100755
index 000000000..4f5bb7244
--- /dev/null
+++ b/install/ubuntu/templates/web/skel/public_shtml/index.html
@@ -0,0 +1,26 @@
+
+
+ %domain% — Coming Soon
+
+
+
+
+
+
+ %domain%
+
+
+
+
+
diff --git a/install/ubuntu/templates/web/skel/public_shtml/robots.txt b/install/ubuntu/templates/web/skel/public_shtml/robots.txt
new file mode 100755
index 000000000..00ee83dcf
--- /dev/null
+++ b/install/ubuntu/templates/web/skel/public_shtml/robots.txt
@@ -0,0 +1,3 @@
+# vestacp autogenerated robots.txt
+User-agent: *
+Crawl-delay: 10
diff --git a/install/ubuntu/templates/web/suspend/.htaccess b/install/ubuntu/templates/web/suspend/.htaccess
new file mode 100755
index 000000000..5a6df83fb
--- /dev/null
+++ b/install/ubuntu/templates/web/suspend/.htaccess
@@ -0,0 +1,2 @@
+ErrorDocument 403 /index.html
+ErrorDocument 404 /index.html
diff --git a/install/ubuntu/templates/web/suspend/index.html b/install/ubuntu/templates/web/suspend/index.html
new file mode 100755
index 000000000..d5d299077
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/templates/web/webalizer/webalizer.tpl b/install/ubuntu/templates/web/webalizer/webalizer.tpl
new file mode 100755
index 000000000..2e4fee3f8
--- /dev/null
+++ b/install/ubuntu/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/ubuntu/vesta.conf b/install/ubuntu/vesta.conf
new file mode 100644
index 000000000..fd9e659ad
--- /dev/null
+++ b/install/ubuntu/vesta.conf
@@ -0,0 +1,21 @@
+WEB_SYSTEM='apache2'
+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/ubuntu/vesta.log b/install/ubuntu/vesta.log
new file mode 100644
index 000000000..027a34396
--- /dev/null
+++ b/install/ubuntu/vesta.log
@@ -0,0 +1,7 @@
+/usr/local/vesta/log/*.log {
+ missingok
+ notifempty
+ size 30k
+ yearly
+ create 0600 root root
+}
diff --git a/install/ubuntu/vsftpd.conf b/install/ubuntu/vsftpd.conf
new file mode 100644
index 000000000..89bc2480b
--- /dev/null
+++ b/install/ubuntu/vsftpd.conf
@@ -0,0 +1,21 @@
+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=YES
+tcp_wrappers=YES
+force_dot_files=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/ubuntu/whmcs-module.php b/install/ubuntu/whmcs-module.php
new file mode 100644
index 000000000..b3b1710ee
--- /dev/null
+++ b/install/ubuntu/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-ubuntu.sh b/install/vst-install-ubuntu.sh
new file mode 100644
index 000000000..93a6c40e2
--- /dev/null
+++ b/install/vst-install-ubuntu.sh
@@ -0,0 +1,779 @@
+#!/bin/bash
+
+# Vesta Ubuntu installer v.01
+
+#----------------------------------------------------------#
+# Variables&Functions #
+#----------------------------------------------------------#
+export PATH=$PATH:/sbin
+export DEBIAN_FRONTEND=noninteractive
+RHOST='apt.vestacp.com'
+CHOST='c.vestacp.com'
+REPO='raring'
+VERSION='0.9.8/ubuntu'
+arch=$(arch)
+os=$(head -n 1 /etc/issue | cut -f 1 -d ' ')
+release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' )
+codename=$(lsb_release -cs)
+memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
+software="nginx apache2 apache2-utils apache2.2-common apache2-suexec rrdtool
+ 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
+ apache2-suexec 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' ]; then
+ echo 'Error: sorry, this installer can work only on Debian or Ubuntu'
+ exit 1
+fi
+
+# Check supported OS
+if [ $os != 'Ubuntu' ] && [ $os != 'Debian' ]; then
+ echo 'Error: sorry, this installer can work only on Debian or Ubuntu'
+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 $REPO repository"
+ exit 1
+fi
+
+# Check installed packages
+tmpfile=$(mktemp -p /tmp)
+dpkg --get-selections > $tmpfile
+for pkg in exim4 bind9 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
+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_list=/etc/apt/sources.list
+check_nginx_repo=$(grep nginx.org $apt_list)
+if [ -z "$check_nginx_repo" ]; then
+ echo "deb http://nginx.org/packages/ubuntu/ $codename nginx" >> $apt_list
+ wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
+ apt-key add /tmp/nginx_signing.key
+fi
+
+# Install vesta repo
+check_vesta_repo=$(grep $RHOST $apt_list)
+if [ -z "$check_vesta_repo" ]; then
+ echo "deb http://$RHOST/ $codename free" >> $apt_list
+fi
+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/admin
+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
+ mv /usr/local/vesta/* $vst_backups/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
+
+# 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 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
+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 defaults
+ service clamav stop > /dev/null 2>&1
+ service clamav 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)" ] && [ "$force" = 'yes' ]; 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/?$REPO -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