Centos: Release 5 now „end of life“

On 2017, March 31th the official Release End of Version 5 is reached. This also touches SME Server Version 8.1.

  • If you use this you must now upgrade the Webserver to the next Version.
  • Checkout which last version offers latest Options like PHP7, MYSQL 6 ..more
  • Checkout that you current Content PHP Kits Support the new OS Options (PHP7)
  • As Remark you should do at first a FULL BACKUP of your DATA!! see here
  • Save manual the /etc folder to Backup, dump crontabs and firewall settings! (ufw)
  • Setup a fresh OS if you are not a Professional Admin cause to prevent old Config Files wasting the OS!
  • Restore all Backups, set crontabs, set firewall settings
  • Check the new OS with hardening default linux tools like „nmap“, „arp-scan“ or „systat“ .. more
  • Check daily the Logs of the OS, auth daemons, Webserver Logs, Database Logs.. all Services you installed!
  • If you run into problems „white pages“, checkout the PHP5 to PHP7 Release Change Notes and Changes
  • Backup the fresh OS again..

..enjoy the new Webserver Setup..

Debian: Update SSD Firmware without CDROM

If you want to update the SSD Firmware of a device you should know some things:

  • Do you REALLY need the update? Bugs? If NOT exit here!
  • Firmwareupdates can destroy DATA on Drives!
  • Data cant be restored if the Controller fails after Update
  • Downgrade a Firmware to older is most IMPOSSIBLE!!

.. now you need a USB Stick 4GB and the ISO File of the Firmware Disk of the Manufacter then open the Gnome Terminal or Console and:

$sudo su - #become root
$apt-get update && apt-get install unetbootin gparted # install the tools
$dd if=/dev/null of=/dev/sdc bs=10240 count=1 # delete usbstick unmounted with zeros (factory reset)
$gparted /dev/sdc #create new Primary Partition with FAT32, set "managed flags" to "boot lba", now exit gparted
$mount /dev/sdc1 /mnt #mount usbstick to /mnt 
$unetbootin #select FreeDOS at Menu, and select /dev/sdc1 and create the FreeDOS Stick, then exit unetbootin WITHOUT reboot!
$mkdir /iso && mount -o loop /home/yourusername/firmware-cd.iso /iso # mount the CDImage to /iso readonly
$cd /iso && cp firmware.img /mnt/firmware.img # copy firmware-data to usbstick

  • NOW, reboot and unplug other HDDs of the PC, ONLY the SSD must be insert!
  • Boot the PC on the usbstick, on the unetbootin Menu PRESS „Tab“ to get the „Unetbootin-Console“!
  • Here change the value of „initrd=/ubinit“ to „initrd=firmware.img“ and PRESS ENTER
  • Follow now the Firmware Update Dialog and Reboot with disconnected usbstick and replugged Drives…

Linux FreeBSD: Protect your Disc Data against power loss

Problem: If you use IDE or SATA Disc Drives inside your Workstation or Server without a additional uninterruppted power supply after a power loss your Disc Drives can lose data, do not boot clean up agian or damage the drive headers and sectors.

Background: SATA or IDE Drives uses „Disc Cached Controllers“, the count of this disc cache reach from 8 to 64 megabytes. In case of data write to disc, the disc controllers do cache some data who are often used. A Raid 1 Disc Mirror is affected too by this problem. SCSI od SAS are not using Cache by default.

Solution:

Install the software tool called hdparm to set the cache parameters to disabled, cause most of operating systems have enabled by default.

  1. at Debian/ubuntu do : # sudo aptitude install hdparm
  2. at Centos/Redhat do:  #sudo yum install hdparm

now lets show discs which are installed:

  1. at Debian/ubuntu do: # sudo fdisk -l
  2. at Centos/Redhat do: #sudo  /sbin/sfdisk -l
  3. at FreeBSD do: # fdisk -l

yet lets take settings to disable the cache on every boot:

  1. at all linux do: sudo nano /etc/rc.local
  2. insert for every drive
    hdarm -W 0 /dev/sdX
    (X is for a to …)
  3. at FreeBSD  do : #vi /etc/loader.conf
  4. insert once for all drives 
    hw.ata.wc="0"

