Inicio

Upgrade/Install to PHP 7.2 – Ubuntu & Debian

PHP 7.2 is just around the corner, and here is a quick note how to upgrade to 7.2. I wrote about upgrading to PHP 7.1 when it was released, and this is a continuation of that post.

1. Add PPA ondrej/php

We use Ondřej Surý’s awesome PHP PPA. It already has PHP 7.2, so we’ll add the PPA and update the package information.

Ubuntu

sudo add-apt-repository ppa:ondrej/php
sudo apt update

Debian

sudo apt install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update

2. Current PHP packages

This only applies if you are upgrading from a previous version. Note down the current PHP packages you have, so we can reinstall them for PHP 7.2.

dpkg -l | grep php | tee packages.txt

This will save your current packages to packages.txt file in your working directory.

3. Install PHP 7.2

sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm

This will install the bare basic packages you’d need to get started with PHP 7.2. Note that php7.2-fpm package is used for your web server integration. If you are using Apache with prefork MPM (type apachectl -V to see the MPM used), you’d need to install libapache2-mod-php7.2 instead of php7.2-fpm.

4. Install additional modules

Take a look at the packages.txt file we created at step #2, and install the additional PHP packages. Your packages.txt file will show packages such as php7.1-mbstring, and you need to install their PHP 7.2 counterpart (php7.2-mbstring for example).

5. Web server configuration

Apache with php-fpm

Before we remove the old PHP packages, make sure that your web server correctly uses the PHP 7.2 sockets/modules. If you installed php7.2-fpm above, and using Apache, a2enconf php7.2 will make Apache use PHP 7.2 FPM. Type a2disconf php7.1-fpmto disable existing FPM configurations.

The steps would be similar for Nginx. Refer to the relevant documentation to change socket paths or IP:Port information.

Apache with mod_php

You can disable the current PHP integration with a2dismod php7.1 (or your current version) and enable new PHP 7.2 module with a2enmod php7.2.

6. Remove old versions

If everything is working well (check your phpinfo() and php --info), you can remove the old packages:

sudo apt purge php7.1*

Of course, change php7.1 with all old versions you no longer need.

Enjoy your shiny new PHP 7.2!


KVM Virtualisation in Debian 9 (Stretch)

Install KVM in Debian 9

  1. Installing the KVM packages

sudo apt install -y qemu-kvm libvirt0 virt-manager bridge-utils

  1. Reboot system

sudo reboot

  1. Add user to libvirt group so user can run commands

sudo gpasswd libvirt -a najibul

  1. Create ISO Directory
$ sudo mkdir /var/lib/libvirt/iso
$ sudo mv debian-9.0.0-amd64-netinst.iso /var/lib/libvirt/iso/
$ sudo chown libvirt-qemu:libvirt \
/var/lib/libvirt/iso/debian-9.0.0-amd64-netinst.iso

Note: Download Local SG/MY mirrors for different distro:

http://ftp.sg.debian.org/debian-cd/

http://download.nus.edu.sg/mirror/centos/

http://mirror.myren.net.my/centos/7/isos/x86_64/

http://mirror.nus.edu.sg/ubuntu-ISO/

  1. Load kvm_intel module if not loaded already

modprobe kvm_intel

  1. Enable and start libvirtd deomon

systemctl enable --now libvirtd

Create Virtual Machine from CLI

Create a virtual machine named “centos-temp”

virt-install --name=centos-temp \
--vcpus=4 \
--memory=8192 \
--cdrom=/var/lib/libvirt/iso/CentOS-7-x86_64-Minimal-1708.iso \
--disk size=50 \
--os-variant=rhel7

Connect to virt-manager Remotely

You can connect to virt-manager to create, delete, install etc. your VM using the GUI. The assumtion is that the KVM server is a remote machine.

  1. Make sure X11 forwarding is turned on in SSH config of the KVM node
    $ sudo grep X11Forwarding /etc/ssh/sshd_config
    X11Forwarding yes
    
  2. Connect to the KVM node via SSH

ssh -X username@kvm-node-ip

OR configure the KVM node IP/Host in your PC in ~/.ssh/config with the following parameter:

ForwardX11 yes

  1. Once logged use following command

virt-manager

 


Python é a linguagem de programação mais relevante

Pelo quinto ano consecutivo, o IEEE Spectrum  classificou as linguagens de programação mais relevantes do mundo. Novamente, o Python está no topo da lista. Isso já havia ocorrido no ano passado.

