Sunday, October 8, 2017

odoo 10: installing on Debian Stretch

Install from odoo repository not work

# wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
# echo "deb http://nightly.odoo.com/10.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
# apt-get update && apt-get install odoo
# apt-get install odoo
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 odoo : Depends: python-pypdf but it is not installable
E: Unable to correct problems, you have held broken packages.

We install python-pypdf 1.13 using pip
# apt-get install python-pip
# pip install pyPdf


Instructions bellow may harm your system:
"The purpose of a fake package is to trick dpkg and apt into believing that some package is installed even though it's only an empty shell. This allows satisfying dependencies on a package when the corresponding software was installed outside the scope of the packaging system. Such a method works, but it should still be avoided whenever possible, since there is no guarantee that the manually installed software behaves exactly like the corresponding package would and other packages depending on it would not work properly."

We need to build fake debian package for python-pypdf. Install all requirement tools
# apt-get install equivs  dh-make

Create directory python-pypdf
# mkdir python-pypdf
# cd python-pypdf/

Optional to create default email dan full name for our fake python-pypdf
# export EMAIL="youremail@example.com"
# export DEBFULLNAME="your_full_name"

Create our fake python-pypdf configuration
# equivs-control python-pypdf

Edit file python-pypdf
# vi python-pypdf
### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: python
Priority: optional
# Homepage: <enter URL here; no default>
Standards-Version: 3.9.2
Package: python-pypdf
Version: 1.13
Maintainer: your_full_name<youremail@example.com>
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
# Architecture: all
# Multi-Arch: <one of: foreign|same|allowed>
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Files: <pair of space-separated paths; First is file to include, second is destination>
#  <more pairs, if there's more than one file to include. Notice the starting space>
Description: fake package to provide python-pypdf
 python-pypdf will need to be installed with pip
 .
 python-pypdf2 does not provide python-pypdf

We can build our fake python-pypdf and install it
# equivs-build python-pypdf
# dpkg -i python-pypdf_1.13_all.deb

Now you can install odoo 10
# apt-get install odoo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  odoo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.7 MB of archives.
After this operation, 401 MB of additional disk space will be used.
Get:1 http://nightly.odoo.com/10.0/nightly/deb ./ odoo 10.0.20171005 [58.7 MB]
Fetched 58.7 MB in 2min 32s (385 kB/s)
Selecting previously unselected package odoo.
(Reading database ... 64960 files and directories currently installed.)
Preparing to unpack .../odoo_10.0.20171005_all.deb ...
Unpacking odoo (10.0.20171005) ...
Processing triggers for systemd (232-25+deb9u1) ...
[144408.689602] systemd[1]: apt-daily.timer: Adding 4h 39min 11.670524s random time.
Setting up odoo (10.0.20171005) ...
[144409.728850] systemd[1]: apt-daily.timer: Adding 10h 55min 37.336482s random time.
[144409.893345] systemd[1]: apt-daily.timer: Adding 9h 24min 36.399757s random time.
Processing triggers for systemd (232-25+deb9u1) ...
[144410.109266] systemd[1]: apt-daily.timer: Adding 11h 22min 7.421289s random time.


References:
  • https://github.com/odoo/odoo/issues/17002
  • https://debian-handbook.info/browse/stable/sect.building-first-package.html
  • http://nightly.odoo.com/
  • https://www.odoo.com/documentation/10.0/setup/install.html

Wednesday, October 4, 2017

Debian Stretch: XEN configure & create DomU PV ubuntu xenial part 4

We will use xen-tools to make it easier to create guest. This steps are similiar with create domu pv debian

Configure /etc/xen-tools/xen-tools.conf
# vi /etc/xen-tools/xen-tools.conf
...
# lvm = vg0
lvm = volGroup1
...
install-method = debootstrap
...
debootstrap-cmd = /usr/sbin/debootstrap
...
size   = 80G       # Root disk, suffix (G, M, k) required
memory = 2G # Suffix (G, M, k) required
#maxmem = 2G      # Suffix (G, M, k) optional
swap   = 3G # Suffix (G, M, k) required
# noswap = 1      # Don't use swap at all for new systems.
fs     = ext4     # Default file system for any disk
dist   = `xt-guess-suite-and-mirror --suite`
                  # Default distribution is determined by Dom0's distribution