Remarks:

  1. If you have two drives with same physical size inside your PC config a mdadm Software Raid 1 additional on your System.
  2. Set the PC Bios Settings to auto boot ofter power failure and plug off the power on you testing System, check the results. There should not be needed a check disk called fsck after the Test, but its better to do it.
  3. Hardware Raid Controllers do often have RAM Cache too, size 128MB up to 2GB, at power loss these Data lost, this can only be surpressed by a addtition RAM Cache Backup Battery connected to the Hardware Raid Controller

 

How to compile the Centos SME Server 7.4 Linux Kernel 2.6.34

Download the latest stable kernel from the http://www.kernel.org/ unpack the downloaded source file.
Steps:

  1. # wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.tar.bz2
  2. # tar xjf tar xjf linux-2.6.34.tar.bz2
  3. # ln -s linux-2.6.34 linux
  4. # cd linux
  5. # cp /boot/config-`uname -r` ./.config
  6. # make menuconfig (here you can select .config as preselected .config from old kernel)
  7. # make rpm (Compile the Kernel and make a rpm-paket)
  1. During the compilation of linux-2.6.34 kernel the following error appears
  2. drivers/message/fusion/mptsas.c: In function `mptsas_port_delete'
  3.  drivers/message/fusion/mptsas.c: 105: sorry, unimplemented: inlining failed in call to 'mptsas_set_rphy': function body not available
  4.  drivers/message/fusion/mptsas.c: 467: sorry, unimplemented: called from here
  5. Because: The ‚mptsas_set_rphy‘ function is defined after the ‚mptsas_port_delete‘ function in the file

Solution :
Moved the ‚mptsas_set_rphy‘ function definition before to the function ‚mptsas_port_delete‘ function definition.

  1.  drivers/built-in.o(.init.text+0x3bad): In function `con_init': include/trace/events/kmem.h:47: undefined reference to `.L1452'

Solution:
This bug was due to the result of allocating the memory using kzalloc() in con_init() function in the drivers/char/vt.c file.
The problem is:

vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT);

Solution:
vc_cons[currcons].d = vc = alloc_bootmem(sizeof(struct vc_data));

SME Server Centos Red Hat speedup disable unneeded services sound pcmcia cpuspeed

Problem: The default installation setup some unneeded services like pcmcia or sound or cpuspeed

Solution:

  1. log into your server as root
  2. run
    /sbin/chkconfig --list 
    to see active services
  3. run
    /sbin/chkconfig --level 2345 pcmcia off 
    to disable pcmcia cause a server does not have pcmcia
  4. edit the /etc/modprobe.conf and switch off sound-modules with
    alias "name-module" off
  5. run after reboot
    #/sbin/lsmod
    to control the disabled sound modules if they are not seen they are not active
  6. NOW you have reduced memory load and processes at cpu can speed up your CPU and save energy (at my Epia 533Mhz may be 3Watts at hour)

Centos: Yum Installer Howto

yum (Yellow dog Updater, Modified) ist eine RPM-Paketmanagement-Programm, das, aehnlich wie apt/RPM, automatisch Abhaengigkeiten aufloest. Es wird u.a. zur Zeit als Standard Paketmanager in Fedora Linux genutzt.

Pakete installieren/updaten/entfernen:

Installation von RPMs: yum install paket
Upgrade einzelner Pakete (nur bereits installierte Pakete): yum update paket
Upgrade des kompletten Systems: yum upgrade
Deinstallation von Paketen: yum remove paket

Paketsuche
Welches Paket enthält die Datei oder welches Feature ist vorhanden: yum provides dateiname
Gibt es dieses Paket überhaupt: yum list paket

Informationen anzeigen
Verfügbare Pakete anzeigen: yum list available
Updatebare Pakete anzeigen: yum list updates

Aufraeumen
Heruntergeladene Pakete wieder loeschen: yum clean packages

Repositories erstellen

yum-arch /pfad/zu/verzeichnis/mit/rpms

und in /etc/yum.conf eintragen:
[lokale Pakete]
name=Meine RPMs
baseurl=/pfad/zu/verzeichnis/mit/rpms

Hier ein Link zu ein paar yum – Repositories: http://www.linux.duke.edu/projects/yum/yum-repo.ptml
Homepage: http://www.linux.duke.edu/projects/yum/index.ptml