Search:  
Gentoo Wiki

HOWTO_Sybase_ASE_12.5.2


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Introduction

With a lack of general information on how to install Sybase Adaptive Server Enterprise (hence forth known as Sybase ASE, or just ASE) on Gentoo Linux, I decided it was time to write some documentation. Gentoo is not an officially supported platform for running ASE, however, it can and will work just fine. This documentation was written for x86 platform using ASE 12.5.2 Developer edition. The following is the general configuration of the machine involved:

- gentoo-sources-2.6.12-r10
- sys-libs/glibc-2.3.5-r1 (using nptl, nptl-only, glibc-compat20, linuxthreads-tls, nls, pic, userlocales )
- AMD Athlon 2600+
- 1 GB of RAM

You can get a developer's edition of Sybase ASE at http://www.sybase.com

Meet the requirements

Patch the OS

The first thing you should do is ensure your machine has the latest glibc. If you don't wish to upgrade, make certain you have at least 2.3.2-95.3 or later. Secondly, ensure your kernel is at least 2.4 or later. Sybase recommends hardware of at least a pentium 2, 230Mhz processor. and about a gigabyte of disk space for the install.

Create a sybase user account

You should be running and installing your ASE under a user other than root to keep your system secure. So, in this step we will create a sybase user and group and lock it down.

  1. Create a sybase group: groupadd sybase
  2. Create a sybase user with a home directory of where ever you want to install ASE to (in this HOWTO, we use sybase's default: /opt/sybase): Template:Commndline
  3. Set a password for the sybase account: passwd sybase, or better yet, lock the sybase account: passwd -l sybase

Configure shared memory

Sybase requires at least 64MB of system wide shared memory. Unfortunately, most linux distros, including Gentoo are configured with on 32MB, by default. To verify that your system has not been configured with more, issue the command /sbin/sysctl kernel.shmmax. If it doesn't report at least 64MB, or 67108864 bytes, then perform one of the following: - To temporarily increase the shared memory until next reboot issue the following: /sbin/sysctl -w kernel.shmmax=67108864 - To increase it permanently, edit /etc/sysctl.conf to include the following:

File: /etc/sysctl.conf
kernel.shmmax = 67108864

To make this take effect from now on issue a /sbin/sysctl -p.

Set your hostname

If any of the following commands fail, then your hostname is not correctly set up. If your hostname is not correctly set, then the Sybase installer will likely die or hang (with no warnings or error messages) when you try to configure the SQL Server component.

# uname -n
# hostname -a
# hostname -s
# hostname -d
# hostname -f
# hostname

If any of these commands do not show your proper hostname or error out then follow the instructions below to resolve the issue. Otherwise you can skip to the next section.

Edit /etc/hosts

If you have a DHCP assigned IP address then you should have at least the following in your /etc/hosts file:

File: /etc/hosts
127.0.0.1	mybox.mydomain.com	localhost.localdomain localhost mybox

If you have a static IP Address, ensure /etc/hosts has at least the following (replace 192.168.0.10 with your own IP):

File: /etc/hosts
127.0.0.1	localhost.localdomain localhost
192.168.0.10	mybox.mydomain.com	mybox

The "hostname" command

Log into your box as root and issue the following command (where <mybox> is your hostname):

# hostname <mybox>

Check that the hostname is set by running hostname with no parameters. This will only resolve the issue until you reboot.

The hostname service

Gentoo comes with an initscript that will set your hostname correctly upon boot. This script is /etc/init.d/hostname (surprise, surprise) and is configured via the /etc/conf.d/hostname file. Make sure you have the following in the config file:

File: /etc/conf.d/hostname
HOSTNAME="mybox"

Next ensure that the hostname initscript is part of your "boot" runlevel (must be run as root):

# rc-status boot | grep "hostname"

If no results are returned, then add the hostname script to the boot runlevel (again as root):

# rc-update add hostname boot

At this point you will want to restart your machine before continuing with the install. If you had the hostname initscript running, do NOT perform a /etc/init.d/hostname restart or ~98% of your services will be stopped and restarted.

Install Sybase

If you downloaded the developer edition of ASE from Sybase, unpack the tarball:

# tar -xvzf ase1252_de_linux.tgz

Now we need to switch to the sybase user. If you have not locked the sybase account, then you can issue the following command as any user, otherwise you need to issue the command as root:

# su - sybase

If you run this command as a non-root user, then enter sybase's password.

Warning: If you are running glibc version 2.4 or later, make sure that LD_POINTER_GUARD variable is set to 0 for the sybase user, otherwise sybase will segfault.
Warning: Looks like sybase ASE up to 15.0.2 version does not work with glibc 2.5 and later at all. Best choice is to use glibc 2.3 version which is default for 2006.0 gentoo release

Next, run the sybase installer. If you are running an x-windows session then issue the following command:

# ./setup

Otherwise, to go through a text-only install, issue this command:

# ./setup -console

The default options should install the following components:

Sybase Servers
  Adaptive Server Enterprise
     ASE Diagnostic Server
  Replicator
  SQL Remote for ASE
Connectivity
  Open Client
     Common ctlib files
     Common dblib files
ASE Data Providers
Language Modules
jConnect 5.5 for JDBC
jConnect 6.0 for JDBC
Shared
ASE Adminstration Tools
  Sybase Central
  Adaptive Server Plugin
  Job Scheduler Templates and Utilities
Sybase Software Asset Management

for a total size of 577.5 MB.


Compile PHP with Sybase support

by dg(at)sad.lv

Setting up php with sybase-ct support is not trivial thing. There are a lot of hidden quirks.
To compile php with ASE-15 following steps are needed:
ASE-15 is installed into /opt/sybase/ by default with open source stuff in /opt/sybase/OCS-15_0/. So we need right path before compilling:

# export EXTRA_ECONF="--with-sybase-ct=/opt/sybase/OCS-15_0/"

Sybase wants some extra variables, especially LDPATH. Lets create some thing like this:

File: /etc/env.d/80sybase
SYBASE="/opt/sybase"
LDPATH="/opt/sybase/OCS-15_0/lib"
SYBASE_ASE="ASE-15_0"
PATH="/opt/sybase/ASE-15_0/bin:/opt/sybase/ASE-15_0/install"
SYBASE_OCS="OCS-15_0"
PATH="/opt/sybase/OCS-15_0/bin"
LD_LIBRARY_PATH="/opt/sybase/ASE-15_0/lib:/opt/sybase/OCS-15_0/lib:/opt/sybase/OCS-15_0/lib3p"
INCLUDE="/opt/sybase/OCS-15_0/include"
LIB="/opt/sybase/OCS-15_0/lib"
SYBROOT="/opt/sybase"

Check out /etc/ld.so.conf for /opt/sybase/OCS-15_0/lib and remember to run ldconfig.

Sybase libraries has strange dependencies, so few more hacks needed. In folder /opt/sybase/OCS-15_0/lib copy files like this:

# cd /opt/sybase/OCS-15_0/lib
# cp libsybcomn.so libcomn.a
# cp libsybcs.a libcs.a
# cp libsybct.a libct.a
# cp libsybintl.a libintl.a

Now you can try to compile PHP. Аминь.

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Sybase_ASE_12.5.2"

Last modified: Fri, 05 Sep 2008 06:27:00 +0000 Hits: 14,326