...
gateway = [your_ip_gateway]
netmask = [your_ip_netmask]
broadcast = [your_ip_broadcast]
...
nameserver = 8.8.8.8
...
bridge = br0
...
passwd = 1
...
pygrub = 1
...
mirror = `xt-guess-suite-and-mirror --mirror`
...


You can create your guest by command
# xen-create-image --hostname=ubuntu1601 --ip=[your_ip] --size=67gb --vcpu=4 --dist=xenial --mirror=http://kambing.ui.ac.id/ubuntu 
...
Setting up root password
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
All done
Logfile produced at:
          /var/log/xen-tools/ubuntu1601.log

Installation Summary
---------------------
Hostname        :  ubuntu1601
Distribution    :  xenial
MAC Address     :  00:16:3E:CC:B3:5E
IP Address(es)  : 
[your_ip]
SSH Fingerprint :  SHA256:lvyAvapyE6Z+NGghQrw2SbqanHuejwqhxpo7u38kw/s (DSA)
SSH Fingerprint :  SHA256:oSZgN9IdMdfQNeOy0pnPk/wcr0JouNEH+1hdvl8hpfM (ECDSA)
SSH Fingerprint :  SHA256:eY/7/FFhMLC6XV4Gk8RmMIbBJBaYLUkBr8yOHno/uXY (ED25519)
SSH Fingerprint :  SHA256:Zc2CIx8fadkEhUN/PXL8M+DADAFXa9g0YMcfBd0dQVE (RSA)
Root Password   :  N/A

Note: you can choose closest ubuntu mirror.

Start your guest
# xl create /etc/xen/ubuntu1601.cfg
# xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 11815    24     r-----     653.2
ubuntu1601                                  23  2048     4     -b----      16.4

State:

  • r - running
  • b - blocked
  • p - paused
  • s - shutdown
  • c - crashed
  • d - dying


Connect to your guest
# xl connect ubuntu1601

To make your guest start after boot/restart
# mkdir /etc/xen/auto
# ln -s /etc/xen/ubuntu1601.cfg /etc/xen/auto/ubuntu1601.cfg


References:

  1. http://blog.noviantech.com/2010/06/23/debian-kernels-and-tigon-tg3-firmware/
  2. https://wiki.debian.org/Firmware
  3. https://wiki.debian.org/LVM
  4. https://wiki.debian.org/LinuxRaidForAdmins
  5. https://ycnrg.org/xen-install-os-from-iso-pv/
  6. http://hwraid.le-vert.net/


Tuesday, October 3, 2017

Debian Stretch: LAMP apache2, mysql 5.7 community and php 7.0

Note: Install on fresh Debian Stretch (no apache and no database)

1. Install apache2


To install apache2 

# apt-get install apache2

2. Install mysql 5.7 community


Download MySql apt configuration from https://dev.mysql.com/get/mysql-apt-config_0.8.7-1_all.deb

# wget --no-check-certificate https://dev.mysql.com/get/mysql-apt-config_0.8.7-1_all.deb

Note: File name may change without notice, check latest mysql-apt-config at https://dev.mysql.com/downloads/repo/apt/

Install MySql apt configuration.

# dpkg -i mysql-apt-config_0.8.7-1_all.deb

Choose MySql 5.7 for stable version and continue by click Ok.

Install mysql 5.7 community

# apt-get install mysql-server mysql-client mysql-common

or

# apt-get install mysql-community-server mysql-community-client mysql-common

Note: at the end of installation, system will ask you to set mysql root password (NOT LINUX ROOT USER)

3. Install php 7.0


To install php 7.0:

# apt-get install php7.0 php7.0-gd php7.0-pgsql php7.0-cli php7.0-common php7.0-mcrypt php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0-xml php7.0-xmlrpc php7.0-bz2 php7.0-zip libapache2-mod-php7.0

Bonus: Install webmin


Download webmin

# wget http://prdownloads.sourceforge.net/webadmin/webmin_1.850_all.deb

