Thursday, March 24, 2011

PHP4 X86_64 on Centos5 + Amendment.

In my previous blog I solved a headache, just remember do not yum install mysql-devel, use the rpm.

PHP4 X86_64 on Centos5

After some Hardcore testing, I finally figured it out :D Kids we now have 4.4.9 x86_64. Here are the modifications I had to make to get it to compile correctly! WOOHOO!


rpm --oldpackage --force -Uvh MySQL-devel-community-5.0.45-0.rhel5.i386.rpm

[root@localhost SPECS]# diff php4-4.4.9_melinko.spec php4-4.4.8_LAB8.spec
< Version: 4.4.9
< Release: melinko%{?dist}
> Version: 4.4.8
> Release: LAB8%{?dist}
< --with-mysql=shared \
> --with-mysql=shared,%{_prefix} \
< --with-mime-magic=/usr/lib/rpm/magic.mime \
< $* || tail config.log
> --with-mime-magic=%{_libdir}/rpm/magic.mime \
> $* || tail -300 config.log
< build --with-apxs2=/usr/sbin/apxs
> build --with-apxs2=%{_sbindir}/apxs

Wednesday, March 23, 2011

PHP4 on Centos 5

So I found this tonight, bad news it only works on i386 - i868, sorry folks no x86_64 :(

I will provide credit, where it is due ->

#> sudo yum install rpm-build autoconf automake m4 gcc gcc-c++ bison flex
#> sudo yum install bzip2-devel curl-devel db4-devel expat-devel gmp-devel aspell-devel httpd-devel libjpeg-devel libpng-devel pam-devel openssl-devel zlib-devel pcre-devel krb5-devel libc-client-devel cyrus-sascl-devel openldap-devel mysql-devel postgresql-devel unixODBC-devel net-snmp-devel elfutils-devel libxslt-devel libxml2-devel ncurses-devel freetype-devel
#> sudo yum install aspell-devel libtool libxslt-devel

#> wget
#> cd /usr/src/redhat/SPECS
#> rpmbuild -bb php4-4.4.8_LAB8.spec

Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/php4-root
Wrote: /usr/src/redhat/RPMS/i386/php4-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-devel-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-pear-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-imap-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-ldap-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-mysql-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-pgsql-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-odbc-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-snmp-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-domxml-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-xmlrpc-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-mbstring-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-ncurses-4.4.8-LAB8.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php4-gd-4.4.8-LAB8.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.55937
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd php-4.4.8
+ '[' /var/tmp/php4-root '!=' / ']'
+ rm -rf /var/tmp/php4-root
+ rm files.domxml files.imap files.ldap files.mbstring files.mysql files.ncurses files.odbc files.pgsql files.snmp files.xmlrpc
+ exit 0

Sunday, March 20, 2011

OpenLDAP info.

I found a great post in a mailman mail list:

I think ill be giving this a shot relatively soon :) Im kind of excited.

RE: OpenLDAP, Kerberos, Samba, PAM, How Do They Work Together?

* To: "Nan Meng" ,
* Subject: RE: OpenLDAP, Kerberos, Samba, PAM, How Do They Work Together?
* From: "Germ van Ek"
* Date: Wed, 2 Mar 2011 11:01:34 +0100
* Content-class: urn:content-classes:message
* In-reply-to: <>
* References: <>
* Thread-index: AcvYYzxAWgY6nws6RqWuejoq/SRO6AAWvsdw
* Thread-topic: OpenLDAP, Kerberos, Samba, PAM, How Do They Work Together?

Dear Nan,

I'll give it a go, my explanation will be simplified, as all software of
course is able to do a lot, I'll try to explain it's typical role.

OpenLDAP is a database management system. It communicates with database
clients in a standard (LDAP) way, and uses a (configurable) database
backend to store it's data.
One of the more popular database backends is Berkeley DB (BDB). It
usually stores it's data in files in /var/lib/ldap.

Kerberos is an authentication mechanism. It is ticket based. That means
that as soon as a client authenticates with Kerberos, it receives an
'authentication ticket'. It is then able to send this ticket to one or
more (thereby using single signon) services, such as Samba.

Samba is used for file sharing, printer sharing and Windows
authentication. It currently emulates a Windows NT4 domain controller.
It can use a LDAP server for it's user/groups backend.

PAM is the Linux 'Pluggable Authentication Mechanism'. This is
authentication system of Linux, that can use plugins for retrieving user
and group info. The 'standard' plugin is pam_unix, this uses the
familiar /etc/passwd,/etc/group and /etc/shadow files. Another plugin is
pam_ldap, which uses the LDAP configuration in /etc/ldap.conf for

Another thing that probably will be configured is nsswitch. This is the
'name service switch', that resolves user id's (0 for root,1000 and up
for other users) to user names. This is configured in
/etc/nsswitch.conf. (passwd,shadow,group will most likely be configured
as 'files ldap').

The standard base for LDAP client configuration is /etc/ldap.conf.

The most likely thing to be down, if I read your story, is the LDAP DB,
and more deeper, your Berkeley DB.
Troubleshooting this has been a long time ago for me. The only thing
that comes into mind is trying to start slapd by hand (without the
init.d script) using a '-vvv' parameter for maximum verbosity. It will
then hopefully crash and tell you what is wrong in the end.


-----Oorspronkelijk bericht-----
[] Namens Nan Meng
Verzonden: dinsdag 1 maart 2011 23:32
Onderwerp: OpenLDAP, Kerberos, Samba, PAM, How Do They Work Together?

Dear list members,

I hope amateur questions could be tolerated. I would make it
professional if I could. I'm a newbie to OpenLDAP and probably even
Linux, but I have to take care of an office network (Linux servers with
Linux and PC workstations) that features email server, domain control,
file/printer sharing, user account management, web servers and so forth,
on my own without anyone's help.

Yesterday morning the power went down and so did our servers. After I
turned the servers back on, the account information system was no longer
working. Users weren't able to login with their credentials anymore,
even the root. What I did was I logged in the server (the Samba PDC,
LDAP server, Kerberos server, domain controller, email server) with
single mode, reseted the root password, and added accounts for other
individual users on the server. I know it was a bad idea. Although I got
some things working (emails, file/printer sharing), but there are still
other problems (PHP ldap_bind() from web servers fails, domain user
accounts and profiles fail to load correctly).

I know there is a centralized mechanism that handles user accounts with
the help of OpenLDAP, Kerberos, Samba, BerkeleyDB (and possibly other
things), but I don't have a clue of how they work together. I've been
trying to learn from docs and books for a long time before this power
issue, but not very successful.

My greatest problem is that I don't know how these things are working
together on my system. I believe I also lack some fundamental system
knowledge. I've been reading the docs available, but they're so abstract
to me and none of them seems to match our system configuration.

I'm hoping that I can get some help from here. Maybe some one can give
me some suggestions on how to troubleshoot in such a scenario as a
newbie, or an entry point that I can follow in order to explore the
system. I believe you can tell that I'm totally confused here without
being able to give much useful information about the problem and the
system. I'm sorry for my ignorance, but I really tried to deal with it
myself. If this thread turns out to be annoying or ridiculous, please
ignore, and I do apologize.

However, while I'm still struggling on the problem, if anyone could
help, I would really appreciate it. Thank you so much.