Os resultados não são muito diferentes daqueles mostrados pelo índice TIOBE no final de junho. O índice analisa as linguagens de programação mais populares a cada mês. Porém, de acordo com esses dados, é o Java que tem dominado por vários anos.

Ambas as classificações usam várias métricas para medir a relevância da linguagem de programação. No entanto, o IEEE utiliza dados específicos para deduzir ainda mais os resultados do ranking

 

 

 

C ++, C, Java e Phyton são as principais forças


O IEEE Spectrum nos mostra a classificação por meio de um aplicativo interativo. Assim, podemos ativar e desativar plataformas. Por exemplo, embora o Python domine em geral (principalmente na Web) o mesmo não ocorre em dispositivos móveis. Nestes, as linguagens dominantes são C ++, C e Java. O Python não está nem entre as 10 primeiras linguagens mais relevantes.

O aplicativo também oferece informações úteis, como as linguagens de programação que são tendências. Da mesma forma, classifica as mais procuradas pelos empregadores , ou as mais populares entre a comunidade de código aberto.

Em todos esses casos, é importante mencionar que C ++, C, Java e Python estão praticamente paradas desde as primeiras posições. Portanto, se você é um programador ou planeja trabalhar nesse campo, esse tipo de indicador pode ser útil para saber onde concentrar seus esforços.


Red Hat Enterprise Linux Atomic Host

O Red Hat Enterprise Linux Atomic Host é um sistema operacional seguro, de consumo mínimo, otimizado para executar containers Linux. O Red Hat Enterprise Linux Atomic Host combina os recursos flexíveis, leves e modulares dos containers Linux com a confiabilidade e a segurança do Red Hat Enterprise Linux em um tamanho de imagem reduzido.

Com o Red Hat Enterprise Linux Atomic Host, é possível:

  • Disponibilizar aplicativos mais rápido.
  • Reduzir esforços com suporte e manutenção.
  • Estender a portabilidade dos containers por toda a infraestrutura de cloud híbrida aberta.
  • Herdar a estabilidade e a maturidade do Red Hat Enterprise Linux.

Erro de Apache “Não foi possível determinar com segurança o nome de domínio totalmente qualificado do servidor”

Quando eu reinicio meu servidor Apache usando o comando
/etc/init.d/apache2 restart
Estou tendo o erro a seguir:
Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2:
Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
O servidor está usando 127.0.1.1 em vez de 127.0.0.1? O que causa esse erro?
Este é apenas um aviso amigável e não é realmente um problema (como em algo que não funciona).

Se você inserir um
ServerName localhost   
em httpd.conf ou apache2.conf em / etc / apache2 e reinicie o apache, o aviso desaparecerá.

Se você tiver um nome dentro de / etc / hostname, também poderá usar esse nome em vez de localhost.

And it uses 127.0.1.1 if it is inside your /etc/hosts:

127.0.0.1 localhost
127.0.1.1 myhostnam


fonte: 
http://bento.inf.br/category/noticias-tecnologica-e-tutorias/

Suporte técnico presencial

Empresas especializadas em suporte técnico de TI também oferecem o serviço presencial. Ou seja, muitas vezes o problema não pode ser resolvido à distância e precisa de um profissional dentro da empresa.
O suporte funciona da seguinte forma. Um funcionário marca com você de visitar a sua empresa em um dia específico. Chegando lá ele analisa os problemas e vê quanto tempo será necessário para resolvê-los.
Feito isso, ele frequentará a empresa como um funcionário comum até que os reparos sejam feitos. Outra opção é sempre ter alguém presente na empresa para representar a empresa de suporte contratada.
Tudo depende dos termos do serviço que você contratou e da necessidade da sua empresa.

Análise de cenário


Suporte técnico remoto

Suporte técnico remoto
A grande vantagem de um suporte técnico de TI é que ele pode ser feito por acesso remoto. Isso é possível porque com uma chave específica o profissional pode se conectar a sua rede e analisá-la.
Além disso, remotamente ele pode verificar se o software que sua empresa usa é adequado e também qualquer coisa relativa à tecnologia.
Outra vantagem do suporte remoto é a seguinte: você tem um problema mas não tem um profissional ali na hora para resolver? Entre em contato com o suporte técnico e explique o que houve. Se possível ele resolverá o seu problema sem mesmo precisar visitar a sua empresa.
Prático.


Erro de Apache “Não foi possível determinar com segurança o nome de domínio totalmente qualificado do servidor”

