Differences between revisions 5 and 6
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:

= 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

Ubuntu 18.04 Installation to have a V2 or DrawMGT Vagrant Box

OS Installation and Configuration

The basic Ubuntu installation is taken from the 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
     <Ok>
    root@ubuntu-bionic:~# apt-get install vim cvs zip libhtml-parser-perl dctrl-tools postfix libperl4-corelibs-perl
    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 versions:

  • root@ubuntu-bionic:~# php -v
    PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.8-0ubuntu0.16.04.3, Copyright (c) 1999-2016, by Zend Technologies
    root@ubuntu-bionic:~# mysql -V
    mysql  Ver 14.14 Distrib 5.7.15, 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 this article if MySQL databases have to be stored in a custom directory.

Remove PHP 7.0 and install PHP 5.6

PHP 5.6 for Ubuntu 16 can be installed from PPA (Personal Package Archives) for PHP (5.6, 7.0):

Add PPA to the repositories

  • root@ubuntu-bionic:~# add-apt-repository ppa:ondrej/php
    root@ubuntu-bionic:~# apt-get update

Remove the currently installed PHP 7.0 packages, check the list of the packages first and complete the list below

  • root@ubuntu-bionic:~# dpkg --get-selections | grep -i php
    root@ubuntu-bionic:~# apt-get purge libapache2-mod-php7.0 php-common php-mysql php-pear php-xml php7.0-cli php7.0-common php7.0-dev php7.0-json php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml pkg-php-tools

Install PHP 5.6 with PEAR and PEAR packages

  • apt-get --no-install-recommends install php5.6 php5.6-mysql php5.6-dev php5.6-xml php5.6-mbstring php-pear
    pear install Log Mail Mail_Mime Mail_mimeDecode Net_SMTP Net_Socket Services_JSON

Check again installed PHP 7.0 packages an remove them:

  • root@ubuntu-bionic:~# dpkg --get-selections | grep -i php
    root@ubuntu-bionic:~# apt-get purge ....

Install PECL packages also directly from the PPA

  • apt-get --no-install-recommends install php-propro php-raphf php-pecl-http

Configure php.ini

  • root@ubuntu-bionic:~#  cd /etc/php/5.6/apache2
    root@ubuntu-bionic:~#  cp php.ini php.ini-ORIG
    root@ubuntu-bionic:~#  vi php.ini
    root@ubuntu-bionic:~#  diff php.ini-ORIG php.ini
    372c372
    < max_execution_time = 30
    ---
    > max_execution_time = 120
    466c466
    < display_errors = Off
    ---
    > display_errors = On
    572c572
    < ;error_log = php_errors.log
    ---
    > error_log = /var/log/php_errors.log
    660c660
    < post_max_size = 8M
    ---
    > post_max_size = 128M
    709c709
    < ;include_path = ".:/usr/share/php"
    ---
    > include_path = ".:/usr/share/php"
    820c820
    < upload_max_filesize = 2M
    ---
    > upload_max_filesize = 128M
    1389c1392
    < ;browscap = extra/browscap.ini
    ---
    > browscap = /etc/browscap.ini
    1499c1502
    < session.gc_divisor = 1000
    ---
    > session.gc_divisor = 500
    1504c1507
    < session.gc_maxlifetime = 1440
    ---
    > session.gc_maxlifetime = 36000

    The session timeout (timeout for automatic logout) is set also in php.ini. See Setting Session Timeout.

    Install a browscap.ini file. Download php_browscap.ini from http://browscap.org/stream?q=PHP_BrowsCapINI, change the name to browscap.ini, and save it in the /etc with permission 644.

    Change also /etc/php/5.6/cli/php.ini, apply only display_errors and include_path from the changes above.

Perl modules

  • Add some perl modules:
    root@ubuntu-bionic:~# apt-get install libconfig-general-perl

httpd Configuration

  • Apache2 (httpd) configuration is very easy, only the virtual host definitions must be added and appropriate apache modules should be loaded.

Adding Apache Modules

  • root@ubuntu-bionic:~# a2enmod rewrite dav auth_digest authz_groupfile

Restart Apache

  • systemctl restart apache2.service

Install Image Magick

  • To allow to create thumbnail files ghostscript and ImageMagick must be installed. The versions in the Ubuntu distribution are quite old. Newer versions must be installed:

      # Ghostscript and ImageMagick are part of the Ubuntu distribution (currently versions 9.18 and 6.8.9-9)
     
      apt-get install ghostscript imagemagick

Install TexLive 2015

To allow to create LaTeX submital/transmittal cover letters TexLive >= 2011 must be installed.

  • root@ubuntu-bionic:~# apt-get install texlive latexmk texlive-latex-extra

Install htmldoc

  • root@ubuntu-bionic:~# apt-get install htmldoc

Create drawmgt User and Group

  • root@ubuntu-bionic:~# adduser --uid=1003 drawmgt
    root@ubuntu-bionic:~# usermod -a -G www-data drawmgt
    root@ubuntu-bionic:~# usermod -a -G drawmgt www-data

Minimal puppet client setup

  • vagrant@xenial-rails:~$ sudo su -
    root@:~# apt install puppet-common
    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

Ubuntu_18_Wiki (last edited 2021-02-09 09:13:00 by 172)

Copyright 2008-2014, SoftXS GmbH, Switzerland