Note: check http://www.webmin.com/deb.html for latest version

Install require library

# apt-get install libnet-ssleay-perl libauthen-pam-perl  libio-pty-perl  apt-show-versions

Install webmin

# dpkg -i webmin_1.850_all.deb

Note: follow this http://dedetoknotes.blogspot.co.id/2017/10/fixing-webmin-application-configuration.html to fix php.ini location

Done :)

Monday, October 2, 2017

Fixing webmin configuration file in Debian Stretch

PHP 7.0 configuration files

Others -> PHP Configuration -> Module Config:

/etc/php/7.0/apache2/php.ini=Configuration for mod_php
/etc/php/7.0/cgi/php.ini=Configuration for scripts run via CGI
/etc/php/7.0/cli/php.ini=Configuration for command-line scripts


Saturday, September 30, 2017

Debian Stretch: XEN configure & create DomU PV Debian part 3

We will use xen-tools to make it easier to create guest.

Configure /etc/xen-tools/xen-tools.conf
# vi /etc/xen-tools/xen-tools.conf
...
# lvm = vg0
lvm = volGroup1
...
install-method = debootstrap
...
debootstrap-cmd = /usr/sbin/debootstrap
...
size   = 80G       # Root disk, suffix (G, M, k) required
memory = 2G # Suffix (G, M, k) required
#maxmem = 2G      # Suffix (G, M, k) optional
swap   = 3G # Suffix (G, M, k) required
# noswap = 1      # Don't use swap at all for new systems.
fs     = ext4     # Default file system for any disk
dist   = `xt-guess-suite-and-mirror --suite`
                  # Default distribution is determined by Dom0's distribution
...
gateway = [your_ip_gateway]
netmask = [your_ip_netmask]
broadcast = [your_ip_broadcast]
...
nameserver = 8.8.8.8
...
bridge = br0
...
passwd = 1
...
pygrub = 1
...
mirror = `xt-guess-suite-and-mirror --mirror`
...

You can create your guest by command
# xen-create-image --hostname xdebian801 --ip=[your_ip]
...
Setting up root password
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
All done
Logfile produced at:
         /var/log/xen-tools/xdebian801.log

Installation Summary
---------------------
Hostname        :  xdebian801
Distribution    :  stretch
MAC Address     :  00:16:3E:61:28:46
IP Address(es)  :  [your_ip]
SSH Fingerprint :  SHA256:GVI1ri+NA82lDeVEf+pPgSHYFHzLe+SYkCxuTgBfEZw (DSA)
SSH Fingerprint :  SHA256:s5z6k6ek+V43NDG1CX77E81WWCVXZEOYNTEaQTXAaGM (ECDSA)
SSH Fingerprint :  SHA256:FUmWelgtmKtB/sCqrS3P5ZlttVRD/M0IVrArPnUs/8Y (ED25519)
SSH Fingerprint :  SHA256:LvrUnZE3ktnahsWFi+hXZ78+V87YZfmDKi9E01Rn+Zs (RSA)
Root Password   :  N/A

Start your guest
# xl create /etc/xen/xdebian801.cfg
# xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 11815    24     r-----     653.2
xdebian801                                   5  2048     1     -b----       3.5

State:
  • r - running
  • b - blocked
  • p - paused
  • s - shutdown
  • c - crashed
  • d - dying

Connect to your guest
# xl connect xdebian801

To make your guest start after boot/restart
# mkdir /etc/xen/auto
# ln -s /etc/xen/xdebian801.cfg /etc/xen/auto/xdebian801.cfg

Example command to override default configuration during image creation:
# xen-create-image --hostname myexample --ip=192.168.1.1  --size=40G  --swap=2G --memory=1G --vcpus=2

References:

  1. http://blog.noviantech.com/2010/06/23/debian-kernels-and-tigon-tg3-firmware/
  2. https://wiki.debian.org/Firmware
  3. https://wiki.debian.org/LVM
  4. https://wiki.debian.org/LinuxRaidForAdmins
  5. https://ycnrg.org/xen-install-os-from-iso-pv/
  6. http://hwraid.le-vert.net/