Thursday, June 29, 2006

Postgres setup

Installing Postgres isn't a problem using apt-get but setting up the first user and database had me foxed for a while.

First create a postgres user and database with your username. When using psql, you will open a database with your username as default, so its easier to create the table with your username at the start.
~$ sudo su postgres -c createuser yourusername
~$ sudo su postgres -c createdb yourusername
Now connect to your postgres database and alter the password the user that has just been created.
~$ sudo su postgres -c psql yourusername
=# ALTER USER yourusername WITH PASSWORD 'yourpassword';
=# \q
Don't forget the terminating ; in the SQL call. I found these helpful hints in the postgres manual for version 8.0:
http://www.postgresql.org/docs/8.0/interactive/user-manag.html

Dbase, PHP and Ubuntu

I needed to have PHP compiled with dBase for webdevelopment. dBase was dropped from the standard libraries of Ubuntu at version 5.04 and I couldn't find any solution for installing PHP with dBase support.

I don't imagine this will help the community much, but I had a specific need and finally worked out the solution. Its here mainly for my sanity should I need to replicate it in the future.

NB. It will work for the installation and removal of other PHP components.

Install some packages you'll need later on:
sudo apt-get install shtool dpkg-dev
Download the PHP source file
sudo apt-get source php5
We need to alter the rules to allow PHP compilation with dBase support.
Enter the new PHP directory
Edit the rules file ./debian/rules
Change the COMMON_CONFIG statement
add: "--enable-dbase \"
Now we need to build dependancies and then build PHP. The building of the dependancies requires a significant download and the PHP build tends to take a fair amount of time.
sudo apt-get build-dep php5
sudo dpkg-buildpackage
Once this has finally finished, the .deb files will have been created - if they aren't in the current directory try it's parent.

The final job is to install the new PHP library, copy it to the apache modules folder and then restart apache.
sudo dpkg -i php5*.deb
sudo cp ~/php5-*/apache2-build/libs/libphp5.so /usr/lib/apache2/modules/libphp5.so
sudo /etc/init.d/apache2 restart

Wednesday, June 28, 2006

Apache setup

I also want to be able to setup several virtual hosts on this machine, mainly for testing purposes. I want localhost to point to my website and localccc to point to my local version of www.carrubbers.org which is going to be a testbench.

I didn't want to have the document root as stipulated in the default setup and therefore needed to change the document root and directory definition in /etc/apache2/sites-enabled/000-default. For clarities sake, I also renamed it!

Tuesday, June 27, 2006

Saturday, June 24, 2006

nVidia working

It didn't take that long to get my nVidia card working in beautiful Xinerama. All I did was to install nvidia-glx using apt-get and then altered the "nv" instances in my xorg.conf to "nvidia".

My current working xorg.conf:

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/75dpi"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
# Load "GLcore"
Load "i2c"
Load "bitmap"
Load "ddc"
# Load "dri"
Load "extmod"
Load "freetype"
# Load "glx"
Load "int10"
Load "type1"
Load "vbe"
EndSection

## I N P U T D E V I C E S ##

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "gb"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

## M O N I T O R S ##

Section "Monitor"
Identifier "F-419-Left"

Option "DPMS"
Option "CalcAlgorithm" "CheckDesktopGeometry"
DisplaySize 386 290
HorizSync 30-82
VertRefresh 40-60
EndSection

Section "Monitor"
Identifier "F-419-Right"

Option "DPMS"
Option "CalcAlgorithm" "CheckDesktopGeometry"
DisplaySize 386 290
HorizSync 30-82
VertRefresh 40-60
EndSection

## D E V I C E S ##

Section "Device"
Identifier "NvidiaDH-Left"

BoardName "GeForce 6200"
BusID "1:0:0"
Driver "nvidia"
Option "hwcursor" "off"
Screen 0
VendorName "nVidia"
EndSection

Section "Device"
Identifier "NvidiaDH-Right"

BoardName "GeForce 6200"
BusID "1:0:0"
Driver "nvidia"
Option "hwcursor" "off"
Screen 1
VendorName "nVidia"
EndSection

## S C R E E N S ##

Section "Screen"
Identifier "Screen-Left"

Monitor "F-419-Left"
Device "NvidiaDH-Left"

DefaultDepth 24
SubSection "Display"
Depth 16
Modes "1280x1024"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768"
EndSubSection
SubSection "Display"
Depth 32
Modes "1280x1024" "1024x768"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen-Right"

Monitor "F-419-Right"
Device "NvidiaDH-Right"

DefaultDepth 24
SubSection "Display"
Depth 16
Modes "1280x1024"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768"
EndSubSection
SubSection "Display"
Depth 32
Modes "1280x1024" "1024x768"
EndSubSection
EndSection

## S E R V E R L A Y O U T #

Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
Option "Clone" "off"
Option "Xinerama" "on"
Screen "Screen-Left"
Screen "Screen-Right" RightOf "Screen-Left"
EndSection

Section "DRI"
Group "video"
Mode 0660
EndSection

Section "Extensions"
EndSection

Friday, June 23, 2006

Zend Studio library problem

As expected, difficulties emerged when trying to install Zend studio on my new AMD64 Ubuntu 6.06 installation.
awk: error while loading shared libraries: libdl.so.2: cannot open shared object
... Launching installer ...
grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory/tmp/install.dir.17548/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
The solution though was simple.
$ cp ZendStudio-5_2_0.bin ZendStudio-5_2_0.bin.bak
$ cat ZendStudio-5_2_0.bin.bak sed "s/export \ LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > \ ZendStudio-5_2_0.bin
For some reason, I also had to do the same on the ZDE binary after installation. The following should work assuming you chose the default location for zend installation:
$ cd /usr/local/Zend/ZendStudioClient-5.2.0/bin$ cp ZDE ZDE.bak
$ cat ZDE.bak sed "s/export \ LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > ZDE$ rm ZDE.bak

Thursday, June 22, 2006

Ubuntu 6.06 64AMD

I've just finished building my new AMD64 machine and the latest version of Ubuntu is being installed as a type (on my old machine). I anticipate to run into the usual problems but I think I have solutions to the expected ones already.

Graphics
- I have an nVidia 6600 dual-head graphics card and it never works out of the box. My xorg.conf will doubtless need some tweaking to get it working.

PHP - as a developer of http://www.carrubbers.org/ I have the requirement of having php compiled with dbase. There isn't a nice .deb package to allow me to do a simple apt-get install.

Zend
- I had Zend Studio and Server setup on my old machine and I remember a rather tedious process of getting them to play with each other.

Firefox
- from reading other posts, it looks like flash and realaudio won't work in a firefox implementation under AMD64.

I'll post how I get on.