/var/log/step2k

November 25, 2005

PHP with MySQL 4.1 and later

Filed under: MySQL, PHP - Salman Teguh @ 6:10 am

http://id2.php.net/function.mysql-connect
Anthony Boyd
27-Jul-2005 05:53
Some versions of PHP do not support the new longer passwords used by MySQL 4.1 and later. This will cause the error message that 2raptor mentioned a few posts prior to this one:

“Client does not support authentication protocol requested by server; consider upgrading MySQL client”

However, for ease of use, let’s review the two fixes right here.

First, you should upgrade to a newer PHP that supports the longer MySQL passwords. However, I don’t even know if the PHP 4.x series has been upgraded to handle this yet. So for my installation, I took a different approach — I downgraded MySQL’s passwords to the “old” shorter encryption. Here’s how:

SET PASSWORD FOR ’some_user’@’some_host’ = OLD_PASSWORD(’newpwd’);

As a real-world example, I used this query:

SET PASSWORD FOR ‘testaccount’@'%’ = OLD_PASSWORD(’secret’);

Suddenly, PHP could use the testaccount to access the database. Yay.

-Tony

November 18, 2005

Modssl+PHP+Apache

Filed under: PHP - Salman Teguh @ 4:29 am

Build OpenSSL
$ cd openssl-0.9.7
$ ./config
$ make
$ make test
$ cd ..
Compilation should be long with tons of incomprehensible strings appearing on the screen, this is normal. Notice that we don’t install OpenSSL, we don’t need to.

Now that you’ve done the long and boring part, let’s get to the real stuff!
(more…)

November 17, 2005

HowTo Create A LiveCD | livecd.berlios.de

Filed under: Project, Linux - Salman Teguh @ 10:03 am

Building a LiveCD based on Mandrakelinux 10.1 Official

This step by step HowTo describes how you can master a LiveCD from an installed system. You should be familiar with: doing basic works on command line, setup additional software sources on a Mandrake system, using ‘urpmi’ to install and remove software.

0. Mastering a LiveCD requires a minimum of 256 MB RAM and in addition a swap partition. 250 MB should be enough if you create a small LiveCD ( ~ 300 MB ), go for 2 GB if you are planning a bigger system.

1. Install a clean Mandrakelinux 10.1 Official on one / partition. Don’t forget the swap partition. Install the available official updates. Don’t install nvidia or ati drivers.

2. Keep your system simple, and: keep it small. Start with a used space of 800 - 900 MB, this is a full featured KDE system. ‘df’ is the command to control the used space on your harddrive. Take your time to uninstall (Mandrake Control Center) all unneeded software. A default Mandrake installation includes a lot of stuff that you can safely get rid off. And if urpmi complains about dependencies and wants to uninstall too much, you may want to experiment with: rpm -e –nodeps. That will erase single packages.
Configure the ‘look and feel’ of your graphical environment. The LiveCD will look the same.
Make sure that /etc, /home, /lib, /root, /var is not too big. Otherwise you’ll be running out of RAM when starting the LiveCD. Examples: Don’t put many (already compressed) video or music files into your home directory. Don’t have two kernel versions (/lib) installed. Clean or uninstall your urpmi databases in /var/lib/urpmi.

3. Add ‘contrib’ and ‘main’ to your urpmi software sources. Install the ‘kernel 2.6.7 tmb’ from ‘contrib’ on your system. (MCC) The default kernel 2.6.8 won’t work on a LiveCD! Reboot with your new kernel, make sure you are running it: uname -r. Uninstall the default 2.6.8 kernel, again reboot.

4. The next step is to install the mklivecd scripts that will build your .iso file. I’ve made an archive which contains: a working mklivecd.rpm (from cvs, 01.01.2005), the file install_any.pm and this HowTo. Download the archive here: livecd_101.tar.gz
Unpack the archive to your home directory and install the rpm, using the urpmi command. This will take care of all dependencies and will download and install more stuff. You did setup your urpmi sources (contrib, main), hey?
As root copy the file install_any.pm to /usr/lib/libDraKX

If you want to include an installer into your LiveCD you also need the package livecd-utils.rpm. Get it here

5. Clickup a console. Get root. Run: mklivecd –help
The command to build your iso is as simple/enhanced as you want.
Examples:
# mklivecd myown.iso
# mklivecd –verbose –resolution 800x600 –fstab=rw,auto –splash=no –keyboard=fr rainbow.iso
The script takes care of compressing the files and building a bootable image, and will cleanup after it is done.
Burn your iso. Have fun.

6. If you are running into problems, please read the archives of the livecd-users mailinglist at berlios.de, or even better, join the list.

7. Some notes on Kernel problems with Mandrake 10.1 OE. To build a LiveCD with the mklivecd scripts the kernel has to be patched with squashfs. The default Mandrake 10.1 kernel (2.6.8.1) has the wrong, not working patch! And the 2.6.8 kernel has broken append options! You can use the 2.6.7 tmb kernel from contrib. It’s working fine. If you want a newer kernel version (2.6.9 or 2.6.10), you need to patch and compile your own kernel. More info on the users-list or on the irc channel #pclinuxos (efnet), where you can talk to the developers of the mklivecd scripts.

8. When building your iso, you can specify a standard keyboard layout. Default is the US keyboard. Later on your LiveCD you can use a cheatcode (keyb=fr) to alter the layout. If you want an easy way to change the keyboard while running the LiveCD, you need to edit the file ‘/usr/lib/libDrakX/Xconfig/xfree.pm ‘, before building your iso. Lines 25 and 71, change the resp. ‘keyboard’ to ‘kbd’, that will load the correct keyboard driver. (more…)

Get free blog up and running in minutes with Blogsome
Theme designed by Alex King