Archive | October, 2008

Remote database connection with http and SELinux

In my recent post on FTP connections and SELinux I mentioned that one has to specifically enable a setting with “setsebool”. Well, today I had some problems with a remote database connection that was setup correctly, but still could not connect to the database successfully.

As it turned out, it was another “fine” SELinux setting. This time we had to tell SELinux to allow network connections to databases. This can be done with:

/usr/sbin/setsebool httpd_can_network_connect_db=1

This applies to any application server that tries to connect to a remote database like a CFML or PHP server.

Comments { 12 }

CentOS NetInstall settings

Did we already say that among the different Linux distributions we embrace CentOS? CentOS is a community driven project derived from sources freely provided to the public by a prominent North American Enterprise Linux vendor.  CentOS conforms fully with the upstream vendors redistribution policy and aims to be 100% binary compatible.

In any case, one of the best features is to be able to have CentOS installed with a NetInstall. That means all you have to do is to download the 8MB ISO image, burn it (or use it as a startup image if you want to setup a virtual machine) and off you go. With NetInstall you don’t need to download the 5+ GB DVD or 6 ISO images anymore. Also, only the packages that you need will be downloaded.

As a note: when you get to the screen where you can define the source of the CentOS images you will want to enter the following:

For 32-bit:

Host: isoredirect.centos.org
Directory: centos-5/5.2/os/i386/

For 64-bit:

Host: isoredirect.centos.org
Directory: centos-5/5.2/os/x86_64/

Comments { 26 }

Vsftp login problems on CentOS 5.2 and SELinux

I was just about finishing a new CentOS 5.2 server with SELinux enabled. I then tried to transfer over some data when I was given the error “500 OOPS: cannot change directory:/home/userdir” in the FTP connection window.

First, I thought the cause was that I did not assign the user to the FTP group. Then I also made sure that the FTP group had permission to read/write to the users directory. Still, no go.

The next thing to check was that I enabled an exception in the firewall. To do that you can call “system-config-securitylevel-tui” which brings up a GUI within the shell. Here you can customize your rules. Still, FTP was allowed to go trough, so all was well, right?

Well, it turned out that SELinux with the setting “Enforcing” was the cause of it all. Now, I had the following two options;

  1. Use the “Permissive” setting (If you set SELinux to permissive you can login with FTP)
  2. Still use the “Enforcing” setting

I opted for option 2, since I really wanted to have SELinux enabled with “Enforcing”. Actually, all it took is to dig into the SELinux settings. To do so we have commands like “getsetbool” and “getsebool”.

With the command “/usr/sbin/getsetbool -a” you will get a list of all the boolean setting of SELinux (this is a long list!). Within this list there are some FTP settings which are of our interests here, like:

ftp_home_dir –> off
ftpd_disable_trans –> off
ftpd_is_daemon –> on

The particular one we are looking for is the “ftp_home_dir”. In your list this will probably set to “–> off”. To enable it, issue the following command:

usr/sbin/setsebool ftp_home_dir=1

As soon as you set this, your users should be able to FTP into their home directory and you should be on the safe side with SELinux still in the “Enforcing” mode.

Comments { 63 }

Codeweavers is offering free software – but only today

Just in case you did not notice, due to some bet by the CEO of Codeweaver (you can get the whole story over at the TUAW website), you are able to download the CrossOver product for free, but only today, from their website.

Apparently, the whole Internet is in need of CrossOver and thus they have put up a temporary website to scope with the huge demand.

Comments { 12 }