Wednesday, March 4, 2020

Ubuntu 16.04 mysql 5.6 - my.cnf changes are not taking effect

You need to check the error in syslog : /var/log/syslog

If you get something like this
kernel: [83454.649662] audit: type=1400 audit(1583063492.688:61): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/etc/mysql/my.cnf.fallback" pid=27270 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

Here is the solution for you.

Solution :
The root cause is a bug in the MySQL 5.6 for Ubuntu 16.04

The issue is with apparmor. It is denying access to a symlinked file.
Run following command as root.
echo '/etc/mysql/** lr,' >> /etc/apparmor.d/local/usr.sbin.mysqld
or try following with sudo user
sudo echo '/etc/mysql/** lr,' >> /etc/apparmor.d/local/usr.sbin.mysqld
But if it still does not work
sudo nano  /etc/apparmor.d/local/usr.sbin.mysqld
and add following line at the end of the file.
Now reload apparmor
sudo systemctl reload apparmor
Make some changes in my.cnf and restart mysql. Changes should take effect.

s3cmd error : /usr/bin/env: ‘python2’: No such file or directory

 Solution :
It is not able to find /usr/bin/python2 or /usr/bin/python with python2.x
To solve this install the package in debian based systems like Ubuntu.

sudo apt-get install python-minimal

Wednesday, February 5, 2020

Apache Mixed Content Error

Mixed Content is the most common issue in an apache website. The perfect solution is, you need to find all urls and replace http with https but it may be time consuming and most probably this solution is at developer's end.
If you want to fix it at apache's end, here is the solution. Atleast you should give a try.

First enable module headers in apache

sudo a2enmod headers
sudo service apache2 reload

Now add the line in virtualhost, your 443 port virtualhost where you have defined ssl keys. People add it in 80 port virtual host and complains it does not work.
Header always set Content-Security-Policy "upgrade-insecure-requests;
If you do not have virtualhost access, add the line in .htaccess
Header always set Content-Security-Policy "upgrade-insecure-requests;
Now check the urls in updated version of firefox / chrome / your browser.

If you get internal server error, it means header module is not enabled.