:::: MENU ::::


  • Apr 23 / 2019
  • Comments Off on Apache/HTTPd Permissions are missing on a component of the path

Apache/HTTPd Permissions are missing on a component of the path

Seeing that error in HTTPd/Apache logs when trying to GET some pages?

(13)Permission denied: [client xxxxx]: access to /html/myfile.html denied because search permissions are missing on a component of the path

This is because of some SELinux policies blocking the calls. If you don’t want to turn SELinux off, a simple workaround is:

chcon -R --type=httpd_sys_rw_content_t /html/
  • Feb 04 / 2019
  • Comments Off on Fix the NO_PUBKEY error with apt on Ubuntu

Fix the NO_PUBKEY error with apt on Ubuntu

When updating or installing a package on a Debian-based distribution, you can face that alert:

W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886

This just means that a signing GPG key is missing or expired on your system. The error is giving you the ID of the missing key that you can use for looking for it on the Ubuntu website:


Copy the key that you just got from the website above into a file – mykey.txt, for example – and import it with the apt-key command:

apt-key add mykey.txt

Try to install/update the package again, and the error should not appear anymore.

  • Sep 27 / 2018
  • 0

Extract certificate and/or key from a PKCS12 file

The PKCS12 format is replacing the old PFX format from Microsoft. This format will allow storage of X.509 private keys and the associated public certificates in a single encrypted file.

So you can extract the key and the certificate in a single common PEM file, you can use this openssl command:

openssl pkcs12 -in myCertificate.pfx -out myCertificateAndMyKey.pem

If you want to extract the key and the certificate independently, you can also use the options nocerts/nokeys along with openssl, to extract only one part:

openssl pkcs12 -in myCertificate.pfx -nocerts -out myCertificate.key
openssl pkcs12 -in myCertificate.pfx -nokeys -out myCertificate.pem
  • Jul 25 / 2018
  • Comments Off on Automate apt update and keep current config files

Automate apt update and keep current config files

When doing update on a Debian/Ubuntu server, if a package is trying to modify a config file, it’s asking for a manual choice. If you’re trying to try to automate the process, you’d probably like to get rid of that ask and keep the current config file by default.

For that, you can use that script:

apt-get update
listUpgrades=`apt list --upgradable |grep upgradable |cut -d/ -f1`
execUpgrades="DEBIAN_FRONTEND=noninteractive apt-get --yes --assume-yes -o DPkg::options::=\"--force-confdef\" -o DPkg::options::=\"--force-confold\" --only-upgrade install "$listUpgrades
eval $execUpgrades

The multiple options will enforce the update to keep current config and not overwrite it with the package default one.

  • Jun 04 / 2018
  • 0

Installing Oracle JRE using command line (no repo)

There is no way to easily automate deployment of Oracle JRE since there is no official repository for most of the linux distros. But there’s still a workaround to automatically download the JRE and install it locally on a server by using command lines.

Here is an example of how you can download the JRE 1.8u172 from official website for a CentOS server. You’ll have to grab the URL of the package you want to download from the website¬†http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

First, download the package from the website by accepting the license automatically:

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jre-8u172-linux-x64.rpm"

Then, install the package you downloaded on the server:

sudo yum localinstall jre-8u172-linux-x64.rpm
  • May 25 / 2018
  • 0

Change the passphrase of your SSH key

Forgot your SSH key passphrase? There’s an easy way to renew it locally if you have access to it:

ssh-keygen -p -f ~/.ssh/id_rsa

And then, enter the new passphrase you want to use.

Question ? Contact