Changing Mysql data directory require change to AppArmor

After a bit of googling and hair-pulling, I realized that if I just changed the datadir directive in my.cnf will cause mysql start to fail on Ubuntu. The other thing is to add permissions to apparmor for mysql to access the new data directories.

Steps
1. sudo vi /etc/apparmor.d/usr.sbin.mysqld
2. Add
/newdir/ r,
/newdir/** rwk,
3. sudo /etc/init.d/apparmor restart
4. sudo /etc/init.d/mysql restart

If that still does not work, check the nix permissions to be sure mysql is owner and group for the new directory recursively.
chown -R mysql:mysql “new datadir path”

Fatal error: Call to undefined function: curl_init in php

For some reason, my workstation with Ubuntu 9.04, php5, apache2 and php5-curl install was giving me the curl package not installed message. Well, it turns out that for some reason, my default /etc/php5/apache2/php.ini had the extension directory pointing to /usr/lib/php5/ext/ while all the extensions were in /usr/lib/php5/20060613/

I was trying to figure out why I am not seeing curl.so in the ext directory after I have apt-get installed and removed php5-curl many times.  Solution is usually very simple.

Ubuntu apache2 virtualhost setup problems

If you are getting error messages when starting apache2 like

“Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”
or
“[warn] _default_ VirtualHost overlap on port 80, the first has precedence”

you need to make sure a couple of lines are in your /etc/apache2/httpd.conf  file.

ServerName localhost

Ubuntu 9.04 Vmware Arrow Keys Problem

I finally found how to get all those keys working on my newly installed Ubuntu 9.04 with my XP VM. The issue is that all the arrow keys and delete key don’t work. There are others too but not listed. So a bit of googling, I found that you have to map the keys in a vmware config file to solve the problem. So this is what needs to be done.

1. Edit /usr/lib/vmware/config
2. Add the following to the end.

xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu

3. Save it
4. Restart vmware

Thank goodness. What a pain this was to use with a whole bunch of keys not working.

GRUB Error 21 Dual Boot Raid

I was installing Ubuntu to dual boot onto a newly added drive on my workstation that already has Windows XP. After the installation, GRUB gives me error 21. I looked through all the forums and help and tried everything from reinstalling GRUB to modifying menu.lst. Nothing worked. Then I figured out what the problem was. My system before adding the new drive had three drives; one with XP OS and two in a Raid 1 array for data. The issue was the Raid 1 array. With the new drive I added for Ubuntu, the computer had four drives. During installation, Ubuntu saw four drives and when installing GRUB, it pointed Ubuntu to boot on hd3,0. However, when GRUB tried to load, the BIOS was showing only three drives and hd3 was non-existent resulting in error 21.

Then I decided to move my SATA cables around so the location of the Ubuntu install does not change no matter if we saw the Raid 1 as one drive or two. So I kept XP on hd0, moved Ubuntu to hd1, and then having the Raid 1 drives to follow with hd2 and hd3. At this point, I reinstalled GRUB and tried to boot up again with the Raid 1 configured in the BIOS. Now I get GRUB error 17! What the heck is that? I found that if I got rid of Raid on the BIOS, error 17 goes away and GRUB comes up without a problem.

I got tired of trying to debug this and decided to just go all Ubuntu and just VM XP for the few things I still need to do on Windows.