Tuesday, September 20, 2011

Virtualbox an Esxi5.0 Abstraction layer

So last night I installed Esxi5.0 "freeware" in virtualbox. Its pretty straight forward, and I mean just install from iso but there are a few "non-issues". Esxi5.0 has to be installed on something that is at minimum a dual core, and you have to devote both CPU's to virtualbox. If installed on an AMD Phenom its crying about not having the virtualization bit enabled on my cpu. Boo hoo. ;)

Saturday, September 17, 2011

Centos5: Pear + memcache

Go ahead and install pear from the instructions here:


Its as simple as wget'ing the file of interest and then using it. After the "brief" installer, and I mean brief.

#> pecl install memcache

Note: I had to use kind of a PHP hack to get this working. ITs listed here: http://blog.mostlychris.com/2009/07/fatal-error-allowed-memory-size-of-8388608-bytes-exhausted-pear/ .

It resolves a issue with a script running out of memory before the install completes.

Last but not least since this is a a Centos5 system you'll need to do the following:

echo "extension=memcache.so" > /etc/php.d/memcached.ini

Tuesday, September 13, 2011

Creating a RPM for Memcached is stupidly simple

Here we go!

Post is here: http://code.google.com/p/memcached/wiki/NewInstallFromSource

The short and sweet of it is:

echo "%_topdir /home/melinko2003/rpmbuild" >> ~/.rpmmacros
mkdir -p /home/melinko2003/rpmbuild/{SPECS,BUILD,SRPMS,RPMS,SOURCES}
wget http://memcached.org/latest
rpmbuild -ta memcached-1.x.x.tar.gz

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!

wget http://downloads.mysql.com/archives/mysql-5.0/MySQL-devel-community-5.0.45-0.rhel5.i386.rpm

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 -> http://www.labcoding.com

#> 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 http://www.labcoding.com/yum/centos/5/i386/SRPMS/php4-4.4.8-LAB8.src.rpm
#> 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.gd 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: http://www.openldap.org/lists/openldap-technical/201103/msg00026.html

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: <4D6D73FB.6060805@gmail.com>
* References: <4D6D73FB.6060805@gmail.com>
* 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-----
Van: openldap-technical-bounces@OpenLDAP.org
[mailto:openldap-technical-bounces@OpenLDAP.org] Namens Nan Meng
Verzonden: dinsdag 1 maart 2011 23:32
Aan: openldap-technical@openldap.org
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.