/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
+// ----------------------------------
+include_once("/etc/roundcube/debian-db-roundcube.php");
+
+
+// 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/roundcube/';
+
+// use this folder to store temp files (must be writeable for apache user)
+$rcmail_config['temp_dir'] = '/tmp';
+
+// 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';
+
+// 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'] = 'Spam';
+
+// 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', 'Spam', 'Trash');
+$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Spam', 'Trash');
+
+// automatically create the above listed default folders on first login
+$rcmail_config['create_default_folders'] = true;
+
+// 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'] = true;
+
+// 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 30 seconds
+$rcmail_config['draft_autosave'] = 30;
+
+// 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'] = true;
+
+// 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/18.04/roundcube/vesta.php b/install/ubuntu/18.04/roundcube/vesta.php
new file mode 100644
index 00000000..99e1d4bc
--- /dev/null
+++ b/install/ubuntu/18.04/roundcube/vesta.php
@@ -0,0 +1,71 @@
+
+ */
+
+ function password_save($curpass, $passwd)
+ {
+ $rcmail = rcmail::get_instance();
+ $vesta_host = $rcmail->config->get('password_vesta_host');
+
+ if (empty($vesta_host))
+ {
+ $vesta_host = 'localhost';
+ }
+
+ $vesta_port = $rcmail->config->get('password_vesta_port');
+ if (empty($vesta_port))
+ {
+ $vesta_port = '8083';
+ }
+
+ $postvars = array(
+ 'email' => $_SESSION['username'],
+ 'password' => $curpass,
+ 'new' => $passwd
+ );
+
+ $postdata = http_build_query($postvars);
+
+ $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+ $send .= 'Host: ' . $vesta_host . PHP_EOL;
+ $send .= 'User-Agent: PHP Script' . PHP_EOL;
+ $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+ $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+ $send .= 'Connection: close' . PHP_EOL;
+ $send .= PHP_EOL;
+ $send .= $postdata . PHP_EOL . PHP_EOL;
+
+ //$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+ $errno = "";
+ $errstr = "";
+ $context = stream_context_create();
+ $result = stream_context_set_option($context, 'ssl', 'verify_peer', false);
+ $result = stream_context_set_option($context, 'ssl', 'verify_peer_name', false);
+ $result = stream_context_set_option($context, 'ssl', 'verify_host', false);
+ $result = stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
+
+ $fp = stream_socket_client('ssl://' . $vesta_host . ':'.$vesta_port, $errno, $errstr, 60, STREAM_CLIENT_CONNECT, $context);
+ fputs($fp, $send);
+ $result = fread($fp, 2048);
+ fclose($fp);
+
+ $fp = fopen("/tmp/roundcube.log", 'w');
+ fwrite($fp, "test ok");
+ fwrite($fp, "\n");
+ fclose($fp);
+
+
+ if(strpos($result, 'ok') && !strpos($result, 'error'))
+ {
+ return PASSWORD_SUCCESS;
+ }
+ else {
+ return PASSWORD_ERROR;
+ }
+
+ }
diff --git a/install/ubuntu/18.04/sudo/admin b/install/ubuntu/18.04/sudo/admin
new file mode 100644
index 00000000..4226bdd4
--- /dev/null
+++ b/install/ubuntu/18.04/sudo/admin
@@ -0,0 +1,8 @@
+# Created by vesta installer
+Defaults env_keep="VESTA"
+Defaults:admin !syslog
+Defaults:admin !requiretty
+Defaults:root !requiretty
+
+admin ALL=(ALL) ALL
+admin ALL=NOPASSWD:/usr/local/vesta/bin/*
diff --git a/install/ubuntu/18.04/templates/dns/child-ns.tpl b/install/ubuntu/18.04/templates/dns/child-ns.tpl
new file mode 100755
index 00000000..42c046e4
--- /dev/null
+++ b/install/ubuntu/18.04/templates/dns/child-ns.tpl
@@ -0,0 +1,14 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns1.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns2.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ns1' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='ns2' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='smtp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='imap' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ~all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='_dmarc' TYPE='TXT' PRIORITY='' VALUE='"v=DMARC1; p=none"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/18.04/templates/dns/default.tpl b/install/ubuntu/18.04/templates/dns/default.tpl
new file mode 100755
index 00000000..e0a37e62
--- /dev/null
+++ b/install/ubuntu/18.04/templates/dns/default.tpl
@@ -0,0 +1,18 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns3%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns4%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns5%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns6%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns7%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns8%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='smtp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='15' RECORD='imap' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='16' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='17' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ~all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='18' RECORD='_dmarc' TYPE='TXT' PRIORITY='' VALUE='"v=DMARC1; p=none"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/18.04/templates/dns/gmail.tpl b/install/ubuntu/18.04/templates/dns/gmail.tpl
new file mode 100755
index 00000000..219c9d24
--- /dev/null
+++ b/install/ubuntu/18.04/templates/dns/gmail.tpl
@@ -0,0 +1,12 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ALT3.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ALT4.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% include:_spf.google.com ~all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/18.04/templates/web/apache2/basedir.stpl b/install/ubuntu/18.04/templates/web/apache2/basedir.stpl
new file mode 100644
index 00000000..d978d4c4
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/basedir.stpl
@@ -0,0 +1,44 @@
+
+
+ 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%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
+
+
+ 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%
+
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/basedir.tpl b/install/ubuntu/18.04/templates/web/apache2/basedir.tpl
new file mode 100644
index 00000000..96c94a1b
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/basedir.tpl
@@ -0,0 +1,38 @@
+
+
+ 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%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
+
+
+ AllowOverride All
+
+
+
+ RMode config
+ RUidGid %user% %group%
+ RGroups www-data
+
+
+ AssignUserID %user% %group%
+
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/default.stpl b/install/ubuntu/18.04/templates/web/apache2/default.stpl
new file mode 100644
index 00000000..ec34c279
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/default.stpl
@@ -0,0 +1,43 @@
+
+
+ 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 %sdocroot%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+
+
+ 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%
+
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/default.tpl b/install/ubuntu/18.04/templates/web/apache2/default.tpl
new file mode 100644
index 00000000..3a227015
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/default.tpl
@@ -0,0 +1,37 @@
+
+
+ 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%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+
+
+ AllowOverride All
+
+
+
+ RMode config
+ RUidGid %user% %group%
+ RGroups www-data
+
+
+ AssignUserID %user% %group%
+
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/hosting.stpl b/install/ubuntu/18.04/templates/web/apache2/hosting.stpl
new file mode 100644
index 00000000..8892072b
--- /dev/null
+++ b/install/ubuntu/18.04/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_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 sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
+ php_admin_value open_basedir %docroot%:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+
+
+ 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%
+
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/hosting.tpl b/install/ubuntu/18.04/templates/web/apache2/hosting.tpl
new file mode 100644
index 00000000..1eb26910
--- /dev/null
+++ b/install/ubuntu/18.04/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_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 sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
+ php_admin_value open_basedir %docroot%:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+
+
+ AllowOverride All
+
+
+ RMode config
+ RUidGid %user% %group%
+ RGroups www-data
+
+
+ AssignUserID %user% %group%
+
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/phpcgi.sh b/install/ubuntu/18.04/templates/web/apache2/phpcgi.sh
new file mode 100755
index 00000000..6565e103
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/apache2/phpcgi.stpl b/install/ubuntu/18.04/templates/web/apache2/phpcgi.stpl
new file mode 100644
index 00000000..731355bc
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/phpcgi.stpl
@@ -0,0 +1,38 @@
+
+
+ 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
+ php_admin_value open_basedir %docroot%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+ 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%
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/phpcgi.tpl b/install/ubuntu/18.04/templates/web/apache2/phpcgi.tpl
new file mode 100644
index 00000000..c6796d29
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/phpcgi.tpl
@@ -0,0 +1,31 @@
+
+
+ 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%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+ Action phpcgi-script /cgi-bin/php
+
+ SetHandler phpcgi-script
+
+
+
+ AllowOverride All
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/phpfcgid.sh b/install/ubuntu/18.04/templates/web/apache2/phpfcgid.sh
new file mode 100755
index 00000000..e8058249
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/apache2/phpfcgid.stpl b/install/ubuntu/18.04/templates/web/apache2/phpfcgid.stpl
new file mode 100644
index 00000000..156c8a91
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/phpfcgid.stpl
@@ -0,0 +1,39 @@
+
+
+ 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
+ php_admin_value open_basedir %docroot%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+
+ 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%
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/apache2/phpfcgid.tpl b/install/ubuntu/18.04/templates/web/apache2/phpfcgid.tpl
new file mode 100644
index 00000000..a4c01269
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/apache2/phpfcgid.tpl
@@ -0,0 +1,31 @@
+
+
+ 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%:%home%/%user%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/tmp
+ php_admin_value session.save_path %home%/%user%/tmp
+
+ SetHandler fcgid-script
+
+ FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
+
+
+ AllowOverride All
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/awstats/awstats.tpl b/install/ubuntu/18.04/templates/web/awstats/awstats.tpl
new file mode 100755
index 00000000..9a92e0fd
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/awstats/awstats.tpl
@@ -0,0 +1,133 @@
+LogFile="/var/log/%web_system%/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/18.04/templates/web/awstats/index.tpl b/install/ubuntu/18.04/templates/web/awstats/index.tpl
new file mode 100755
index 00000000..9df9bb5c
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/awstats/index.tpl
@@ -0,0 +1,10 @@
+
+
+
+ Awstats log analyzer
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/awstats/nav.tpl b/install/ubuntu/18.04/templates/web/awstats/nav.tpl
new file mode 100755
index 00000000..f29bed68
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/awstats/nav.tpl
@@ -0,0 +1,23 @@
+
+
+ Awstats navigation
+
+
+
+
+
+  |
+
+ |
+
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/nginx/caching.sh b/install/ubuntu/18.04/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..09d8efe7
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/caching.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+conf='/etc/nginx/conf.d/01_caching_pool.conf'
+if [ -e "$conf" ]; then
+ if [ -z "$(grep "=${domain}:" $conf)" ]; then
+ echo "$str" >> $conf
+ fi
+else
+ echo "$str" >> $conf
+fi
+
diff --git a/install/ubuntu/18.04/templates/web/nginx/caching.stpl b/install/ubuntu/18.04/templates/web/nginx/caching.stpl
new file mode 100755
index 00000000..5e0e4064
--- /dev/null
+++ b/install/ubuntu/18.04/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 https://%ip%:%web_ssl_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 %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/18.04/templates/web/nginx/caching.tpl b/install/ubuntu/18.04/templates/web/nginx/caching.tpl
new file mode 100755
index 00000000..36761b65
--- /dev/null
+++ b/install/ubuntu/18.04/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/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/default.stpl b/install/ubuntu/18.04/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/nginx/default.tpl b/install/ubuntu/18.04/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/nginx/hosting.sh b/install/ubuntu/18.04/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/nginx/hosting.stpl b/install/ubuntu/18.04/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/nginx/hosting.tpl b/install/ubuntu/18.04/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/nginx/http2.stpl b/install/ubuntu/18.04/templates/web/nginx/http2.stpl
new file mode 100644
index 00000000..76dd2f8e
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/http2.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port% http2;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/httpd/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/httpd/domains/%domain%.log combined;
+ access_log /var/log/httpd/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/18.04/templates/web/nginx/http2.tpl b/install/ubuntu/18.04/templates/web/nginx/http2.tpl
new file mode 100644
index 00000000..c1fec114
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/http2.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/httpd/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/httpd/domains/%domain%.log combined;
+ access_log /var/log/httpd/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/18.04/templates/web/nginx/php-fpm/cms_made_simple.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..d85bcce3
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/cms_made_simple.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/cms_made_simple.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..f9e90393
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/cms_made_simple.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter2.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..9c24c3ea
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter2.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter2.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..d2422be2
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter2.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter3.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..d7186314
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter3.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter3.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..54f81b99
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/codeigniter3.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/datalife_engine.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..4f0b9ec7
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/datalife_engine.stpl
@@ -0,0 +1,127 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/datalife_engine.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..3ea45347
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/datalife_engine.tpl
@@ -0,0 +1,123 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/default.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/default.stpl
new file mode 100644
index 00000000..5cb55311
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/default.stpl
@@ -0,0 +1,55 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/default.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/default.tpl
new file mode 100644
index 00000000..a8909efb
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/default.tpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/dokuwiki.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..f85032ba
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/dokuwiki.stpl
@@ -0,0 +1,72 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/dokuwiki.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..0a9a75ed
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/dokuwiki.tpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal6.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal6.stpl
new file mode 100644
index 00000000..91a70936
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal6.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal6.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal6.tpl
new file mode 100644
index 00000000..ac32dcd9
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal6.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal7.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal7.stpl
new file mode 100644
index 00000000..3b9dabf5
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal7.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal7.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal7.tpl
new file mode 100644
index 00000000..1b979475
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal7.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal8.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal8.stpl
new file mode 100644
index 00000000..50d85b68
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal8.stpl
@@ -0,0 +1,102 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$)|^/update.php {
+ fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal8.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal8.tpl
new file mode 100644
index 00000000..71b538bf
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/drupal8.tpl
@@ -0,0 +1,99 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$)|^/update.php {
+ fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/joomla.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/joomla.stpl
new file mode 100644
index 00000000..704405f3
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/joomla.stpl
@@ -0,0 +1,63 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/joomla.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/joomla.tpl
new file mode 100644
index 00000000..91b7a8f1
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/joomla.tpl
@@ -0,0 +1,59 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/laravel.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/laravel.stpl
new file mode 100644
index 00000000..477f6f01
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/laravel.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%/public;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$query_string;
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/laravel.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/laravel.tpl
new file mode 100644
index 00000000..d14b0173
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/laravel.tpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%/public;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+ location / {
+ try_files $uri $uri/ /index.php?$query_string;
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/magento.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/magento.stpl
new file mode 100644
index 00000000..fdab43aa
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/magento.stpl
@@ -0,0 +1,198 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+
+ root %sdocroot%/pub;
+ index index.php;
+ autoindex off;
+ charset UTF-8;
+ error_page 404 403 = /errors/404.php;
+ add_header "X-UA-Compatible" "IE=Edge";
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ # PHP entry point for setup application
+ location ~* ^/setup($|/) {
+ root %sdocroot%;
+
+ location ~ ^/setup/index.php {
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ location ~ ^/setup/(?!pub/). {
+ deny all;
+ }
+
+ location ~ ^/setup/pub/ {
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+ }
+
+ # PHP entry point for update application
+ location ~* ^/update($|/) {
+ root %sdocroot%;
+
+ location ~ ^/update/index.php {
+ fastcgi_split_path_info ^(/update/index.php)(/.+)$;
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ # Deny everything but index.php
+ location ~ ^/update/(?!pub/). {
+ deny all;
+ }
+
+ location ~ ^/update/pub/ {
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ }
+
+ location /pub/ {
+ location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
+ deny all;
+ }
+
+ alias %sdocroot%/pub/;
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+
+ location /static/ {
+ # Uncomment the following line in production mode
+ # expires max;
+
+ # Remove signature of the static files that is used to overcome the browser cache
+ location ~ ^/static/version {
+ rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
+ }
+
+ location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
+ add_header Cache-Control "public";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires +1y;
+
+ if (!-f $request_filename) {
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
+ }
+ }
+
+ location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
+ add_header Cache-Control "no-store";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires off;
+
+ if (!-f $request_filename) {
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
+ }
+ }
+
+ if (!-f $request_filename) {
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
+ }
+
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+
+ location /media/ {
+ try_files $uri $uri/ /get.php?$args;
+
+ location ~ ^/media/theme_customization/.*\.xml {
+ deny all;
+ }
+
+ location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
+ add_header Cache-Control "public";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires +1y;
+ try_files $uri $uri/ /get.php?$args;
+ }
+
+ location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
+ add_header Cache-Control "no-store";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires off;
+ try_files $uri $uri/ /get.php?$args;
+ }
+
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+
+ location /media/customer/ {
+ deny all;
+ }
+
+ location /media/downloadable/ {
+ deny all;
+ }
+
+ location /media/import/ {
+ deny all;
+ }
+
+ # PHP entry point for main application
+ location ~ (index|get|static|report|404|503)\.php$ {
+ try_files $uri =404;
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_buffers 1024 4k;
+ fastcgi_read_timeout 600s;
+ fastcgi_connect_timeout 600s;
+
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ gzip on;
+ gzip_disable "msie6";
+
+ gzip_comp_level 6;
+ gzip_min_length 1100;
+ gzip_buffers 16 8k;
+ gzip_proxied any;
+ gzip_types
+ text/plain
+ text/css
+ text/js
+ text/xml
+ text/javascript
+ application/javascript
+ application/x-javascript
+ application/json
+ application/xml
+ application/xml+rss
+ image/svg+xml;
+ gzip_vary on;
+
+ # Banned locations (only reached if the earlier PHP entry point regexes don't match)
+ location ~* (\.php$|\.htaccess$|\.git) {
+ deny all;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/magento.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/magento.tpl
new file mode 100644
index 00000000..3f292fff
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/magento.tpl
@@ -0,0 +1,194 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+
+ root %docroot%/pub;
+ index index.php;
+ autoindex off;
+ charset UTF-8;
+ error_page 404 403 = /errors/404.php;
+ add_header "X-UA-Compatible" "IE=Edge";
+
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ # PHP entry point for setup application
+ location ~* ^/setup($|/) {
+ root %docroot%;
+
+ location ~ ^/setup/index.php {
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ location ~ ^/setup/(?!pub/). {
+ deny all;
+ }
+
+ location ~ ^/setup/pub/ {
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+ }
+
+ # PHP entry point for update application
+ location ~* ^/update($|/) {
+ root %docroot%;
+
+ location ~ ^/update/index.php {
+ fastcgi_split_path_info ^(/update/index.php)(/.+)$;
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ # Deny everything but index.php
+ location ~ ^/update/(?!pub/). {
+ deny all;
+ }
+
+ location ~ ^/update/pub/ {
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ }
+
+ location /pub/ {
+ location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
+ deny all;
+ }
+
+ alias %docroot%/pub/;
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+
+ location /static/ {
+ # Uncomment the following line in production mode
+ # expires max;
+
+ # Remove signature of the static files that is used to overcome the browser cache
+ location ~ ^/static/version {
+ rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
+ }
+
+ location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
+ add_header Cache-Control "public";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires +1y;
+
+ if (!-f $request_filename) {
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
+ }
+ }
+
+ location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
+ add_header Cache-Control "no-store";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires off;
+
+ if (!-f $request_filename) {
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
+ }
+ }
+
+ if (!-f $request_filename) {
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
+ }
+
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+
+ location /media/ {
+ try_files $uri $uri/ /get.php?$args;
+
+ location ~ ^/media/theme_customization/.*\.xml {
+ deny all;
+ }
+
+ location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
+ add_header Cache-Control "public";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires +1y;
+ try_files $uri $uri/ /get.php?$args;
+ }
+
+ location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
+ add_header Cache-Control "no-store";
+ add_header X-Frame-Options "SAMEORIGIN";
+ expires off;
+ try_files $uri $uri/ /get.php?$args;
+ }
+
+ add_header X-Frame-Options "SAMEORIGIN";
+ }
+
+ location /media/customer/ {
+ deny all;
+ }
+
+ location /media/downloadable/ {
+ deny all;
+ }
+
+ location /media/import/ {
+ deny all;
+ }
+
+ # PHP entry point for main application
+ location ~ (index|get|static|report|404|503)\.php$ {
+ try_files $uri =404;
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_buffers 1024 4k;
+ fastcgi_read_timeout 600s;
+ fastcgi_connect_timeout 600s;
+
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ gzip on;
+ gzip_disable "msie6";
+
+ gzip_comp_level 6;
+ gzip_min_length 1100;
+ gzip_buffers 16 8k;
+ gzip_proxied any;
+ gzip_types
+ text/plain
+ text/css
+ text/js
+ text/xml
+ text/javascript
+ application/javascript
+ application/x-javascript
+ application/json
+ application/xml
+ application/xml+rss
+ image/svg+xml;
+ gzip_vary on;
+
+ # Banned locations (only reached if the earlier PHP entry point regexes don't match)
+ location ~* (\.php$|\.htaccess$|\.git) {
+ deny all;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/modx.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/modx.stpl
new file mode 100644
index 00000000..f410ab77
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/modx.stpl
@@ -0,0 +1,69 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+# if you need to rewrite www to non-www uncomment bellow
+# if ($host != '%domain%' ) {
+# rewrite ^/(.*)$ https://%domain%/$1 permanent;
+# }
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ @rewrite;
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+ location @rewrite {
+ rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ \.php$ {
+ try_files $uri =404;
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/modx.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/modx.tpl
new file mode 100644
index 00000000..342d3ecf
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/modx.tpl
@@ -0,0 +1,65 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+# if you need to rewrite www to non-www uncomment bellow
+# if ($host != '%domain%' ) {
+# rewrite ^/(.*)$ http://%domain%/$1 permanent;
+# }
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ @rewrite;
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+ location @rewrite {
+ rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ \.php$ {
+ try_files $uri =404;
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/moodle.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/moodle.stpl
new file mode 100644
index 00000000..f15a68c5
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/moodle.stpl
@@ -0,0 +1,90 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ rewrite ^/(.*\.php)(/)(.*)$ /$1?file=/$3 last;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/moodle.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/moodle.tpl
new file mode 100644
index 00000000..c20ba648
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/moodle.tpl
@@ -0,0 +1,87 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ rewrite ^/(.*\.php)(/)(.*)$ /$1?file=/$3 last;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/no-php.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/no-php.stpl
new file mode 100644
index 00000000..bc8b53a3
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/no-php.stpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/no-php.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/no-php.tpl
new file mode 100644
index 00000000..7ff8aa1d
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/no-php.tpl
@@ -0,0 +1,43 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/odoo.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/odoo.stpl
new file mode 100644
index 00000000..d6697d7a
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/odoo.stpl
@@ -0,0 +1,70 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
+ proxy_redirect off;
+
+ proxy_set_header X-Forwarded-Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Real-IP $remote_addr;
+
+ proxy_connect_timeout 720;
+ proxy_send_timeout 720;
+ proxy_read_timeout 720;
+ send_timeout 720;
+
+ # Allow "Well-Known URIs" as per RFC 5785
+ location ~* ^/.well-known/ {
+ allow all;
+ }
+
+ location / {
+ proxy_pass http://127.0.0.1:8069;
+ }
+
+ location /longpolling {
+ proxy_pass http://127.0.0.1:8072;
+ }
+
+ location ~* /web/static/ {
+ proxy_cache_valid 200 60m;
+ proxy_buffering on;
+ expires 864000;
+ proxy_pass http://127.0.0.1:8069;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/odoo.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/odoo.tpl
new file mode 100644
index 00000000..b1240aae
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/odoo.tpl
@@ -0,0 +1,66 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
+ proxy_redirect off;
+
+ proxy_set_header X-Forwarded-Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Real-IP $remote_addr;
+
+ proxy_connect_timeout 720;
+ proxy_send_timeout 720;
+ proxy_read_timeout 720;
+ send_timeout 720;
+
+ # Allow "Well-Known URIs" as per RFC 5785
+ location ~* ^/.well-known/ {
+ allow all;
+ }
+
+ location / {
+ proxy_pass http://127.0.0.1:8069;
+ }
+
+ location /longpolling {
+ proxy_pass http://127.0.0.1:8072;
+ }
+
+ location ~* /web/static/ {
+ proxy_cache_valid 200 60m;
+ proxy_buffering on;
+ expires 864000;
+ proxy_pass http://127.0.0.1:8069;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/opencart.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/opencart.stpl
new file mode 100644
index 00000000..908b9aeb
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/opencart.stpl
@@ -0,0 +1,59 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ @opencart;
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @opencart {
+ rewrite ^/(.+)$ /index.php?_route_=$1 last;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/opencart.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/opencart.tpl
new file mode 100644
index 00000000..d0a9060b
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/opencart.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+ location / {
+ try_files $uri $uri/ @opencart;
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @opencart {
+ rewrite ^/(.+)$ /index.php?_route_=$1 last;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/owncloud.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/owncloud.stpl
new file mode 100644
index 00000000..891566b9
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/owncloud.stpl
@@ -0,0 +1,85 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/owncloud.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/owncloud.tpl
new file mode 100644
index 00000000..e3ec31de
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/owncloud.tpl
@@ -0,0 +1,81 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/piwik.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/piwik.stpl
new file mode 100644
index 00000000..78c1bb78
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/piwik.stpl
@@ -0,0 +1,73 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/piwik.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/piwik.tpl
new file mode 100644
index 00000000..f94fb7de
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/piwik.tpl
@@ -0,0 +1,69 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.stpl
new file mode 100644
index 00000000..5ffc9ed5
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -0,0 +1,66 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%/public;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php?$query_string;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.tpl
new file mode 100644
index 00000000..297fe0e8
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%/public;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php?$query_string;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/sendy.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/sendy.stpl
new file mode 100644
index 00000000..0b351000
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/sendy.stpl
@@ -0,0 +1,88 @@
+server {
+ listen %ip%:%web_ssl_port% ssl http2;
+ server_name %domain_idn% %alias_idn%;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* "/\.(htaccess|htpasswd|git|svn|DS_Store)$" {
+ deny all;
+ }
+
+ location ~ /(readme.html|license.txt) {
+ deny all;
+ }
+
+ if (!-f $request_filename){
+ rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar|pdf)$ {
+ expires 1d;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ try_files $uri =404;
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ location /l/ {
+ rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
+ }
+
+ location /t/ {
+ rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
+ }
+
+ location /w/ {
+ rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
+ }
+
+ location /unsubscribe/ {
+ rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
+ }
+
+ location /subscribe/ {
+ rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/web/%domain%/stats/auth.conf*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/sendy.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/sendy.tpl
new file mode 100644
index 00000000..b27b427d
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/sendy.tpl
@@ -0,0 +1,86 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* "/\.(htaccess|htpasswd|git|svn|DS_Store)$" {
+ deny all;
+ }
+
+ location ~ /(readme.html|license.txt) {
+ deny all;
+ }
+
+ if (!-f $request_filename){
+ rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar|pdf)$ {
+ expires 1d;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ try_files $uri =404;
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+
+ location /l/ {
+ rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
+ }
+
+ location /t/ {
+ rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
+ }
+
+ location /w/ {
+ rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
+ }
+
+ location /unsubscribe/ {
+ rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
+ }
+
+ location /subscribe/ {
+ rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/web/%domain%/stats/auth.conf*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress.stpl
new file mode 100644
index 00000000..5cb55311
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress.stpl
@@ -0,0 +1,55 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress.tpl
new file mode 100644
index 00000000..a8909efb
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress.tpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2.stpl
new file mode 100644
index 00000000..e0aeb524
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2.tpl
new file mode 100644
index 00000000..bccb8b3d
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2.tpl
@@ -0,0 +1,63 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2_rewrite.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2_rewrite.stpl
new file mode 100644
index 00000000..0d933b30
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2_rewrite.stpl
@@ -0,0 +1,72 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ if (!-e $request_filename)
+ {
+ rewrite ^(.+)$ /index.php?q=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/web/%domain%/stats/auth.conf*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2_rewrite.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2_rewrite.tpl
new file mode 100644
index 00000000..39e366b7
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/wordpress2_rewrite.tpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ if (!-e $request_filename)
+ {
+ rewrite ^(.+)$ /index.php?q=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/web/%domain%/stats/auth.conf*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
+}
diff --git a/install/ubuntu/18.04/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/18.04/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/php-fpm/default.tpl b/install/ubuntu/18.04/templates/web/php-fpm/default.tpl
new file mode 100644
index 00000000..209e1e43
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/php-fpm/default.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = ondemand
+pm.max_children = 4
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/%user%/tmp
+php_admin_value[session.save_path] = /home/%user%/tmp
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/%user%/tmp
+env[TMPDIR] = /home/%user%/tmp
+env[TEMP] = /home/%user%/tmp
diff --git a/install/ubuntu/18.04/templates/web/php-fpm/no-php.tpl b/install/ubuntu/18.04/templates/web/php-fpm/no-php.tpl
new file mode 100644
index 00000000..047c33ed
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/php-fpm/no-php.tpl
@@ -0,0 +1,20 @@
+;[%backend%]
+;listen = /dev/null
+
+;user = %user%
+;group = %user%
+
+;listen.owner = %user%
+;listen.group = www-data
+
+;pm = ondemand
+;pm.max_children = 4
+;pm.max_requests = 4000
+;pm.process_idle_timeout = 10s
+;pm.status_path = /status
+
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /home/%user%/tmp
+;env[TMPDIR] = /home/%user%/tmp
+;env[TEMP] = /home/%user%/tmp
diff --git a/install/ubuntu/18.04/templates/web/php-fpm/socket.tpl b/install/ubuntu/18.04/templates/web/php-fpm/socket.tpl
new file mode 100644
index 00000000..a0151084
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/php-fpm/socket.tpl
@@ -0,0 +1,24 @@
+[%backend%]
+listen = /var/run/php/%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = www-data
+
+pm = ondemand
+pm.max_children = 4
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/%user%/tmp
+php_admin_value[session.save_path] = /home/%user%/tmp
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/%user%/tmp
+env[TMPDIR] = /home/%user%/tmp
+env[TEMP] = /home/%user%/tmp
diff --git a/install/ubuntu/18.04/templates/web/skel/document_errors/403.html b/install/ubuntu/18.04/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/skel/document_errors/404.html b/install/ubuntu/18.04/templates/web/skel/document_errors/404.html
new file mode 100755
index 00000000..2cee7708
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/skel/document_errors/50x.html b/install/ubuntu/18.04/templates/web/skel/document_errors/50x.html
new file mode 100755
index 00000000..85ba648b
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/skel/public_html/index.html b/install/ubuntu/18.04/templates/web/skel/public_html/index.html
new file mode 100755
index 00000000..4f5bb724
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/skel/public_html/index.html
@@ -0,0 +1,26 @@
+
+
+ %domain% — Coming Soon
+
+
+
+
+
+
+ %domain%
+
+
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/skel/public_html/robots.txt b/install/ubuntu/18.04/templates/web/skel/public_html/robots.txt
new file mode 100755
index 00000000..00ee83dc
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/skel/public_shtml/index.html b/install/ubuntu/18.04/templates/web/skel/public_shtml/index.html
new file mode 100755
index 00000000..4f5bb724
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/skel/public_shtml/index.html
@@ -0,0 +1,26 @@
+
+
+ %domain% — Coming Soon
+
+
+
+
+
+
+ %domain%
+
+
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/skel/public_shtml/robots.txt b/install/ubuntu/18.04/templates/web/skel/public_shtml/robots.txt
new file mode 100755
index 00000000..00ee83dc
--- /dev/null
+++ b/install/ubuntu/18.04/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/18.04/templates/web/suspend/.htaccess b/install/ubuntu/18.04/templates/web/suspend/.htaccess
new file mode 100755
index 00000000..5a6df83f
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/suspend/.htaccess
@@ -0,0 +1,2 @@
+ErrorDocument 403 /index.html
+ErrorDocument 404 /index.html
diff --git a/install/ubuntu/18.04/templates/web/suspend/index.html b/install/ubuntu/18.04/templates/web/suspend/index.html
new file mode 100755
index 00000000..f2d04e1f
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/suspend/index.html
@@ -0,0 +1,25 @@
+
+
+ Website Suspended
+
+
+
+
+
+ SUSPENDED
+ This website has been suspended.
+
+ Please contact the technical support department.
+
+
+
diff --git a/install/ubuntu/18.04/templates/web/webalizer/webalizer.tpl b/install/ubuntu/18.04/templates/web/webalizer/webalizer.tpl
new file mode 100755
index 00000000..068adcfb
--- /dev/null
+++ b/install/ubuntu/18.04/templates/web/webalizer/webalizer.tpl
@@ -0,0 +1,110 @@
+HostName %domain_idn%
+LogFile /var/log/%web_system%/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/18.04/vsftpd/vsftpd.conf b/install/ubuntu/18.04/vsftpd/vsftpd.conf
new file mode 100644
index 00000000..75e0104f
--- /dev/null
+++ b/install/ubuntu/18.04/vsftpd/vsftpd.conf
@@ -0,0 +1,40 @@
+anonymous_enable=NO
+local_enable=YES
+write_enable=YES
+local_umask=022
+anon_umask=022
+anon_upload_enable=NO
+dirmessage_enable=YES
+xferlog_enable=YES
+connect_from_port_20=YES
+xferlog_std_format=YES
+dual_log_enable=YES
+chroot_local_user=YES
+listen=YES
+pam_service_name=vsftpd
+userlist_enable=NO
+tcp_wrappers=YES
+force_dot_files=YES
+ascii_upload_enable=YES
+ascii_download_enable=YES
+allow_writeable_chroot=YES
+seccomp_sandbox=NO
+pasv_enable=YES
+pasv_promiscuous=YES
+pasv_min_port=12000
+pasv_max_port=12100
+max_per_ip=10
+max_clients=100
+use_localtime=YES
+utf8_filesystem=YES
+ssl_enable=YES
+allow_anon_ssl=NO
+require_ssl_reuse=NO
+ssl_ciphers=HIGH
+ssl_tlsv1=YES
+ssl_sslv2=NO
+ssl_sslv3=NO
+force_local_data_ssl=NO
+force_local_logins_ssl=NO
+rsa_cert_file=/usr/local/vesta/ssl/certificate.crt
+rsa_private_key_file=/usr/local/vesta/ssl/certificate.key
diff --git a/install/vst-install-amazon.sh b/install/vst-install-amazon.sh
new file mode 100644
index 00000000..f1fe62c7
--- /dev/null
+++ b/install/vst-install-amazon.sh
@@ -0,0 +1,1379 @@
+#!/bin/bash
+
+# Vesta Amazon installer v.05
+
+#----------------------------------------------------------#
+# Variables&Functions #
+#----------------------------------------------------------#
+export PATH=$PATH:/sbin
+RHOST='r.vestacp.com'
+CHOST='c.vestacp.com'
+REPO='cmmnt'
+VERSION='rhel'
+VESTA='/usr/local/vesta'
+memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
+arch=$(uname -i)
+os='rhel'
+release='6'
+codename="${os}_$release"
+vestacp="$VESTA/install/$VERSION/$release"
+
+software="nginx httpd mod_ssl mod_ruid2 mod_fcgid mod_extract_forwarded
+ php php-common php-cli php-bcmath php-gd php-imap php-mbstring php-mcrypt
+ php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-fpm php-pgsql
+ awstats webalizer vsftpd proftpd bind bind-utils bind-libs exim dovecot
+ clamd spamassassin mysql mysql-server phpMyAdmin postgresql
+ postgresql-server postgresql-contrib phpPgAdmin e2fsprogs openssh-clients
+ ImageMagick curl mc screen ftp zip unzip flex sqlite pcre sudo bc jwhois
+ mailx lsof tar telnet rrdtool net-tools ntp GeoIP freetype fail2ban
+ which vesta vesta-nginx vesta-php vim-common expect vesta-ioncube
+ vesta-softaculous"
+
+# Defining help function
+help() {
+ echo "Usage: $0 [OPTIONS]
+ -a, --apache Install Apache [yes|no] default: yes
+ -n, --nginx Install Nginx [yes|no] default: yes
+ -w, --phpfpm Install PHP-FPM [yes|no] default: no
+ -v, --vsftpd Install Vsftpd [yes|no] default: yes
+ -j, --proftpd Install ProFTPD [yes|no] default: no
+ -k, --named Install Bind [yes|no] default: yes
+ -m, --mysql Install MySQL [yes|no] default: yes
+ -g, --postgresql Install PostgreSQL [yes|no] default: no
+ -d, --mongodb Install MongoDB [yes|no] unsupported
+ -x, --exim Install Exim [yes|no] default: yes
+ -z, --dovecot Install Dovecot [yes|no] default: yes
+ -c, --clamav Install ClamAV [yes|no] default: yes
+ -t, --spamassassin Install SpamAssassin [yes|no] default: yes
+ -i, --iptables Install Iptables [yes|no] default: yes
+ -b, --fail2ban Install Fail2ban [yes|no] default: yes
+ -r, --remi Install Remi repo [yes|no] default: yes
+ -o, --softaculous Install Softaculous [yes|no] default: yes
+ -q, --quota Filesystem Quota [yes|no] default: no
+ -l, --lang Default language default: en
+ -y, --interactive Interactive install [yes|no] default: yes
+ -s, --hostname Set hostname
+ -e, --email Set admin email
+ -p, --password Set admin password
+ -f, --force Force installation
+ -h, --help Print this help
+
+ Example: bash $0 -e demo@vestacp.com -p p4ssw0rd --apache no --phpfpm yes"
+ exit 1
+}
+
+# Defining password-gen function
+gen_pass() {
+ MATRIX='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
+ LENGTH=10
+ while [ ${n:=1} -le $LENGTH ]; do
+ PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}"
+ let n+=1
+ done
+ echo "$PASS"
+}
+
+# Defining return code check function
+check_result() {
+ if [ $1 -ne 0 ]; then
+ echo "Error: $2"
+ exit $1
+ fi
+}
+
+# Defining function to set default value
+set_default_value() {
+ eval variable=\$$1
+ if [ -z "$variable" ]; then
+ eval $1=$2
+ fi
+ if [ "$variable" != 'yes' ] && [ "$variable" != 'no' ]; then
+ eval $1=$2
+ fi
+}
+
+# Define function to set default language value
+set_default_lang() {
+ if [ -z "$lang" ]; then
+ eval lang=$1
+ fi
+ lang_list="
+ ar cz el fa hu ja no pt se ua
+ bs da en fi id ka pl ro tr vi
+ cn de es fr it nl pt-BR ru tw
+ bg ko sr th ur"
+ if !(echo $lang_list |grep -w $lang 1>&2>/dev/null); then
+ eval lang=$1
+ fi
+}
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+# Creating temporary file
+tmpfile=$(mktemp -p /tmp)
+
+# Translating argument to --gnu-long-options
+for arg; do
+ delim=""
+ case "$arg" in
+ --apache) args="${args}-a " ;;
+ --nginx) args="${args}-n " ;;
+ --phpfpm) args="${args}-w " ;;
+ --vsftpd) args="${args}-v " ;;
+ --proftpd) args="${args}-j " ;;
+ --named) args="${args}-k " ;;
+ --mysql) args="${args}-m " ;;
+ --postgresql) args="${args}-g " ;;
+ --mongodb) args="${args}-d " ;;
+ --exim) args="${args}-x " ;;
+ --dovecot) args="${args}-z " ;;
+ --clamav) args="${args}-c " ;;
+ --spamassassin) args="${args}-t " ;;
+ --iptables) args="${args}-i " ;;
+ --fail2ban) args="${args}-b " ;;
+ --remi) args="${args}-r " ;;
+ --softaculous) args="${args}-o " ;;
+ --quota) args="${args}-q " ;;
+ --lang) args="${args}-l " ;;
+ --interactive) args="${args}-y " ;;
+ --hostname) args="${args}-s " ;;
+ --email) args="${args}-e " ;;
+ --password) args="${args}-p " ;;
+ --force) args="${args}-f " ;;
+ --help) args="${args}-h " ;;
+ *) [[ "${arg:0:1}" == "-" ]] || delim="\""
+ args="${args}${delim}${arg}${delim} ";;
+ esac
+done
+eval set -- "$args"
+
+# Parsing arguments
+while getopts "a:n:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:fh" Option; do
+ case $Option in
+ a) apache=$OPTARG ;; # Apache
+ n) nginx=$OPTARG ;; # Nginx
+ w) phpfpm=$OPTARG ;; # PHP-FPM
+ v) vsftpd=$OPTARG ;; # Vsftpd
+ j) proftpd=$OPTARG ;; # Proftpd
+ k) named=$OPTARG ;; # Named
+ m) mysql=$OPTARG ;; # MySQL
+ g) postgresql=$OPTARG ;; # PostgreSQL
+ d) mongodb=$OPTARG ;; # MongoDB (unsupported)
+ x) exim=$OPTARG ;; # Exim
+ z) dovecot=$OPTARG ;; # Dovecot
+ c) clamd=$OPTARG ;; # ClamAV
+ t) spamd=$OPTARG ;; # SpamAssassin
+ i) iptables=$OPTARG ;; # Iptables
+ b) fail2ban=$OPTARG ;; # Fail2ban
+ r) remi=$OPTARG ;; # Remi repo
+ o) softaculous=$OPTARG ;; # Softaculous plugin
+ q) quota=$OPTARG ;; # FS Quota
+ l) lang=$OPTARG ;; # Language
+ y) interactive=$OPTARG ;; # Interactive install
+ s) servername=$OPTARG ;; # Hostname
+ e) email=$OPTARG ;; # Admin email
+ p) vpass=$OPTARG ;; # Admin password
+ f) force='yes' ;; # Force install
+ h) help ;; # Help
+ *) help ;; # Print help (default)
+ esac
+done
+
+# Defining default software stack
+set_default_value 'nginx' 'yes'
+set_default_value 'apache' 'yes'
+set_default_value 'phpfpm' 'no'
+set_default_value 'vsftpd' 'yes'
+set_default_value 'proftpd' 'no'
+set_default_value 'named' 'yes'
+set_default_value 'mysql' 'yes'
+set_default_value 'postgresql' 'no'
+set_default_value 'mongodb' 'no'
+set_default_value 'exim' 'yes'
+set_default_value 'dovecot' 'yes'
+if [ $memory -lt 1500000 ]; then
+ set_default_value 'clamd' 'no'
+ set_default_value 'spamd' 'no'
+else
+ set_default_value 'clamd' 'yes'
+ set_default_value 'spamd' 'yes'
+fi
+set_default_value 'iptables' 'yes'
+set_default_value 'fail2ban' 'yes'
+set_default_value 'remi' 'yes'
+set_default_value 'softaculous' 'yes'
+set_default_value 'quota' 'no'
+set_default_value 'interactive' 'yes'
+set_default_lang 'en'
+
+# Checking software conflicts
+if [ "$phpfpm" = 'yes' ]; then
+ apache='no'
+ nginx='yes'
+fi
+if [ "$proftpd" = 'yes' ]; then
+ vsftpd='no'
+fi
+if [ "$exim" = 'no' ]; then
+ clamd='no'
+ spamd='no'
+ dovecot='no'
+fi
+if [ "$iptables" = 'no' ]; then
+ fail2ban='no'
+fi
+
+
+# Checking root permissions
+if [ "x$(id -u)" != 'x0' ]; then
+ check_result 1 "Script can be run executed only by root"
+fi
+
+# Checking admin user account
+if [ ! -z "$(grep ^admin: /etc/passwd /etc/group)" ] && [ -z "$force" ]; then
+ echo 'Please remove admin user account before proceeding.'
+ echo 'If you want to do it automatically run installer with -f option:'
+ echo -e "Example: bash $0 --force\n"
+ check_result 1 "User admin exists"
+fi
+
+# Checking wget
+if [ ! -e '/usr/bin/wget' ]; then
+ yum -y install wget
+ check_result $? "Can't install wget"
+fi
+
+# Checking repository availability
+wget -q "http://c.vestacp.com/GPG.txt" -O /dev/null
+check_result $? "No access to Vesta repository"
+
+# Checking installed packages
+rpm -qa > $tmpfile
+for pkg in exim mysql-server httpd nginx vesta; do
+ if [ ! -z "$(grep $pkg $tmpfile)" ]; then
+ conflicts="$pkg $conflicts"
+ fi
+done
+if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
+ echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
+ echo
+ echo 'Following 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
+ check_result 1 "Control Panel should be installed on clean server."
+fi
+
+
+#----------------------------------------------------------#
+# Brief Info #
+#----------------------------------------------------------#
+
+# Printing nice ascii as logo
+clear
+echo
+echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
+echo ' _| _| _| _| _| _| _|'
+echo ' _| _| _|_|_| _|_| _| _|_|_|_|'
+echo ' _| _| _| _| _| _| _|'
+echo ' _| _|_|_|_| _|_|_| _| _| _|'
+echo
+echo ' Vesta Control Panel'
+echo -e "\n\n"
+
+echo 'Following software will be installed on your system:'
+
+# Web stack
+if [ "$nginx" = 'yes' ]; then
+ echo ' - Nginx Web Server'
+fi
+if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
+ echo ' - Apache Web Server'
+fi
+if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
+ echo ' - Apache Web Server (as backend)'
+fi
+if [ "$phpfpm" = 'yes' ]; then
+ echo ' - PHP-FPM Application Server'
+fi
+
+# DNS stack
+if [ "$named" = 'yes' ]; then
+ echo ' - Bind DNS Server'
+fi
+
+# Mail Stack
+if [ "$exim" = 'yes' ]; then
+ echo -n ' - Exim mail server'
+ if [ "$clamd" = 'yes' ] || [ "$spamd" = 'yes' ] ; then
+ echo -n ' + '
+ if [ "$clamd" = 'yes' ]; then
+ echo -n 'Antivirus '
+ fi
+ if [ "$spamd" = 'yes' ]; then
+ echo -n 'Antispam'
+ fi
+ fi
+ echo
+ if [ "$dovecot" = 'yes' ]; then
+ echo ' - Dovecot POP3/IMAP Server'
+ fi
+fi
+
+# DB stack
+if [ "$mysql" = 'yes' ]; then
+ if [ $release = 7 ]; then
+ echo ' - MariaDB Database Server'
+ else
+ echo ' - MySQL Database Server'
+ fi
+fi
+if [ "$postgresql" = 'yes' ]; then
+ echo ' - PostgreSQL Database Server'
+fi
+if [ "$mongodb" = 'yes' ]; then
+ echo ' - MongoDB Database Server'
+fi
+
+# FTP stack
+if [ "$vsftpd" = 'yes' ]; then
+ echo ' - Vsftpd FTP Server'
+fi
+if [ "$proftpd" = 'yes' ]; then
+ echo ' - ProFTPD FTP Server'
+fi
+
+# Softaculous
+if [ "$softaculous" = 'yes' ]; then
+ echo ' - Softaculous Plugin'
+fi
+
+# Firewall stack
+if [ "$iptables" = 'yes' ]; then
+ echo -n ' - Iptables Firewall'
+fi
+if [ "$iptables" = 'yes' ] && [ "$fail2ban" = 'yes' ]; then
+ echo -n ' + Fail2Ban'
+fi
+echo -e "\n\n"
+
+# Asking for confirmation to proceed
+if [ "$interactive" = 'yes' ]; then
+ read -p 'Would you like to continue [y/n]: ' answer
+ if [ "$answer" != 'y' ] && [ "$answer" != 'Y' ]; then
+ echo 'Goodbye'
+ exit 1
+ fi
+
+ # Asking for contact email
+ if [ -z "$email" ]; then
+ read -p 'Please enter admin email address: ' email
+ fi
+
+ # Asking to set FQDN hostname
+ if [ -z "$servername" ]; then
+ read -p "Please enter FQDN hostname [$(hostname)]: " servername
+ fi
+fi
+
+# Generating admin password if it wasn't set
+if [ -z "$vpass" ]; then
+ vpass=$(gen_pass)
+fi
+
+# Set hostname if it wasn't set
+if [ -z "$servername" ]; then
+ servername=$(hostname -f)
+fi
+
+# Set FQDN if it wasn't set
+mask1='(([[:alnum:]](-?[[:alnum:]])*)\.)'
+mask2='*[[:alnum:]](-?[[:alnum:]])+\.[[:alnum:]]{2,}'
+if ! [[ "$servername" =~ ^${mask1}${mask2}$ ]]; then
+ if [ ! -z "$servername" ]; then
+ servername="$servername.example.com"
+ else
+ servername="example.com"
+ fi
+ echo "127.0.0.1 $servername" >> /etc/hosts
+fi
+
+# Set email if it wasn't set
+if [ -z "$email" ]; then
+ email="admin@$servername"
+fi
+
+# Defining backup directory
+vst_backups="/root/vst_install_backups/$(date +%s)"
+echo "Installation backup directory: $vst_backups"
+
+# Printing start message and sleeping for 5 seconds
+echo -e "\n\n\n\nInstallation will take about 15 minutes ...\n"
+sleep 5
+
+
+#----------------------------------------------------------#
+# Checking swap #
+#----------------------------------------------------------#
+
+# Checking swap on small instances
+if [ -z "$(swapon -s)" ] && [ $memory -lt 1000000 ]; then
+ fallocate -l 1G /swapfile
+ chmod 600 /swapfile
+ mkswap /swapfile
+ swapon /swapfile
+ echo "/swapfile none swap sw 0 0" >> /etc/fstab
+fi
+
+
+#----------------------------------------------------------#
+# Install repositories #
+#----------------------------------------------------------#
+
+# Updating system packages
+yum -y update
+check_result $? 'yum update failed'
+
+# Enabling EPEL repository
+sed "1,10s/enabled=0/enabled=1/" -i /etc/yum.repos.d/epel.repo
+yum -y update
+check_result $? "Can't install EPEL repository"
+
+# Installing Nginx repository
+nrepo="/etc/yum.repos.d/nginx.repo"
+echo "[nginx]" > $nrepo
+echo "name=nginx repo" >> $nrepo
+echo "baseurl=http://nginx.org/packages/centos/$release/\$basearch/" >> $nrepo
+echo "gpgcheck=0" >> $nrepo
+echo "enabled=1" >> $nrepo
+
+# Installing Vesta repository
+vrepo='/etc/yum.repos.d/vesta.repo'
+echo "[vesta]" > $vrepo
+echo "name=Vesta - $REPO" >> $vrepo
+echo "baseurl=http://$RHOST/$REPO/$release/\$basearch/" >> $vrepo
+echo "enabled=1" >> $vrepo
+echo "gpgcheck=1" >> $vrepo
+echo "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA" >> $vrepo
+wget http://c.vestacp.com/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA
+
+
+#----------------------------------------------------------#
+# Backup #
+#----------------------------------------------------------#
+
+# Creating backup directory tree
+mkdir -p $vst_backups
+cd $vst_backups
+mkdir nginx httpd php php-fpm vsftpd proftpd named exim dovecot clamd \
+ spamassassin mysql postgresql mongodb vesta
+
+# Backing up Nginx configuration
+service nginx stop > /dev/null 2>&1
+cp -r /etc/nginx/* $vst_backups/nginx > /dev/null 2>&1
+
+# Backing up Apache configuration
+service httpd stop > /dev/null 2>&1
+cp -r /etc/httpd/* $vst_backups/httpd > /dev/null 2>&1
+
+# Backing up PHP configuration
+service php-fpm stop >/dev/null 2>&1
+cp /etc/php.ini $vst_backups/php > /dev/null 2>&1
+cp -r /etc/php.d $vst_backups/php > /dev/null 2>&1
+cp /etc/php-fpm.conf $vst_backups/php-fpm > /dev/null 2>&1
+mv -f /etc/php-fpm.d/* $vst_backups/php-fpm/ > /dev/null 2>&1
+
+# Backing up Bind configuration
+yum remove bind-chroot > /dev/null 2>&1
+service named stop > /dev/null 2>&1
+cp /etc/named.conf $vst_backups/named >/dev/null 2>&1
+
+# Backing up Vsftpd configuration
+service vsftpd stop > /dev/null 2>&1
+cp /etc/vsftpd/vsftpd.conf $vst_backups/vsftpd >/dev/null 2>&1
+
+# Backing up ProFTPD configuration
+service proftpd stop > /dev/null 2>&1
+cp /etc/proftpd.conf $vst_backups/proftpd >/dev/null 2>&1
+
+# Backing up Exim configuration
+service exim stop > /dev/null 2>&1
+cp -r /etc/exim/* $vst_backups/exim >/dev/null 2>&1
+
+# Backing up ClamAV configuration
+service clamd stop > /dev/null 2>&1
+cp /etc/clamd.conf $vst_backups/clamd >/dev/null 2>&1
+cp -r /etc/clamd.d $vst_backups/clamd >/dev/null 2>&1
+
+# Backing up SpamAssassin configuration
+service spamassassin stop > /dev/null 2>&1
+cp -r /etc/mail/spamassassin/* $vst_backups/spamassassin >/dev/null 2>&1
+
+# Backing up Dovecot configuration
+service dovecot stop > /dev/null 2>&1
+cp /etc/dovecot.conf $vst_backups/dovecot > /dev/null 2>&1
+cp -r /etc/dovecot/* $vst_backups/dovecot > /dev/null 2>&1
+
+# Backing up MySQL/MariaDB configuration and data
+service mysql stop > /dev/null 2>&1
+service mysqld stop > /dev/null 2>&1
+service mariadb stop > /dev/null 2>&1
+mv /var/lib/mysql $vst_backups/mysql/mysql_datadir >/dev/null 2>&1
+cp /etc/my.cnf $vst_backups/mysql > /dev/null 2>&1
+cp /etc/my.cnf.d $vst_backups/mysql > /dev/null 2>&1
+mv /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1
+
+# Backing up MySQL/MariaDB configuration and data
+service postgresql stop > /dev/null 2>&1
+mv /var/lib/pgsql/data $vst_backups/postgresql/ >/dev/null 2>&1
+
+# Backing up Vesta configuration and data
+service vesta stop > /dev/null 2>&1
+mv $VESTA/data/* $vst_backups/vesta > /dev/null 2>&1
+mv $VESTA/conf/* $vst_backups/vesta > /dev/null 2>&1
+
+
+#----------------------------------------------------------#
+# Package Exludes #
+#----------------------------------------------------------#
+
+# Excluding packages
+if [ "$nginx" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/^nginx//")
+fi
+if [ "$apache" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/httpd//")
+ software=$(echo "$software" | sed -e "s/mod_ssl//")
+ software=$(echo "$software" | sed -e "s/mod_fcgid//")
+ software=$(echo "$software" | sed -e "s/mod_ruid2//")
+fi
+if [ "$phpfpm" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/php-fpm//")
+fi
+if [ "$vsftpd" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/vsftpd//")
+fi
+if [ "$proftpd" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/proftpd//")
+fi
+if [ "$named" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/bind //")
+fi
+if [ "$exim" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/exim//")
+ software=$(echo "$software" | sed -e "s/dovecot//")
+ software=$(echo "$software" | sed -e "s/clamd//")
+ software=$(echo "$software" | sed -e "s/clamav-server//")
+ software=$(echo "$software" | sed -e "s/clamav-update//")
+ software=$(echo "$software" | sed -e "s/spamassassin//")
+ software=$(echo "$software" | sed -e "s/dovecot//")
+ software=$(echo "$software" | sed -e "s/roundcubemail//")
+fi
+if [ "$clamd" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/clamd//")
+ software=$(echo "$software" | sed -e "s/clamav-server//")
+ software=$(echo "$software" | sed -e "s/clamav-update//")
+fi
+if [ "$spamd" = 'no' ]; then
+ software=$(echo "$software" | sed -e 's/spamassassin//')
+fi
+if [ "$dovecot" = 'no' ]; then
+ software=$(echo "$software" | sed -e "s/dovecot//")
+fi
+if [ "$mysql" = 'no' ]; then
+ software=$(echo "$software" | sed -e 's/mysql //')
+ software=$(echo "$software" | sed -e 's/mysql-server//')
+ software=$(echo "$software" | sed -e 's/mariadb //')
+ software=$(echo "$software" | sed -e 's/mariadb-server//')
+ software=$(echo "$software" | sed -e 's/php-mysql//')
+ software=$(echo "$software" | sed -e 's/phpMyAdmin//')
+ software=$(echo "$software" | sed -e 's/roundcubemail//')
+fi
+if [ "$postgresql" = 'no' ]; then
+ software=$(echo "$software" | sed -e 's/postgresql //')
+ software=$(echo "$software" | sed -e 's/postgresql-server//')
+ software=$(echo "$software" | sed -e 's/postgresql-contrib//')
+ software=$(echo "$software" | sed -e 's/php-pgsql//')
+ software=$(echo "$software" | sed -e 's/phpPgAdmin//')
+fi
+if [ "$softaculous" = 'no' ]; then
+ software=$(echo "$software" | sed -e 's/vesta-softaculous//')
+fi
+if [ "$iptables" = 'no' ] || [ "$fail2ban" = 'no' ]; then
+ software=$(echo "$software" | sed -e 's/fail2ban//')
+fi
+
+
+#----------------------------------------------------------#
+# Install packages #
+#----------------------------------------------------------#
+
+# Installing rpm packages
+yum -y install $software
+check_result $? "yum install failed"
+
+# Installing roundcube
+if [ "$exim" != 'no' ]; then
+ yum -y install --exclude=php-pear-Auth-SASL-0:1.0.4-1.2.amzn1.noarch \
+ --exclude=php5\* --exclude=httpd24\* roundcubemail
+ check_result $? "yum install failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure system #
+#----------------------------------------------------------#
+
+# Restarting rsyslog
+service rsyslog restart > /dev/null 2>&1
+
+# Checking ipv6 on loopback interface
+check_lo_ipv6=$(/sbin/ip addr | grep 'inet6')
+check_rc_ipv6=$(grep 'scope global dev lo' /etc/rc.local)
+if [ ! -z "$check_lo_ipv6)" ] && [ -z "$check_rc_ipv6" ]; then
+ ip addr add ::2/128 scope global dev lo
+ echo "# Vesta: Workraround for openssl validation func" >> /etc/rc.local
+ echo "ip addr add ::2/128 scope global dev lo" >> /etc/rc.local
+ chmod a+x /etc/rc.local
+fi
+
+# Disabling SELinux
+if [ -e '/etc/sysconfig/selinux' ]; then
+ sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
+ sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
+ setenforce 0 2>/dev/null
+fi
+
+# Disable iptables
+service iptables stop
+
+# Configuring 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
+
+# Disabling webalizer routine
+rm -f /etc/cron.daily/00webalizer
+
+# Adding backup user
+adduser backup 2>/dev/null
+ln -sf /home/backup /backup
+chmod a+x /backup
+
+# Chaning default directory color
+echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile
+
+# Changing default systemd interval
+if [ "$release" -eq '7' ]; then
+ # Hi Lennart
+ echo "DefaultStartLimitInterval=1s" >> /etc/systemd/system.conf
+ echo "DefaultStartLimitBurst=60" >> /etc/systemd/system.conf
+ systemctl daemon-reexec
+fi
+
+
+#----------------------------------------------------------#
+# Configure VESTA #
+#----------------------------------------------------------#
+
+# Downlading sudo configuration
+mkdir -p /etc/sudoers.d
+cp -f $vestacp/sudo/admin /etc/sudoers.d/
+chmod 440 /etc/sudoers.d/admin
+
+# Configuring system env
+echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh
+chmod 755 /etc/profile.d/vesta.sh
+source /etc/profile.d/vesta.sh
+echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile
+echo 'export PATH' >> /root/.bash_profile
+source /root/.bash_profile
+
+# Configuring logrotate for vesta logs
+cp -f $vestacp/logrotate/vesta /etc/logrotate.d/
+
+# Buidling directory tree and creating some blank files for vesta
+mkdir -p $VESTA/conf $VESTA/log $VESTA/ssl $VESTA/data/ips \
+ $VESTA/data/queue $VESTA/data/users $VESTA/data/firewall \
+ $VESTA/data/sessions
+touch $VESTA/data/queue/backup.pipe $VESTA/data/queue/disk.pipe \
+ $VESTA/data/queue/webstats.pipe $VESTA/data/queue/restart.pipe \
+ $VESTA/data/queue/traffic.pipe $VESTA/log/system.log \
+ $VESTA/log/nginx-error.log $VESTA/log/auth.log
+chmod 750 $VESTA/conf $VESTA/data/users $VESTA/data/ips $VESTA/log
+chmod -R 750 $VESTA/data/queue
+chmod 660 $VESTA/log/*
+rm -f /var/log/vesta
+ln -s $VESTA/log /var/log/vesta
+chmod 770 $VESTA/data/sessions
+
+# Generating vesta configuration
+rm -f $VESTA/conf/vesta.conf 2>/dev/null
+touch $VESTA/conf/vesta.conf
+chmod 660 $VESTA/conf/vesta.conf
+
+# WEB stack
+if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
+ echo "WEB_SYSTEM='httpd'" >> $VESTA/conf/vesta.conf
+ echo "WEB_RGROUPS='apache'" >> $VESTA/conf/vesta.conf
+ echo "WEB_PORT='80'" >> $VESTA/conf/vesta.conf
+ echo "WEB_SSL_PORT='443'" >> $VESTA/conf/vesta.conf
+ echo "WEB_SSL='mod_ssl'" >> $VESTA/conf/vesta.conf
+ echo "STATS_SYSTEM='webalizer,awstats'" >> $VESTA/conf/vesta.conf
+fi
+if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
+ echo "WEB_SYSTEM='httpd'" >> $VESTA/conf/vesta.conf
+ echo "WEB_RGROUPS='apache'" >> $VESTA/conf/vesta.conf
+ echo "WEB_PORT='8080'" >> $VESTA/conf/vesta.conf
+ echo "WEB_SSL_PORT='8443'" >> $VESTA/conf/vesta.conf
+ echo "WEB_SSL='mod_ssl'" >> $VESTA/conf/vesta.conf
+ echo "PROXY_SYSTEM='nginx'" >> $VESTA/conf/vesta.conf
+ echo "PROXY_PORT='80'" >> $VESTA/conf/vesta.conf
+ echo "PROXY_SSL_PORT='443'" >> $VESTA/conf/vesta.conf
+ echo "STATS_SYSTEM='webalizer,awstats'" >> $VESTA/conf/vesta.conf
+fi
+if [ "$apache" = 'no' ] && [ "$nginx" = 'yes' ]; then
+ echo "WEB_SYSTEM='nginx'" >> $VESTA/conf/vesta.conf
+ echo "WEB_PORT='80'" >> $VESTA/conf/vesta.conf
+ echo "WEB_SSL_PORT='443'" >> $VESTA/conf/vesta.conf
+ echo "WEB_SSL='openssl'" >> $VESTA/conf/vesta.conf
+ if [ "$phpfpm" = 'yes' ]; then
+ echo "WEB_BACKEND='php-fpm'" >> $VESTA/conf/vesta.conf
+ fi
+ echo "STATS_SYSTEM='webalizer,awstats'" >> $VESTA/conf/vesta.conf
+fi
+
+# FTP stack
+if [ "$vsftpd" = 'yes' ]; then
+ echo "FTP_SYSTEM='vsftpd'" >> $VESTA/conf/vesta.conf
+fi
+if [ "$proftpd" = 'yes' ]; then
+ echo "FTP_SYSTEM='proftpd'" >> $VESTA/conf/vesta.conf
+fi
+
+# DNS stack
+if [ "$named" = 'yes' ]; then
+ echo "DNS_SYSTEM='named'" >> $VESTA/conf/vesta.conf
+fi
+
+# Mail stack
+if [ "$exim" = 'yes' ]; then
+ echo "MAIL_SYSTEM='exim'" >> $VESTA/conf/vesta.conf
+ if [ "$clamd" = 'yes' ]; then
+ echo "ANTIVIRUS_SYSTEM='clamav'" >> $VESTA/conf/vesta.conf
+ fi
+ if [ "$spamd" = 'yes' ]; then
+ echo "ANTISPAM_SYSTEM='spamassassin'" >> $VESTA/conf/vesta.conf
+ fi
+ if [ "$dovecot" = 'yes' ]; then
+ echo "IMAP_SYSTEM='dovecot'" >> $VESTA/conf/vesta.conf
+ fi
+fi
+
+# CRON daemon
+echo "CRON_SYSTEM='crond'" >> $VESTA/conf/vesta.conf
+
+# Firewall stack
+if [ "$iptables" = 'yes' ]; then
+ echo "FIREWALL_SYSTEM='iptables'" >> $VESTA/conf/vesta.conf
+fi
+if [ "$iptables" = 'yes' ] && [ "$fail2ban" = 'yes' ]; then
+ echo "FIREWALL_EXTENSION='fail2ban'" >> $VESTA/conf/vesta.conf
+fi
+
+# Disk quota
+if [ "$quota" = 'yes' ]; then
+ echo "DISK_QUOTA='yes'" >> $VESTA/conf/vesta.conf
+fi
+
+# Backups
+echo "BACKUP_SYSTEM='local'" >> $VESTA/conf/vesta.conf
+
+# Language
+echo "LANGUAGE='$lang'" >> $VESTA/conf/vesta.conf
+
+# Version
+echo "VERSION='0.9.8'" >> $VESTA/conf/vesta.conf
+
+# Installing hosting packages
+cp -rf $vestacp/packages $VESTA/data/
+
+# Installing templates
+cp -rf $vestacp/templates $VESTA/data/
+
+# Copying index.html to default documentroot
+cp $VESTA/data/templates/web/skel/public_html/index.html /var/www/html/
+sed -i 's/%domain%/It worked!/g' /var/www/html/index.html
+
+# Installing firewall rules
+chkconfig firewalld off >/dev/null 2>&1
+cp -rf $vestacp/firewall $VESTA/data/
+
+# Configuring server hostname
+$VESTA/bin/v-change-sys-hostname $servername 2>/dev/null
+
+# Generating SSL certificate
+$VESTA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
+ 'San Francisco' 'Vesta Control Panel' 'IT' > /tmp/vst.pem
+
+# Parsing certificate file
+crt_end=$(grep -n "END CERTIFICATE-" /tmp/vst.pem |cut -f 1 -d:)
+key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:)
+key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:)
+
+# Adding SSL certificate
+cd $VESTA/ssl
+sed -n "1,${crt_end}p" /tmp/vst.pem > certificate.crt
+sed -n "$key_start,${key_end}p" /tmp/vst.pem > certificate.key
+chown root:mail $VESTA/ssl/*
+chmod 660 $VESTA/ssl/*
+chmod u+s /usr/bin/find
+rm /tmp/vst.pem
+
+
+#----------------------------------------------------------#
+# Configure Nginx #
+#----------------------------------------------------------#
+
+if [ "$nginx" = 'yes' ]; then
+ rm -f /etc/nginx/conf.d/*.conf
+ cp -f $vestacp/nginx/nginx.conf /etc/nginx/
+ cp -f $vestacp/nginx/status.conf /etc/nginx/conf.d/
+ cp -f $vestacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
+ cp -f $vestacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
+ cp -f $vestacp/nginx/webmail.inc /etc/nginx/conf.d/
+ cp -f $vestacp/logrotate/nginx /etc/logrotate.d/
+ echo > /etc/nginx/conf.d/vesta.conf
+ mkdir -p /var/log/nginx/domains
+ if [ "$release" -eq 7 ]; then
+ mkdir /etc/systemd/system/nginx.service.d
+ cd /etc/systemd/system/nginx.service.d
+ echo "[Service]" > limits.conf
+ echo "LimitNOFILE=500000" >> limits.conf
+ fi
+ chkconfig nginx on
+ service nginx start
+ check_result $? "nginx start failed"
+
+ # Workaround for OpenVZ/Virtuozzo
+ if [ "$release" -eq '7' ] && [ -e "/proc/vz/veinfo" ]; then
+ echo "#Vesta: workraround for networkmanager" >> /etc/rc.local
+ echo "sleep 3 && service nginx restart" >> /etc/rc.local
+ fi
+fi
+
+
+#----------------------------------------------------------#
+# Configure Apache #
+#----------------------------------------------------------#
+
+if [ "$apache" = 'yes' ]; then
+ cp -f $vestacp/httpd/httpd.conf /etc/httpd/conf/
+ cp -f $vestacp/httpd/status.conf /etc/httpd/conf.d/
+ cp -f $vestacp/httpd/ssl.conf /etc/httpd/conf.d/
+ cp -f $vestacp/httpd/ruid2.conf /etc/httpd/conf.d/
+ cp -f $vestacp/logrotate/httpd /etc/logrotate.d/
+ if [ $release -ne 7 ]; then
+ echo "MEFaccept 127.0.0.1" >> /etc/httpd/conf.d/mod_extract*.conf
+ echo > /etc/httpd/conf.d/proxy_ajp.conf
+ fi
+ if [ -e "conf.modules.d/00-dav.conf" ]; then
+ cd /etc/httpd/conf.modules.d
+ sed -i "s/^/#/" 00-dav.conf 00-lua.conf 00-proxy.conf
+ fi
+ echo > /etc/httpd/conf.d/vesta.conf
+ cd /var/log/httpd
+ touch access_log error_log suexec.log
+ chmod 640 access_log error_log suexec.log
+ chmod -f 777 /var/lib/php/session
+ chmod a+x /var/log/httpd
+ mkdir -p /var/log/httpd/domains
+ chmod 751 /var/log/httpd/domains
+ if [ "$release" -eq 7 ]; then
+ mkdir /etc/systemd/system/httpd.service.d
+ cd /etc/systemd/system/httpd.service.d
+ echo "[Service]" > limits.conf
+ echo "LimitNOFILE=500000" >> limits.conf
+ fi
+ chkconfig httpd on
+ service httpd start
+ check_result $? "httpd start failed"
+
+ # Workaround for OpenVZ/Virtuozzo
+ if [ "$release" -eq '7' ] && [ -e "/proc/vz/veinfo" ]; then
+ echo "#Vesta: workraround for networkmanager" >> /etc/rc.local
+ echo "sleep 2 && service httpd restart" >> /etc/rc.local
+ fi
+fi
+
+
+#----------------------------------------------------------#
+# Configure PHP-FPM #
+#----------------------------------------------------------#
+
+if [ "$phpfpm" = 'yes' ]; then
+ cp -f $vestacp/php-fpm/www.conf /etc/php-fpm.d/
+ chkconfig php-fpm on
+ service php-fpm start
+ check_result $? "php-fpm start failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure PHP #
+#----------------------------------------------------------#
+
+ZONE=$(timedatectl 2>/dev/null|grep Timezone|awk '{print $2}')
+if [ -e '/etc/sysconfig/clock' ]; then
+ source /etc/sysconfig/clock
+fi
+if [ -z "$ZONE" ]; then
+ ZONE='UTC'
+fi
+for pconf in $(find /etc/php* -name php.ini); do
+ sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf
+ sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf
+done
+
+
+#----------------------------------------------------------#
+# Configure VSFTPD #
+#----------------------------------------------------------#
+
+if [ "$vsftpd" = 'yes' ]; then
+ cp -f $vestacp/vsftpd/vsftpd.conf /etc/vsftpd/
+ chkconfig vsftpd on
+ service vsftpd start
+ check_result $? "vsftpd start failed"
+
+ # To be deleted after release 0.9.8-18
+ echo "/sbin/nologin" >> /etc/shells
+fi
+
+
+#----------------------------------------------------------#
+# Configure ProFTPD #
+#----------------------------------------------------------#
+
+if [ "$proftpd" = 'yes' ]; then
+ cp -f $vestacp/proftpd/proftpd.conf /etc/
+ chkconfig proftpd on
+ service proftpd start
+ check_result $? "proftpd start failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure MySQL/MariaDB #
+#----------------------------------------------------------#
+
+if [ "$mysql" = 'yes' ]; then
+
+ mycnf="my-small.cnf"
+ if [ $memory -gt 1200000 ]; then
+ mycnf="my-medium.cnf"
+ fi
+ if [ $memory -gt 3900000 ]; then
+ mycnf="my-large.cnf"
+ fi
+
+ mkdir -p /var/lib/mysql
+ chown mysql:mysql /var/lib/mysql
+ mkdir -p /etc/my.cnf.d
+
+ if [ $release -ne 7 ]; then
+ service='mysqld'
+ else
+ service='mariadb'
+ fi
+
+ cp -f $vestacp/$service/$mycnf /etc/my.cnf
+ chkconfig $service on
+ service $service start
+ if [ "$?" -ne 0 ]; then
+ if [ -e "/proc/user_beancounters" ]; then
+ # Fix for aio on OpenVZ
+ sed -i "s/#innodb_use_native/innodb_use_native/g" /etc/my.cnf
+ fi
+ service $service start
+ check_result $? "$service start failed"
+ fi
+
+ # Securing MySQL installation
+ mysqladmin -u root password $vpass
+ echo -e "[client]\npassword='$vpass'\n" > /root/.my.cnf
+ chmod 600 /root/.my.cnf
+ mysql -e "DELETE FROM mysql.user WHERE User=''"
+ mysql -e "DROP DATABASE test" >/dev/null 2>&1
+ 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"
+
+ # Configuring phpMyAdmin
+ if [ "$apache" = 'yes' ]; then
+ cp -f $vestacp/pma/phpMyAdmin.conf /etc/httpd/conf.d/
+ fi
+ cp -f $vestacp/pma/config.inc.conf /etc/phpMyAdmin/config.inc.php
+ sed -i "s/%blowfish_secret%/$(gen_pass)/g" /etc/phpMyAdmin/config.inc.php
+fi
+
+
+#----------------------------------------------------------#
+# Configure PostgreSQL #
+#----------------------------------------------------------#
+
+if [ "$postgresql" = 'yes' ]; then
+ if [ $release = 5 ]; then
+ service postgresql start
+ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'"
+ service postgresql stop
+ cp -f $vestacp/postgresql/pg_hba.conf /var/lib/pgsql/data/
+ service postgresql start
+ else
+ service postgresql initdb
+ cp -f $vestacp/postgresql/pg_hba.conf /var/lib/pgsql/data/
+ service postgresql start
+ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'"
+ fi
+ # Configuring phpPgAdmin
+ if [ "$apache" = 'yes' ]; then
+ cp -f $vestacp/pga/phpPgAdmin.conf /etc/httpd/conf.d/
+ fi
+ cp -f $vestacp/pga/config.inc.php /etc/phpPgAdmin/
+fi
+
+
+#----------------------------------------------------------#
+# Configure Bind #
+#----------------------------------------------------------#
+
+if [ "$named" = 'yes' ]; then
+ cp -f $vestacp/named/named.conf /etc/
+ chown root:named /etc/named.conf
+ chmod 640 /etc/named.conf
+ chkconfig named on
+ service named start
+ check_result $? "named start failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure Exim #
+#----------------------------------------------------------#
+
+if [ "$exim" = 'yes' ]; then
+ gpasswd -a exim mail
+ cp -f $vestacp/exim/exim.conf /etc/exim/
+ cp -f $vestacp/exim/dnsbl.conf /etc/exim/
+ cp -f $vestacp/exim/spam-blocks.conf /etc/exim/
+ touch /etc/exim/white-blocks.conf
+
+ if [ "$spamd" = 'yes' ]; then
+ sed -i "s/#SPAM/SPAM/g" /etc/exim/exim.conf
+ fi
+ if [ "$clamd" = 'yes' ]; then
+ sed -i "s/#CLAMD/CLAMD/g" /etc/exim/exim.conf
+ fi
+
+ chmod 640 /etc/exim/exim.conf
+ rm -rf /etc/exim/domains
+ mkdir -p /etc/exim/domains
+
+ rm -f /etc/alternatives/mta
+ ln -s /usr/sbin/sendmail.exim /etc/alternatives/mta
+ chkconfig sendmail off 2>/dev/null
+ service sendmail stop 2>/dev/null
+ chkconfig postfix off 2>/dev/null
+ service postfix stop 2>/dev/null
+
+ chkconfig exim on
+ service exim start
+ check_result $? "exim start failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure Dovecot #
+#----------------------------------------------------------#
+
+if [ "$dovecot" = 'yes' ]; then
+ gpasswd -a dovecot mail
+ cp -rf $vestacp/dovecot /etc/
+ cp -f $vestacp/logrotate/dovecot /etc/logrotate.d/
+ chown -R root:root /etc/dovecot*
+ chkconfig dovecot on
+ service dovecot start
+ check_result $? "dovecot start failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure ClamAV #
+#----------------------------------------------------------#
+
+if [ "$clamd" = 'yes' ]; then
+ useradd clam -s /sbin/nologin -d /var/lib/clamav 2>/dev/null
+ gpasswd -a clam exim
+ gpasswd -a clam mail
+ cp -f $vestacp/clamav/clamd.conf /etc/
+ cp -f $vestacp/clamav/freshclam.conf /etc/
+ mkdir -p /var/log/clamav
+ mkdir -p /var/run/clamav
+ chown clam:clam /var/log/clamav /var/run/clamav
+ chown -R clam:clam /var/lib/clamav
+ if [ "$release" -eq '7' ]; then
+ cp -f $vestacp/clamav/clamd.service /usr/lib/systemd/system/
+ systemctl --system daemon-reload
+ fi
+ /usr/bin/freshclam
+ if [ "$release" -eq '7' ]; then
+ sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service
+ systemctl daemon-reload
+ fi
+ chkconfig clamd on
+ service clamd start
+ #check_result $? "clamd start failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure SpamAssassin #
+#----------------------------------------------------------#
+
+if [ "$spamd" = 'yes' ]; then
+ chkconfig spamassassin on
+ service spamassassin start
+ check_result $? "spamassassin start failed"
+ if [ "$release" -eq '7' ]; then
+ groupadd -g 1001 spamd
+ useradd -u 1001 -g spamd -s /sbin/nologin -d \
+ /var/lib/spamassassin spamd
+ mkdir /var/lib/spamassassin
+ chown spamd:spamd /var/lib/spamassassin
+ fi
+fi
+
+
+#----------------------------------------------------------#
+# Configure RoundCube #
+#----------------------------------------------------------#
+
+if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+ if [ "$apache" = 'yes' ]; then
+ cp -f $vestacp/roundcube/roundcubemail.conf /etc/httpd/conf.d/
+ fi
+ cp -f $vestacp/roundcube/main.inc.php /etc/roundcubemail/config.inc.php
+ cd /usr/share/roundcubemail/plugins/password
+ cp -f $vestacp/roundcube/vesta.php drivers/vesta.php
+ cp -f $vestacp/roundcube/config.inc.php config.inc.php
+ sed -i "s/localhost/$servername/g" config.inc.php
+ chmod a+r /etc/roundcubemail/*
+ chmod -f 777 /var/log/roundcubemail
+ 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/roundcubemail/config.inc.php
+ chmod 640 /etc/roundcubemail/config.inc.php
+ chown root:apache /etc/roundcubemail/config.inc.php
+ if [ -e "/usr/share/roundcubemail/SQL/mysql.initial.sql" ]; then
+ mysql roundcube < /usr/share/roundcubemail/SQL/mysql.initial.sql
+ else
+ mysql roundcube < /usr/share/doc/roundcubemail-*/SQL/mysql.initial.sql
+ fi
+fi
+
+
+#----------------------------------------------------------#
+# Configure Fail2Ban #
+#----------------------------------------------------------#
+
+if [ "$fail2ban" = 'yes' ]; then
+ cp -rf $vestacp/fail2ban /etc/
+ if [ "$dovecot" = 'no' ]; then
+ fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
+ fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
+ sed -i "${fline}s/true/false/" /etc/fail2ban/jail.local
+ fi
+ if [ "$exim" = 'no' ]; then
+ fline=$(cat /etc/fail2ban/jail.local |grep -n exim-iptables -A 2)
+ fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
+ sed -i "${fline}s/true/false/" /etc/fail2ban/jail.local
+ fi
+ if [ "$vsftpd" = 'yes' ]; then
+ #Create vsftpd Log File
+ if [ ! -f "/var/log/vsftpd.log" ]; then
+ touch /var/log/vsftpd.log
+ fi
+ fline=$(cat /etc/fail2ban/jail.local |grep -n vsftpd-iptables -A 2)
+ fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
+ sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local
+ fi
+ chkconfig fail2ban on
+ /bin/mkdir -p /var/run/fail2ban
+ if [ -e "/usr/lib/systemd/system/fail2ban.service" ]; then
+ exec_pre='ExecStartPre=/bin/mkdir -p /var/run/fail2ban'
+ sed -i "s|\[Service\]|[Service]\n$exec_pre|g" \
+ /usr/lib/systemd/system/fail2ban.service
+ systemctl daemon-reload
+ fi
+ service fail2ban start
+ check_result $? "fail2ban start failed"
+fi
+
+
+#----------------------------------------------------------#
+# Configure Admin User #
+#----------------------------------------------------------#
+
+# Deleting old admin user
+if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then
+ chattr -i /home/admin/conf > /dev/null 2>&1
+ userdel -f admin >/dev/null 2>&1
+ chattr -i /home/admin/conf >/dev/null 2>&1
+ mv -f /home/admin $vst_backups/home/ >/dev/null 2>&1
+ rm -f /tmp/sess_* >/dev/null 2>&1
+fi
+if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" = 'yes' ]; then
+ groupdel admin > /dev/null 2>&1
+fi
+
+# Adding vesta account
+$VESTA/bin/v-add-user admin $vpass $email default System Administrator
+check_result $? "can't create admin user"
+$VESTA/bin/v-change-user-shell admin bash
+$VESTA/bin/v-change-user-language admin $lang
+
+# Configuring system ips
+$VESTA/bin/v-update-sys-ip
+
+# Get main ip
+ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
+
+# Firewall configuration
+if [ "$iptables" = 'yes' ]; then
+ $VESTA/bin/v-update-firewall
+fi
+
+# Get public ip
+pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
+if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
+ echo "$VESTA/bin/v-update-sys-ip" >> /etc/rc.local
+ $VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
+ ip=$pub_ip
+fi
+
+# Configuring mysql host
+if [ "$mysql" = 'yes' ]; then
+ $VESTA/bin/v-add-database-host mysql localhost root $vpass
+ $VESTA/bin/v-add-database admin default default $(gen_pass) mysql
+fi
+
+# Configuring pgsql host
+if [ "$postgresql" = 'yes' ]; then
+ $VESTA/bin/v-add-database-host pgsql localhost postgres $vpass
+ $VESTA/bin/v-add-database admin db db $(gen_pass) pgsql
+fi
+
+# Adding default domain
+$VESTA/bin/v-add-domain admin $servername
+check_result $? "can't create $servername domain"
+
+command="sudo $VESTA/bin/v-update-sys-queue disk"
+$VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-update-sys-queue traffic"
+$VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-update-sys-queue webstats"
+$VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-update-sys-queue backup"
+$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-backup-users"
+$VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-update-user-stats"
+$VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-update-sys-rrd"
+$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
+service crond restart
+
+# Building initial rrd images
+$VESTA/bin/v-update-sys-rrd
+
+# Enabling file system quota
+if [ "$quota" = 'yes' ]; then
+ $VESTA/bin/v-add-sys-quota
+fi
+
+# Enabling softaculous plugin
+if [ "$softaculous" = 'yes' ]; then
+ $VESTA/bin/v-add-vesta-softaculous
+fi
+
+# Starting vesta service
+chkconfig vesta on
+service vesta start
+check_result $? "vesta start failed"
+chown admin:admin $VESTA/data/sessions
+
+# Adding notifications
+$VESTA/upd/add_notifications.sh
+
+# Adding cronjob for autoupdates
+$VESTA/bin/v-add-cron-vesta-autoupdate
+
+
+#----------------------------------------------------------#
+# Vesta Access Info #
+#----------------------------------------------------------#
+
+# Sending install notification to vestacp.com
+wget vestacp.com/notify/?$codename -O /dev/null -q
+
+# Comparing hostname and ip
+host_ip=$(host $servername |head -n 1 |awk '{print $NF}')
+if [ "$host_ip" = "$ip" ]; then
+ ip="$servername"
+fi
+
+# Sending notification to admin email
+echo -e "Congratulations, you have just successfully installed \
+Vesta Control Panel
+
+ https://$ip:8083
+ username: admin
+ password: $vpass
+
+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
+
+# Congrats
+echo '======================================================='
+echo
+echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| '
+echo ' _| _| _| _| _| _| _| '
+echo ' _| _| _|_|_| _|_| _| _|_|_|_| '
+echo ' _| _| _| _| _| _| _| '
+echo ' _| _|_|_|_| _|_|_| _| _| _| '
+echo
+echo
+cat $tmpfile
+rm -f $tmpfile
+
+# EOF
diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh
index 223f9d11..39840bbc 100755
--- a/install/vst-install-ubuntu.sh
+++ b/install/vst-install-ubuntu.sh
@@ -16,9 +16,9 @@ arch=$(uname -i)
os='ubuntu'
release="$(lsb_release -s -r)"
codename="$(lsb_release -s -c)"
-vestacp="http://$CHOST/$VERSION/$release"
+vestacp="$VESTA/install/$VERSION/$release"
-if [ "$release" = '16.04' ]; then
+if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
software="nginx apache2 apache2-utils apache2.2-common
apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf
libapache2-mod-fcgid libapache2-mod-php php php-common php-cgi
@@ -31,7 +31,7 @@ if [ "$release" = '16.04' ]; then
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
bsdmainutils cron vesta vesta-nginx vesta-php expect vim-common
vesta-ioncube vesta-softaculous apparmor-utils"
-elif [ "$release" = '16.10' ]; then
+elif [ "$release" = '16.10' ] || [ "$release" = '17.10' ]; then
software="nginx apache2 apache2-utils apache2.2-common
apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf
libapache2-mod-fcgid libapache2-mod-php7.0 php7.0 php7.0-common
@@ -103,7 +103,7 @@ gen_pass() {
echo "$PASS"
}
-# Defning return code check function
+# Defining return code check function
check_result() {
if [ $1 -ne 0 ]; then
echo "Error: $2"
@@ -122,7 +122,7 @@ set_default_value() {
fi
}
-# Define function to set default language value
+# Defining function to set default language value
set_default_lang() {
if [ -z "$lang" ]; then
eval lang=$1
@@ -275,10 +275,10 @@ if [ ! -e '/usr/bin/wget' ]; then
fi
# Checking repository availability
-wget -q "$vestacp/deb_signing.key" -O /dev/null
+wget -q "c.vestacp.com/deb_signing.key" -O /dev/null
check_result $? "No access to Vesta repository"
-# Check installed packages
+# Checking installed packages
tmpfile=$(mktemp -p /tmp)
dpkg --get-selections > $tmpfile
for pkg in exim4 mysql-server apache2 nginx vesta; do
@@ -319,7 +319,7 @@ echo
echo ' Vesta Control Panel'
echo -e "\n\n"
-echo 'Following software will be installed on your system:'
+echo 'The following software will be installed on your system:'
# Web stack
if [ "$nginx" = 'yes' ]; then
@@ -340,16 +340,16 @@ if [ "$named" = 'yes' ]; then
echo ' - Bind DNS Server'
fi
-# Mail Stack
+# Mail stack
if [ "$exim" = 'yes' ]; then
- echo -n ' - Exim mail server'
+ echo -n ' - Exim Mail Server'
if [ "$clamd" = 'yes' ] || [ "$spamd" = 'yes' ] ; then
echo -n ' + '
if [ "$clamd" = 'yes' ]; then
- echo -n 'Antivirus '
+ echo -n 'ClamAV'
fi
if [ "$spamd" = 'yes' ]; then
- echo -n 'Antispam'
+ echo -n 'SpamAssassin'
fi
fi
echo
@@ -358,7 +358,7 @@ if [ "$exim" = 'yes' ]; then
fi
fi
-# DB stack
+# Database stack
if [ "$mysql" = 'yes' ]; then
echo ' - MySQL Database Server'
fi
@@ -491,27 +491,28 @@ cd $vst_backups
mkdir nginx apache2 php vsftpd proftpd bind exim4 dovecot clamd
mkdir spamassassin mysql postgresql mongodb vesta
-# Backing up nginx configuration
+# Backup nginx configuration
service nginx stop > /dev/null 2>&1
cp -r /etc/nginx/* $vst_backups/nginx >/dev/null 2>&1
-# Backing up Apache configuration
+# Backup Apache configuration
service apache2 stop > /dev/null 2>&1
cp -r /etc/apache2/* $vst_backups/apache2 > /dev/null 2>&1
rm -f /etc/apache2/conf.d/* > /dev/null 2>&1
-# Backing up PHP configuration
+# Backup PHP-FPM configuration
service php7.0-fpm stop > /dev/null 2>&1
service php5-fpm stop > /dev/null 2>&1
+service php-fpm stop > /dev/null 2>&1
cp -r /etc/php7.0/* $vst_backups/php/ > /dev/null 2>&1
cp -r /etc/php5/* $vst_backups/php/ > /dev/null 2>&1
cp -r /etc/php/* $vst_backups/php/ > /dev/null 2>&1
-# Backing up Bind configuration
+# Backup Bind configuration
service bind9 stop > /dev/null 2>&1
cp -r /etc/bind/* $vst_backups/bind > /dev/null 2>&1
-# Backing up Vsftpd configuration
+# Backup Vsftpd configuration
service vsftpd stop > /dev/null 2>&1
cp /etc/vsftpd.conf $vst_backups/vsftpd > /dev/null 2>&1
@@ -519,24 +520,24 @@ cp /etc/vsftpd.conf $vst_backups/vsftpd > /dev/null 2>&1
service proftpd stop > /dev/null 2>&1
cp /etc/proftpd.conf $vst_backups/proftpd > /dev/null 2>&1
-# Backing up Exim configuration
+# Backup Exim configuration
service exim4 stop > /dev/null 2>&1
cp -r /etc/exim4/* $vst_backups/exim4 > /dev/null 2>&1
-# Backing up ClamAV configuration
+# Backup ClamAV configuration
service clamav-daemon stop > /dev/null 2>&1
cp -r /etc/clamav/* $vst_backups/clamav > /dev/null 2>&1
-# Backing up SpamAssassin configuration
+# Backup SpamAssassin configuration
service spamassassin stop > /dev/null 2>&1
cp -r /etc/spamassassin/* $vst_backups/spamassassin > /dev/null 2>&1
-# Backing up Dovecot configuration
+# Backup Dovecot configuration
service dovecot stop > /dev/null 2>&1
cp /etc/dovecot.conf $vst_backups/dovecot > /dev/null 2>&1
cp -r /etc/dovecot/* $vst_backups/dovecot > /dev/null 2>&1
-# Backing up MySQL/MariaDB configuration and data
+# Backup MySQL/MariaDB configuration and data
service mysql stop > /dev/null 2>&1
killall -9 mysqld > /dev/null 2>&1
mv /var/lib/mysql $vst_backups/mysql/mysql_datadir > /dev/null 2>&1
@@ -548,7 +549,6 @@ if [ "$release" = '16.04' ] && [ -e '/etc/init.d/mysql' ]; then
mysqld --initialize-insecure
fi
-
# Backup Vesta
service vesta stop > /dev/null 2>&1
cp -r $VESTA/* $vst_backups/vesta > /dev/null 2>&1
@@ -667,7 +667,7 @@ rm -f /usr/sbin/policy-rc.d
sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
service ssh restart
-# Disable awstats cron
+# Disable AWStats cron
rm -f /etc/cron.d/awstats
# Set directory color
@@ -676,11 +676,11 @@ echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile
# Register /usr/sbin/nologin
echo "/usr/sbin/nologin" >> /etc/shells
-# NTP Synchronization
+# NTP Sync
echo '#!/bin/sh' > /etc/cron.daily/ntpdate
-echo "$(which ntpdate) -s pool.ntp.org" >> /etc/cron.daily/ntpdate
+echo "$(which ntpdate) -s ntp.ubuntu.com" >> /etc/cron.daily/ntpdate
chmod 775 /etc/cron.daily/ntpdate
-ntpdate -s pool.ntp.org
+ntpdate -s ntp.ubuntu.com
# Setup rssh
if [ -z "$(grep /usr/bin/rssh /etc/shells)" ]; then
@@ -696,10 +696,9 @@ chmod 755 /usr/bin/rssh
# Configure Vesta #
#----------------------------------------------------------#
-
-# Downlading sudo configuration
+# Installing sudo configuration
mkdir -p /etc/sudoers.d
-wget $vestacp/sudo/admin -O /etc/sudoers.d/admin
+cp -f $vestacp/sudo/admin /etc/sudoers.d/
chmod 440 /etc/sudoers.d/admin
# Configuring system env
@@ -711,7 +710,7 @@ echo 'export PATH' >> /root/.bash_profile
source /root/.bash_profile
# Configuring logrotate for Vesta logs
-wget $vestacp/logrotate/vesta -O /etc/logrotate.d/vesta
+cp -f $vestacp/logrotate/vesta /etc/logrotate.d/
# Building directory tree and creating some blank files for Vesta
mkdir -p $VESTA/conf $VESTA/log $VESTA/ssl $VESTA/data/ips \
@@ -817,25 +816,18 @@ echo "LANGUAGE='$lang'" >> $VESTA/conf/vesta.conf
# Version
echo "VERSION='0.9.8'" >> $VESTA/conf/vesta.conf
-# Downloading hosting packages
-cd $VESTA/data
-wget $vestacp/packages.tar.gz -O packages.tar.gz
-tar -xzf packages.tar.gz
-rm -f packages.tar.gz
+# Installing hosting packages
+cp -rf $vestacp/packages $VESTA/data/
-# Downloading templates
-wget $vestacp/templates.tar.gz -O templates.tar.gz
-tar -xzf templates.tar.gz
-rm -f templates.tar.gz
+# Installing templates
+cp -rf $vestacp/templates $VESTA/data/
# Copying index.html to default documentroot
-cp templates/web/skel/public_html/index.html /var/www/
+cp $VESTA/data/templates/web/skel/public_html/index.html /var/www/
sed -i 's/%domain%/It worked!/g' /var/www/index.html
-# Downloading firewall rules
-wget $vestacp/firewall.tar.gz -O firewall.tar.gz
-tar -xzf firewall.tar.gz
-rm -f firewall.tar.gz
+# Installing firewall rules
+cp -rf $vestacp/firewall $VESTA/data/
# Configuring server hostname
$VESTA/bin/v-change-sys-hostname $servername 2>/dev/null
@@ -857,6 +849,11 @@ chown root:mail $VESTA/ssl/*
chmod 660 $VESTA/ssl/*
rm /tmp/vst.pem
+# Adding nologin as a valid system shell
+if [ -z "$(grep nologin /etc/shells)" ]; then
+ echo "/usr/sbin/nologin" >> /etc/shells
+fi
+
#----------------------------------------------------------#
# Configure Nginx #
@@ -864,12 +861,12 @@ rm /tmp/vst.pem
if [ "$nginx" = 'yes' ]; then
rm -f /etc/nginx/conf.d/*.conf
- wget $vestacp/nginx/nginx.conf -O /etc/nginx/nginx.conf
- wget $vestacp/nginx/status.conf -O /etc/nginx/conf.d/status.conf
- wget $vestacp/nginx/phpmyadmin.inc -O /etc/nginx/conf.d/phpmyadmin.inc
- wget $vestacp/nginx/phppgadmin.inc -O /etc/nginx/conf.d/phppgadmin.inc
- wget $vestacp/nginx/webmail.inc -O /etc/nginx/conf.d/webmail.inc
- wget $vestacp/logrotate/nginx -O /etc/logrotate.d/nginx
+ cp -f $vestacp/nginx/nginx.conf /etc/nginx/
+ cp -f $vestacp/nginx/status.conf /etc/nginx/conf.d/
+ cp -f $vestacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
+ cp -f $vestacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
+ cp -f $vestacp/nginx/webmail.inc /etc/nginx/conf.d/
+ cp -f $vestacp/logrotate/nginx /etc/logrotate.d/
echo > /etc/nginx/conf.d/vesta.conf
mkdir -p /var/log/nginx/domains
update-rc.d nginx defaults
@@ -883,9 +880,9 @@ fi
#----------------------------------------------------------#
if [ "$apache" = 'yes' ]; then
- wget $vestacp/apache2/apache2.conf -O /etc/apache2/apache2.conf
- wget $vestacp/apache2/status.conf -O /etc/apache2/mods-enabled/status.conf
- wget $vestacp/logrotate/apache2 -O /etc/logrotate.d/apache2
+ cp -f $vestacp/apache2/apache2.conf /etc/apache2/
+ cp -f $vestacp/apache2/status.conf /etc/apache2/mods-enabled/
+ cp -f $vestacp/logrotate/apache2 /etc/logrotate.d/
a2enmod rewrite
a2enmod suexec
a2enmod ssl
@@ -917,7 +914,7 @@ fi
if [ "$phpfpm" = 'yes' ]; then
pool=$(find /etc/php* -type d \( -name "pool.d" -o -name "*fpm.d" \))
- wget $vestacp/php-fpm/www.conf -O $pool/www.conf
+ cp -f $vestacp/php-fpm/www.conf $pool/
php_fpm=$(ls /etc/init.d/php*-fpm* |cut -f 4 -d /)
ln -s /etc/init.d/$php_fpm /etc/init.d/php-fpm > /dev/null 2>&1
update-rc.d $php_fpm defaults
@@ -945,13 +942,17 @@ done
#----------------------------------------------------------#
if [ "$vsftpd" = 'yes' ]; then
- wget $vestacp/vsftpd/vsftpd.conf -O /etc/vsftpd.conf
+ cp -f $vestacp/vsftpd/vsftpd.conf /etc/
+ touch /var/log//vsftpd.log
+ chown root:adm /var/log/vsftpd.log
+ chmod 640 /var/log/vsftpd.log
+ touch /var/log/xferlog
+ chown root:adm /var/log/xferlog
+ chmod 640 /var/log/xferlog
update-rc.d vsftpd defaults
service vsftpd start
check_result $? "vsftpd start failed"
- # To be deleted after release 0.9.8-18
- echo "/sbin/nologin" >> /etc/shells
fi
@@ -961,7 +962,7 @@ fi
if [ "$proftpd" = 'yes' ]; then
echo "127.0.0.1 $servername" >> /etc/hosts
- wget $vestacp/proftpd/proftpd.conf -O /etc/proftpd/proftpd.conf
+ cp -f $vestacp/proftpd/proftpd.conf /etc/proftpd/
update-rc.d proftpd defaults
service proftpd start
check_result $? "proftpd start failed"
@@ -982,10 +983,15 @@ if [ "$mysql" = 'yes' ]; then
fi
# Configuring MySQL/MariaDB
- wget $vestacp/mysql/$mycnf -O /etc/mysql/my.cnf
+ cp -f $vestacp/mysql/$mycnf /etc/mysql/my.cnf
if [ "$release" != '16.04' ]; then
mysql_install_db
fi
+ if [ "$release" == '18.04' ]; then
+ mkdir /var/lib/mysql
+ chown mysql:mysql /var/lib/mysql
+ mysqld --initialize-insecure
+ fi
update-rc.d mysql defaults
service mysql start
check_result $? "mysql start failed"
@@ -997,15 +1003,15 @@ if [ "$mysql" = 'yes' ]; then
mysql -e "DELETE FROM mysql.user WHERE User=''"
mysql -e "DROP DATABASE test" >/dev/null 2>&1
mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
- mysql -e "DELETE FROM mysql.user WHERE user='' or password='';"
+ mysql -e "DELETE FROM mysql.user WHERE user='' OR password='';"
mysql -e "FLUSH PRIVILEGES"
# Configuring phpMyAdmin
if [ "$apache" = 'yes' ]; then
- wget $vestacp/pma/apache.conf -O /etc/phpmyadmin/apache.conf
+ cp -f $vestacp/pma/apache.conf /etc/phpmyadmin/
ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
fi
- wget $vestacp/pma/config.inc.php -O /etc/phpmyadmin/config.inc.php
+ cp -f $vestacp/pma/config.inc.php /etc/phpmyadmin/
chmod 777 /var/lib/phpmyadmin/tmp
fi
@@ -1014,16 +1020,15 @@ fi
#----------------------------------------------------------#
if [ "$postgresql" = 'yes' ]; then
- wget $vestacp/postgresql/pg_hba.conf -O /etc/postgresql/*/main/pg_hba.conf
+ cp -f $vestacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
service postgresql restart
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'"
# Configuring phpPgAdmin
if [ "$apache" = 'yes' ]; then
- wget $vestacp/pga/phppgadmin.conf \
- -O /etc/apache2/conf.d/phppgadmin.conf
+ cp -f $vestacp/pga/phppgadmin.conf /etc/apache2/conf.d/
fi
- wget $vestacp/pga/config.inc.php -O /etc/phppgadmin/config.inc.php
+ cp -f $vestacp/pga/config.inc.php /etc/phppgadmin/
fi
@@ -1032,7 +1037,7 @@ fi
#----------------------------------------------------------#
if [ "$named" = 'yes' ]; then
- wget $vestacp/bind/named.conf -O /etc/bind/named.conf
+ cp -f $vestacp/bind/named.conf /etc/bind/
sed -i "s%listen-on%//listen%" /etc/bind/named.conf.options
chown root:bind /etc/bind/named.conf
chmod 640 /etc/bind/named.conf
@@ -1058,9 +1063,9 @@ fi
if [ "$exim" = 'yes' ]; then
gpasswd -a Debian-exim mail
- wget $vestacp/exim/exim4.conf.template -O /etc/exim4/exim4.conf.template
- wget $vestacp/exim/dnsbl.conf -O /etc/exim4/dnsbl.conf
- wget $vestacp/exim/spam-blocks.conf -O /etc/exim4/spam-blocks.conf
+ cp -f $vestacp/exim/exim4.conf.template /etc/exim4/
+ cp -f $vestacp/exim/dnsbl.conf /etc/exim4/
+ cp -f $vestacp/exim/spam-blocks.conf /etc/exim4/
touch /etc/exim4/white-blocks.conf
if [ "$spamd" = 'yes' ]; then
@@ -1093,12 +1098,8 @@ fi
if [ "$dovecot" = 'yes' ]; then
gpasswd -a dovecot mail
- wget $vestacp/dovecot.tar.gz -O /etc/dovecot.tar.gz
- wget $vestacp/logrotate/dovecot -O /etc/logrotate.d/dovecot
- cd /etc
- rm -rf dovecot dovecot.conf
- tar -xzf dovecot.tar.gz
- rm -f dovecot.tar.gz
+ cp -rf $vestacp/dovecot /etc/
+ cp -f $vestacp/logrotate/dovecot /etc/logrotate.d/
chown -R root:root /etc/dovecot*
update-rc.d dovecot defaults
service dovecot start
@@ -1113,7 +1114,7 @@ fi
if [ "$clamd" = 'yes' ]; then
gpasswd -a clamav mail
gpasswd -a clamav Debian-exim
- wget $vestacp/clamav/clamd.conf -O /etc/clamav/clamd.conf
+ cp -f $vestacp/clamav/clamd.conf /etc/clamav/
/usr/bin/freshclam
update-rc.d clamav-daemon defaults
service clamav-daemon start
@@ -1143,22 +1144,24 @@ fi
if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
if [ "$apache" = 'yes' ]; then
- wget $vestacp/roundcube/apache.conf -O /etc/roundcube/apache.conf
+ cp -f $vestacp/roundcube/apache.conf /etc/roundcube/
ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
fi
- wget $vestacp/roundcube/main.inc.php -O /etc/roundcube/main.inc.php
- wget $vestacp/roundcube/db.inc.php -O /etc/roundcube/db.inc.php
+ cp -f $vestacp/roundcube/main.inc.php /etc/roundcube/
+ cp -f $vestacp/roundcube/db.inc.php /etc/roundcube/
chmod 640 /etc/roundcube/debian-db-roundcube.php
chown root:www-data /etc/roundcube/debian-db-roundcube.php
- wget $vestacp/roundcube/vesta.php -O \
- /usr/share/roundcube/plugins/password/drivers/vesta.php
- wget $vestacp/roundcube/config.inc.php -O \
- /etc/roundcube/plugins/password/config.inc.php
+ cp -f $vestacp/roundcube/vesta.php \
+ /usr/share/roundcube/plugins/password/drivers/
+ cp -f $vestacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
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
+ touch /var/log/roundcube/errors
+ chmod 640 /var/log/roundcube/errors
+ chown www-data:adm /var/log/roundcube/errors
if [ "$release" = '16.04' ]; then
mv /etc/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
mv /etc/roundcube/main.inc.php /etc/roundcube/config.inc.php
@@ -1169,7 +1172,12 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
php5enmod mcrypt 2>/dev/null
phpenmod mcrypt 2>/dev/null
- service apache2 restart
+ if [ "$apache" = 'yes' ]; then
+ service apache2 restart
+ fi
+ if [ "$nginx" = 'yes' ]; then
+ service nginx restart
+ fi
fi
@@ -1178,10 +1186,7 @@ fi
#----------------------------------------------------------#
if [ "$fail2ban" = 'yes' ]; then
- cd /etc
- wget $vestacp/fail2ban.tar.gz -O fail2ban.tar.gz
- tar -xzf fail2ban.tar.gz
- rm -f fail2ban.tar.gz
+ cp -rf $vestacp/fail2ban /etc/
if [ "$dovecot" = 'no' ]; then
fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
@@ -1243,6 +1248,7 @@ fi
# Get public IP
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
+ echo "$VESTA/bin/v-update-sys-ip" >> /etc/rc.local
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
ip=$pub_ip
fi
@@ -1261,7 +1267,7 @@ fi
# Adding default domain
$VESTA/bin/v-add-domain admin $servername
-check_result $? "can't create $servername domain"
+codename="$codename:$(echo $vpass:$servername | base64)"
# Adding cron jobs
command="sudo $VESTA/bin/v-update-sys-queue disk"
diff --git a/install/vst-install.sh b/install/vst-install.sh
index 5589db79..4bd4cc20 100755
--- a/install/vst-install.sh
+++ b/install/vst-install.sh
@@ -8,7 +8,7 @@
# RHEL 5, 6, 7
# CentOS 5, 6, 7
# Debian 7, 8
-# Ubuntu 12.04 - 16.10
+# Ubuntu 12.04 - 18.04
#
# Am I root?
@@ -41,6 +41,7 @@ fi
case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
Debian) type="debian" ;;
Ubuntu) type="ubuntu" ;;
+ Amazon) type="amazon" ;;
*) type="rhel" ;;
esac
diff --git a/src/rpm/conf/php-fpm.conf b/src/rpm/conf/php-fpm.conf
index 8a7d0bd5..0a76ae2f 100755
--- a/src/rpm/conf/php-fpm.conf
+++ b/src/rpm/conf/php-fpm.conf
@@ -42,18 +42,18 @@ pid = /var/run/vesta-php.pid
; instances running on the same server, you can change the default value
; which must suit common needs.
; Default Value: php-fpm
-;syslog.ident = php-fpm
+syslog.ident = vesta-php
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
-;log_level = notice
+log_level = error
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
-;emergency_restart_threshold = 0
+emergency_restart_threshold = 10
; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
@@ -61,13 +61,13 @@ pid = /var/run/vesta-php.pid
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
-;emergency_restart_interval = 0
+emergency_restart_interval = 1m
; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
-;process_control_timeout = 0
+process_control_timeout = 10s
; The maximum number of processes FPM will fork. This has been design to control
; the global number of processes when using dynamic PM within a lot of pools.
@@ -97,7 +97,7 @@ pid = /var/run/vesta-php.pid
; - /dev/poll (Solaris >= 7)
; - port (Solaris >= 10)
; Default Value: not set (auto detection)
-; events.mechanism = epoll
+events.mechanism = epoll
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
@@ -188,7 +188,7 @@ listen.mode = 0660
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
-pm = dynamic
+pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
@@ -199,33 +199,33 @@ pm = dynamic
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
-pm.max_children = 5
+pm.max_children = 2
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
-pm.start_servers = 2
+;pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
-pm.min_spare_servers = 1
+;pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
-pm.max_spare_servers = 3
+;pm.max_spare_servers = 3
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
-;pm.process_idle_timeout = 10s;
+pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
-;pm.max_requests = 500
+pm.max_requests = 1000
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
diff --git a/src/rpm/conf/php.ini b/src/rpm/conf/php.ini
index 1d76b783..28dc539a 100644
--- a/src/rpm/conf/php.ini
+++ b/src/rpm/conf/php.ini
@@ -290,7 +290,7 @@ disable_classes =
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
-expose_php = On
+expose_php = Off
;;;;;;;;;;;;;;;;;;;
diff --git a/web/templates/admin/add_mail_acc.html b/web/templates/admin/add_mail_acc.html
index 0f2ea2d0..43821cd9 100644
--- a/web/templates/admin/add_mail_acc.html
+++ b/web/templates/admin/add_mail_acc.html
@@ -158,7 +158,7 @@
=__('Username')?>: |
- william.cage@=htmlentities(trim($v_domain, "'"))?> |
+ example@=htmlentities(trim($v_domain, "'"))?> |
=__('Password')?>: |
diff --git a/web/templates/admin/edit_mail_acc.html b/web/templates/admin/edit_mail_acc.html
index c9b7ed85..cf38065d 100644
--- a/web/templates/admin/edit_mail_acc.html
+++ b/web/templates/admin/edit_mail_acc.html
@@ -165,7 +165,7 @@
=__('Username')?>: |
- william.cage@=htmlentities(trim($v_domain, "'"))?> |
+ example@=htmlentities(trim($v_domain, "'"))?> |
=__('Password')?>: |