Quando eu reinicio meu servidor Apache usando o comando
/etc/init.d/apache2 restart
Estou tendo o erro a seguir:
Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2:
Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
O servidor está usando 127.0.1.1 em vez de 127.0.0.1? O que causa esse erro?
Este é apenas um aviso amigável e não é realmente um problema (como em algo que não funciona).

Se você inserir um
ServerName localhost   
em httpd.conf ou apache2.conf em / etc / apache2 e reinicie o apache, o aviso desaparecerá.

Se você tiver um nome dentro de / etc / hostname, também poderá usar esse nome em vez de localhost.

And it uses 127.0.1.1 if it is inside your /etc/hosts:

127.0.0.1 localhost
127.0.1.1 myhostname

Preferred method

Troubleshooting Apache

If you get this error:

apache2: Could not determine the server's fully qualified domain name, 
using 127.0.0.1 for ServerName

then use a text editor such as “sudo nano” at the command line or “gksudo gedit” on the desktop to create a new file,

sudo nano /etc/apache2/conf.d/fqdn

or

gksu "gedit /etc/apache2/conf.d/fqdn"

then add

ServerName localhost

to the file and save. This can all be done in a single command with the following:

 echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn

But on Ubuntu 14.04:

 echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
 sudo a2enconf fqdn

Don’t forget the “.conf” (without will not work).






How to install OwnCloud 10 on Debian 9

ownCloud is a flexible, self-hosted open source PHP web application used for data synchronization and file sharing. ownCloud allows you to easily manage your files, calendars, contacts, to-do lists, and more, making it a great alternative to the popular Google Drive, Box, Dropbox, iCloud and other cloud platforms. Installing ownCloud on Debian, is fairly easy task and should not take more then 15 minutes. This guide should work on other Debian based systems as well but was tested and written for Debian 9 VPS. Let’s get started with installing ownCloud on your Debian 9 server.

1. Install MySQL Server

ownCloud can use MySQL/MariaDB, PostgreSQL, or SQLite as a backend data storage. In this guide we will use MariaDB as database engine.  To install the MariaDB server  run the following command:

sudo apt install mariadb-server

When the installation is complete, run the following commands to start and enable the MariaDB service :

sudo systemctl start mariadb
sudo systemctl enable mariadb

To secure your installation and to setup the root password issue:

sudo mysql_secure_installation

 Create MySQL Database and Usser

To create a database and mysql user for our ownCloud installation run the following commands:

mysql -u root -p
MariaDB [(none)]> CREATE DATABASE owncloud CHARACTER SET utf8;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'owncloud_passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Install Redis

Redis is an in-memory database which will be used by the ownCLoud installation as memory cache. To install the latest Redis version from the default Debian repositories run the following command:

sudo apt install redis-server

3. Install Apache and PHP

Installing Apache, PHP and PHP modules is pretty straightforward process, just issue the following command:

sudo apt install apache2 mariadb-server libapache2-mod-php7.0 \
    openssl php-imagick php7.0-common php7.0-curl php7.0-gd \
    php7.0-imap php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring \
    php7.0-mcrypt php7.0-mysql php7.0-pgsql php-smbclient php-ssh2 \
    php7.0-sqlite3 php7.0-xml php7.0-zip php-redis php-apcu

When the installation is complete, run the following commands to start and enable the Apache service :

sudo systemctl start apache2
sudo systemctl enable apache2

4. Install ownCloud

The ownCLoud 10 package is not available in default Debian 9 repositories so we will install the package from the official ownCLoud repositories. First add the ownCloud GPG key to the apt sources keyring:

wget -qO- https://download.owncloud.org/download/repositories/stable/Debian_9.0/Release.key | sudo apt-key add -

once the key is added run the following command to enable the ownCLoud repository:

echo 'deb https://download.owncloud.org/download/repositories/stable/Debian_9.0/ /' | sudo tee /etc/apt/sources.list.d/owncloud.list

Before installing the ownCLoud package we need to enable HTTPS transport for the debian apt tool by installing the following package:

sudo apt install apt-transport-https

Update the apt cache list and install the ownCLoud package with the following command:

sudo apt update 
sudo apt install owncloud-files

The command above will install the ownCLoud files in the /var/www/owncloud directory.

5. Configure Apache

To configure the Apache web server to serve the ownCLoud directory create a new configuration file with the following content:

sudo nano /etc/apache2/sites-available/owncloud.conf
Alias /owncloud "/var/www/owncloud/"

<Directory /var/www/owncloud/>
Options +FollowSymlinks
AllowOverride All

