Information Security

SELinux prevented ruby from reading files stored on a NFS filesytem

While working on a server farm for a client I kept running into some issues with one of the servers. The issue appeared to be a single CentOS Linux server in a cluster of ten CentOS Linux servers configured exactly the same as the other nine CentOS Linux servers was having issues writing to a network storage device. Initially I figured that the CentOS Linux server having the issues had some permission issues with the directory that was mounted to the SAN (Storage Area Network) however after minimal troubleshooting it was verified that the permissions were identical to the other servers. I started looking through other logs on the server having the issue and located some SELinux errors that were noticeably related to the issue at hand. Below I describe where the SELinux error was located, what the specific errors were, and how I was able to resolve the errors on this specific CentOS Linux server.

Technology Errors

Cannot Connect to PostgreSQL Database with pgAdmin III and No Errors

On initial installation of PostgreSQL typically you will also download and install pgAdmin III on your local PC to assist in Postgres management. The pgAdmin GUI will assist in viewing database information quickly, etc. In one of my installations I was not able to connect to the new Postgres installation via pgAdmin and I was not receiving errors. Typically the issues I might have are related to the password not being correct or various GRANT permissions.

I had configured all of the initial items that I usually do which included the below.

Technology Insights

How to Turn Off SELinux on a CentOS Server

Follow the below directions to turn off selinux on a CentOS server. SeLinux can cause many issues and if your server is behind a properly configured firewall as well as the systems administrator only opens necessary ports that are configured properly your risks should be minimal.

  1. Modify selinux Configuration:Modify the selinux config file by issuing the command below and changing the SELINUX option to disabled as shown below.
  2. bash

    1. [root@server ~]#vi /etc/selinux/config

Technology Errors

[ERROR] Could not use /var/log/mysql-err.log for logging (error 13)

081004  2:35:11 [ERROR] Could not use /var/log/mysql-err.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.

The above error displayed in the mysqld.log file fter adding the below line to /etc/my.cnf under [mysqld].

log=/var/log/mysql.log

Before restarting mysql I created the file and applied the proper permissions by entering the commands below from the console.