= Ubuntu 18.04 Installation to have a V2 or DrawMGT Vagrant Box = <> = OS Installation and Configuration = The basic Ubuntu installation is taken from the [[https://app.vagrantup.com/ubuntu/boxes/bionic64|ubuntu/bionic64 Vagrant box4]] currently at 2021-01-18. == Adding Virtual Machine Box == Add and start the new virtual machine box to the initialized Vagrant environment: {{{ $ su - vagrant $ mkdir vms/ubuntu18 $ cd vms/ubuntu18 $ vagrant init ubuntu/bionic64 $ vagrant up }}} == Login into the VM and Change Passwords == As default the ''root'' password is not known and ''vagrant'' password is 'vagrant' on the VM box dowloaded from Vagrant. They should be changed: {{{ $ vagrant ssh vagrant@ubuntu-bionic:~$ sudo su - root@ubuntu-bionic:~# passwd root@ubuntu-bionic:~# passwd vagrant }}} = Setup some directories and V2 user = {{{ root@ubuntu-bionic:# mkdir /data root@ubuntu-bionic:# mkdir /backup root@ubuntu-bionic:# adduser v2 root@ubuntu-bionic:# usermod -a -G www-data v2 root@ubuntu-bionic:# usermod -a -G admin v2 root@ubuntu-bionic:# usermod -a -G vagrant v2 }}} = Install development tools and additional packages = It is possible to install the LAMP server (Apache, MySQL and PHP) in one step. Update all packages before do this. {{{ root@ubuntu-bionic:~# apt-get update root@ubuntu-bionic:~# apt install tasksel root@ubuntu-bionic:~# tasksel [*] LAMP server root@ubuntu-bionic:~# apt-get install zip root@ubuntu-bionic:~# vi /etc/vim/vimrc " Uncomment the following to have Vim jump to the last position when " reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif }}} Currently installed PHP and MySQL versions: {{{ root@ubuntu-bionic:~# php -v PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct 7 2020 15:24:25) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies root@ubuntu-bionic:~# mysql -V mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper }}} = Configure mysqld = {{{ root@ubuntu-bionic:~# vi /etc/mysql/mysql.conf.d/mysqld.cnf # add the following lines to the end of the file (in [mysqld] section) character_set_server=utf8 innodb_buffer_pool_size = 256M innodb_lock_wait_timeout = 30 innodb_file_per_table lock_wait_timeout=30 sql-mode="" # See https://github.com/Piwigo/Piwigo/issues/376 root@ubuntu-bionic:~# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -psqladmin mysql # Set timezone info in the database }}} Retart mysql: {{{ root@ubuntu-bionic:~# systemctl restart mysql.service }}} See [[https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-16-04|this article]] if MySQL databases have to be stored in a custom directory. = Minimal puppet client setup = {{{ vagrant@xenial-rails:~$ sudo su - root@:~# apt install puppet root@ubuntu-bionic:~# cd /etc/puppet root@ubuntu-bionic:~# rm -rf [efmt]* root@ubuntu-bionic:~# vi puppet.conf [agent] server = puppet report = true }}} = Notes = == MySQL Passwords == Use ''~/-my.cnf'' instead of command line passwords for all DrawMGT users using mysqlcopy.pl or backupClient.pl to avoid problems caused by the warning of current MySQL version: ''mysql: [Warning] Using a password on the command line interface can be insecure.'' <
> Use mysqlcopy.pl without -p option and do not define password in the configuration file for backupClient.pl. {{{ [mysqldump] user=root password=sqladmin [mysql] user=root password=sqladmin }}}