<IfModule mod_dav.c>
Dav off
</IfModule>

SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud

</Directory>

Enable the Apache ownCloud configuration:

sudo a2ensite owncloud

and restart the Apache web server:

 sudo systemctl restart apache2

Finally set the correct permissions, so the ownCLoud can upload files:

sudo chown -R www-data: /var/www/owncloud/

6. Finish the ownCLoud installation

In the last step of this guide we need to access to ownCLoud Web Interface and finish the installation.

To finish the installation open your browser and navigate to http://your_server_ip_address/owncloud/.

How to install OwnCloud 10 on Debian 9

To create your first admin user enter the Username and Password under the “Create an admin account” label, next click on the “Storage & Database” link which will give you an option to select your database backed. Leave the default “Data Folder” value “/var/www/owncloud/data” and under the “Configure the database” label and select “MySQL/MariaDB”. In the database fields enter the database user, the database user password and the database name you previously created. Finally clock on the blue “Finish setup” button and the ownCLoud installer will populate the database and redirect you to the ownCloud login screen.


That’s it. You have successfully installed ownCloud 10 server on your Debian 9 VPS. For more information about how to manage your ownCloud installation, please refer to the official ownCloud

User Manual.

Of course you don’t have to Install ownCloud on your Debian 9 server, if you use one of our Linux Support Services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on How To Install ownCloud 10 on Debian 9, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks


yum fails

I’ve just started a new job and inheirted numerous CentOS boxes, none of which have been updated in the past couple of years. Upon trying to install auditd, I have run into a yum issue. That being yum fails. I can’t install anything.

I’ve removed and resinstalled the default CentOS repos. I’ve done a yum clean all.

Here are the errors I am seeing.

# yum update check
Loaded plugins: fastestmirror, security
Determining fastest mirrors
* addons: mirror.cs.pitt.edu
* base: mirror.trouble-free.net
* c5-media:
* epel: mirror.math.princeton.edu
* extras: mirror.beyondhosting.net
* updates: mirror.millry.co
http://mirror.cs.pitt.edu/centos/5.11/a … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.liquidweb.com/CentOS/5.1 … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://reflector.westga.edu/repos/CentO … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centos.firehosted.com/5.11/addon … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://repo.us.bigstepcloud.com/centos/ … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.rit.edu/centos/5.11/addo … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
addons | 1.9 kB 00:00
addons/primary_db | 1.1 kB 00:00
http://mirror.trouble-free.net/centos/5 … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
base | 4.7 kB 00:00
http://mirror.lax.hugeserver.com/centos … repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
http://mirrors.kernel.org/centos/5.11/o … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.arsc.edu/centos/5.11/os/ … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.vcu.edu/pub/gnu%2Blinux/c … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.hmc.edu/centos/5.11/os/x8 … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.cs.vt.edu/pub/CentOS/5.11 … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.steadfast.net/centos/5.11 … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://repos.mia.quadranet.com/centos/5 … repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.keystealth.org/centos/5.1 … repomd.xml: [Errno 12] Timeout: <urlopen error timed out>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

 

 

Re: yum fails

Postby TrevorH » 2017/04/06 18:59:06

Apparently you should’ve started your new job a week or two ago. CentOS 5 went EOL at the end of March and there will be no more updates for it. Content has already been removed from the mirror network and shifted to vault.centos.org so you can still get the last updates by pointing your repo files to vault.centos.org instead.

viewtopic.php?f=9&t=57398

Better to update to 5.11 so at least you’ll have everything patched that ever was. Next step is to start planning how to get it all to CentOS 7 (I’d skip 6 entirely at this point as it only has one month left before it goes into “Production Phase 3” where only critical security bugs will get fixed).

CentOS 5 died in March 2017 – migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

kOoLiNuS

Posts: 30
Joined: 2005/04/30 17:20:04
Location: Italy
Contact:

Re: yum fails

Postby kOoLiNuS » 2017/04/07 13:18:30

Hi !
I have to mantain online a machine with 32bit CentOS 5.

So if I have understand correctly I should set my repo as (for example)

CODE: SELECT ALL

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://vault.centos.org/5.11/os/i386/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://vault.centos.org/5.11/extras/i386/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Also I’ve disabled the [updates] repo…

However, you mention maintaining this. There is no maintenance any more. It’s dead. Your next step is to start planning how to get off it and onto a supported version. The next critical update that comes out for CentOS 6 or 7 is quite likely to also be applicable to CentOS 5 but it will never get fixed.


WhatsApp chat