From 8bb081ce9e4e8250e43e8466af2a71ad710f445b Mon Sep 17 00:00:00 2001 From: "rieger::CLOUD" Date: Thu, 26 Jul 2018 11:09:31 +0200 Subject: [PATCH 1/3] Changes to MariaDB 10.3.8 Based on AMD 64 --- install-nextcloud.sh | 109 ++++++++++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 26 deletions(-) diff --git a/install-nextcloud.sh b/install-nextcloud.sh index 2bfded6..191a12e 100644 --- a/install-nextcloud.sh +++ b/install-nextcloud.sh @@ -3,7 +3,7 @@ # https://www.c-rieger.de # https://github.com/riegercloud # INSTALL-NEXTCLOUD.SH -# Version 4.0 ARM64 +# Version 4.0 AMD64 # July, 26th, 2018 ############################################ # Ubuntu 18.04 LTS AMD64 - Nextcloud 13.0.5 @@ -189,44 +189,101 @@ mount -a service php7.2-fpm restart service nginx restart ###install MariaDB -apt install mariadb-server -y +apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 +if [ ! -f /etc/apt/sources.list.d/mariadb.list ]; then +cat < /etc/apt/sources.list.d/mariadb.list +deb [arch=amd64] http://ftp.hosteurope.de/mirror/mariadb.org/repo/10.3/ubuntu bionic main +deb-src http://ftp.hosteurope.de/mirror/mariadb.org/repo/10.3/ubuntu bionic main +EOF +fi +apt update && apt install mariadb-server -y +/usr/sbin/service mysql stop ###configure MariaDB mv /etc/mysql/my.cnf /etc/mysql/my.cnf.bak -touch /etc/mysql/my.cnf cat </etc/mysql/my.cnf -[server] +[client] +port = 3306 +socket = /var/run/mysqld/mysqld.sock +default-character-set = utf8mb4 + +[mysqld_safe] +socket = /var/run/mysqld/mysqld.sock +nice = 0 + +[mysqld] +user = mysql +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +port = 3306 +basedir = /usr +datadir = /var/lib/mysql +tmpdir = /tmp +lc_messages_dir = /usr/share/mysql +lc_messages = en_US +skip-external-locking skip-name-resolve -innodb_buffer_pool_size = 128M +bind-address = 127.0.0.1 +max_connections = 200 +connect_timeout = 5 +wait_timeout = 600 +max_allowed_packet = 16M +thread_cache_size = 128 +sort_buffer_size = 4M +bulk_insert_buffer_size = 16M +tmp_table_size = 64M +max_heap_table_size = 64M +myisam_recover_options = BACKUP +key_buffer_size = 128M +#open-files-limit = 2000 +table_open_cache = 400 +myisam_sort_buffer_size = 512M +concurrent_insert = 2 +read_buffer_size = 2M +read_rnd_buffer_size = 1M +query_cache_limit = 2M +query_cache_size = 64M +query_cache_type = 1 +query_cache_min_res_unit = 2k +log_warnings = 2 +slow_query_log_file = /var/log/mysql/mariadb-slow.log +long_query_time = 1 +log_slow_verbosity = query_plan +slow-query-log = 1 +slow-query-log-file = /var/log/mysql/slow.log +log_bin = /var/log/mysql/mariadb-bin +log_bin_index = /var/log/mysql/mariadb-bin.index +expire_logs_days = 10 +max_binlog_size = 100M +default_storage_engine = InnoDB +innodb_buffer_pool_size = 256M innodb_buffer_pool_instances = 1 innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 32M innodb_max_dirty_pages_pct = 90 -query_cache_type = 1 -query_cache_limit = 2M -query_cache_min_res_unit = 2k -query_cache_size = 64M -tmp_table_size= 64M -max_heap_table_size= 64M -slow-query-log = 1 -slow-query-log-file = /var/log/mysql/slow.log -long_query_time = 1 - -[client-server] -!includedir /etc/mysql/conf.d/ -!includedir /etc/mysql/mariadb.conf.d/ - -[client] -default-character-set = utf8mb4 - -[mysqld] +innodb_file_per_table = 1 +innodb_open_files = 400 +innodb_io_capacity = 400 +innodb_flush_method = O_DIRECT character-set-server = utf8mb4 collation-server = utf8mb4_general_ci transaction_isolation = READ-COMMITTED binlog_format = ROW -innodb_large_prefix=on -innodb_file_format=barracuda -innodb_file_per_table=1 + +[mysqldump] +quick +quote-names +max_allowed_packet = 16M + +[mysql] +#no-auto-rehash # faster start of mysql but no tab completion + +[isamchk] +key_buffer = 16M + +!include /etc/mysql/mariadb.cnf +!includedir /etc/mysql/conf.d/ EOF +/usr/sbin/service mysql restart clear echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "The Nextcloud-DB username and password - Attention: password is case-sensitive:" From ce14f759b6b11e0e1314097c7a7a3ed732edd7ba Mon Sep 17 00:00:00 2001 From: "rieger::CLOUD" Date: Thu, 26 Jul 2018 12:06:06 +0200 Subject: [PATCH 2/3] MariaDB added a hint regarding MariaDB pwd --- install-nextcloud.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/install-nextcloud.sh b/install-nextcloud.sh index 191a12e..fcb2d59 100644 --- a/install-nextcloud.sh +++ b/install-nextcloud.sh @@ -30,6 +30,24 @@ sudo -u www-data php /var/www/nextcloud/occ files:scan-app-data fail2ban-client status nextcloud ufw status verbose } +###global function to show information regarding the upcoming MariaDB dialogue +function mariadbinfo() { +clear +echo "" +echo "*********************************************************" +echo "You will be asked to set the MariaDB root password twice." +echo " " +echo "Please just confirm the dialogue (*ENTER*)!" +echo "You will be asked again to set the root pwd" +echo "while harden your MariaDB Server!" +echo " " +echo "*********************************************************" +echo " " +echo "Press ENTER to install MariaDB" +read +clear +} +### START ### cd /usr/local/src update_and_clean ###prepare the server environment @@ -196,6 +214,7 @@ deb [arch=amd64] http://ftp.hosteurope.de/mirror/mariadb.org/repo/10.3/ubuntu bi deb-src http://ftp.hosteurope.de/mirror/mariadb.org/repo/10.3/ubuntu bionic main EOF fi +mariadbinfo apt update && apt install mariadb-server -y /usr/sbin/service mysql stop ###configure MariaDB From 055ee27ea4a392ef9d9b740912cd3cf1edd26283 Mon Sep 17 00:00:00 2001 From: "rieger::CLOUD" Date: Thu, 26 Jul 2018 12:09:46 +0200 Subject: [PATCH 3/3] MariaDB 10.3.8 added a hint regarding the MariaDB root password --- install-nextcloud.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install-nextcloud.sh b/install-nextcloud.sh index fcb2d59..8e403c8 100644 --- a/install-nextcloud.sh +++ b/install-nextcloud.sh @@ -37,12 +37,11 @@ echo "" echo "*********************************************************" echo "You will be asked to set the MariaDB root password twice." echo " " -echo "Please just confirm the dialogue (*ENTER*)!" +echo "Please just confirm the dialogue (ENTER)." echo "You will be asked again to set the root pwd" echo "while harden your MariaDB Server!" -echo " " echo "*********************************************************" -echo " " +echo "" echo "Press ENTER to install MariaDB" read clear