mysql_secure_installation tips

If you need to install MySQL for what ever, you will have to launch this script :

mysql_secure_installation

The first question is to choose a password but since it’s the first installation, you didn’t choose any ! If you installed mariadb you can « bypass » this step by pressing enter but if you installed mysql-server you have to check in the log file created by mysql-server where you can find a temporary password.

Something like that : cat /var/log/mysql.log

RHEL 7 logs flooded

Sick of having your logs (/var/log/messages) flooded by useless messages :

 

 

 

 

Type this command :

echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf

Then restart your rsyslog (systemctl restart rsyslog)

phpMyAdmin tips

After installing your web server (Apache, SQL (mariadb, mysql, …) and PHP) with yum/dnf/apt you may need to install phpMyAdmin which can be usefull to manage databases…

In your /etc/http/conf.d/phpMyAdmin.conf (for CentOS7.4 and maybe other versions) modify each line beggining with « Requipe ip » and adjust with the IP address of your server. Very needed if you manage dedicated servers rent from web hosters

By default (yum install…) phpMyAdmin is installed in /usr/share. Since I want to let other people manage disk space of the web server (create new directories, …), I moved the directory to /var/www and chown everything with my « webadmin » group. And don’t forget to change paths in /etc/httpd/conf.d/phpMyAdmin.conf !