Debugging Apache

Problem: Apache quit working

Solution: Debug via gdb httpd2

Apache quit working after some network changes. The error log contained numerous

child pid 20038 exit signal Segmentation fault (11) lines.

Running gdb httpd2 along with a backtrace (bt) revealed the function / line of code throwing the error. The problem was quickly tracked down to the LDAP config (ldap.conf).

dbtcp on SuSe 10.x

First off, to compile dbtcp as a PHP extension, you’ll need to have phpize installed. I didn’t, so I opened up YAST and click on PHP’s devel package. A YAST dependency warning is thrown, click remove php-devel, press OK, select ignore and OK.

Extract archive to /usr/src/dbtcp

>cd /usr/src/dbtcp

Opened MakeFile and added -fPIC to CCFLAGS (line 11)
Opended dbug/dbug.c and commented out IMPORT int fprintf(); (line 210)

>cd /usr/src/dbtcp/php/dbtcp
>./configure –with-dbtcp=/usr/src/dbtcp
>make install

Create a file, “/etc/php5/conf.d/dbtcp.ini” with contents of

>service apache2 restart

At this point dbtcp is installed and “good to go” on the SuSe box. Let’s try it out!

Run DBTCP.exe
I went ahead and clicked on the “Allowed IPs” icon (it’s the icon with the bust of a person) and typed in the IPAddress of the SuSe box.

Okay back to SuSe. We need a quick PHP script to test things out…


$dsn = "DSN=Projects";
$host = "";

$handle = dbtcp_connect($dsn,$host);

if(dbtcp_sql("SELECT * FROM sometable"))
while($row = dbtcp_fetch_assoc())


That’s it, you just saved yourself from buying a $1,500 driver 🙂

Suse FTP users authenticated from eDirectory via LDAP

I recently needed to integrate eDirectory users and FTP access on a Suse 10x server. The following describe the steps needed to get things talking.

Here are some reference links for supplemental information

How to Configure Linux to Authenticate to eDirectory via LDAP

AppNote: PAM Integration with eDirectory and LDAP

Installing Pure-FTPd on SLES 10

I’m assuming your eDirectory’s schema has been udpated, see the 1st link if you need to do so.

Login in Suse and launch YaST.
Navigate to Network Services -> LDAP Client
Fill out the parameters to math your LDAP setup. Be sure to check “LDAP TLS/SSL” also make sure that LDAP is setup for TLS via Console One.

Update /etc/pam.d/login and /etc/pam.d/xdm to include
session required /lib/security/ skel=/etc/skel umask=0022
Doing so will create home directories for the users when they login if they don’t already exist.

Note that the contents of the directory you set skel=”” will be copied when creating the user’s directory.

At this point an LDAP user should be able to authenticate (login) to the Suse server provided the have a User ID / Group ID / Home Directory etc assigned in eDirectory (See the “UNIX” tab in console 1).

On to FTP.

Use YaST to verify that pure-ftpd is enabled. Navigate to Network Services->Network Services (xientd). Look for Server “/usr/sbin/pure-ftpd”, the status should be ON. Toggle status to On if necessary.

Open up /etc/pure-ftpd/pure-ftpd.conf
Make sure the following lines are NOT commented:

PAMAuthentication yes
LDAPConfigFile /etc/pure-ftpd/pureftpd-ldap.conf
UnixAuthentication yes

At this point you’ll want to save this file and make sure /etc/pure-ftpd/pureftpd-ldap.conf exists and has valid entires.
Here’s a sample file

LDAPProt 389
LDAPBaseDN o=YourOrg
LDAPBindDN cn=admin,o=YourOrg
LDAPBindPW secret
LDAPDefaultUID 500
LDAPDefault GID 100

Save /etc/pure-ftpd/pureftpd-ldap.conf.

Finally, we want to enable PAM for pure-ftpd. Open /etc/pam.d/pure-ftpd. Add the following lines

auth sufficient
account sufficient
session optional

Issue the following command to run pure-ftpd from the config options /usr/sbin/ /etc/pure-ftpd/pure-ftpd.conf

Restart the pure-ftpd daemon: rcpure-ftpd restart

Happy ftp’ing 🙂