FC4, perl dbi and MySQL?

Place to discuss Fedora and/or Red Hat
Post Reply
ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

FC4, perl dbi and MySQL?

Post by ZiaTioN » Thu Oct 20, 2005 11:03 am

Has anyone heard of an issue with core 4 and mysql with a perl dbi interface? What I am seeing is that I have some cgi scripts written in perl that use the DBI module to interface with MySQL. Now these scripts talked with the database just fine under core 2 when invoked by a browser but do not on core 4. The weird thing is when I run these cgi script on the command line in core 4 they run just fine. It seems to be only an issue when they are run via browser through cgi.

I show the following error in my error logs:
[Thu Oct 20 12:39:16 2005] [error] [client xxx.xxx.xxx.xxx] DBI connect('dbname:Freedom','ZiaTioN',...) failed: Can't create TCP/IP socket (13) at Modules/DBdriver.pm line 21
[Thu Oct 20 12:39:16 2005] [error] [client xxx.xxx.xxx.xxx] Database connection error: Can't create TCP/IP socket (13)
[Thu Oct 20 12:39:16 2005] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: dig
I removed the ip address to protect the innocent but other than that this is exactly what I see in the logs. I have searched for that error code 13 along with the message but found nothing. I found some things that resembled this issue but they were all from 2000 or something like that and all on Windows machines.
Last edited by ZiaTioN on Mon Oct 31, 2005 12:20 pm, edited 1 time in total.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Oct 20, 2005 11:12 am

Couple of thoughts come to mind. Did you install FC4 with SELinux enabled? It sounds like it might be an SELinux issue. You can run the system-config-securitylevel command to turn it off (I always turn it off, can't see giving up 7% performance when I don't need to). Another thought is does your script connect to "localhost" or your NIC IP address? If NIC, try "localhost".

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Thu Oct 20, 2005 4:54 pm

Did you install FC4 with SELinux enabled? It sounds like it might be an SELinux issue.
Very interesting, that was exactly it. What is the deal with SeLinux where it would do this? It was specifically blocking socket connections made by the user "apache". At first I thought it was a permissions problem with all non-privilaged users but I was able to execute the script via the command line with other non-privilaged users so it was specifically blocking apache.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Oct 20, 2005 6:03 pm

That's the only thing I could think of that could cause the problem you were having. Did you happen to upgrade FC4 after installing it? There is obviously an issue with the policy you have installed. I'm not an SELinux expert though because the first thing I do when I install a system is turn off SELinux.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Thu Oct 20, 2005 9:02 pm

Yes, as soon as I got the system up and running I did a kernel upgrade and an "apt-get update" then an "apt-get dist-upgrade". It upgraded somthing like 260 something items.

Post Reply