Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search

4. Configure Environment

After installing Sybase, you need to setup the Linux environment in order to allow clients to connect to the dataserver.

The first thing we need to do is to set certain environment variables in /etc/profile. Open /etc/profile as super user and insert the following lines:

    export SYBASE=/opt/sybase
    export SYBPLATFORM=linux
    export LD_LIBRARY_PATH=$SYBASE/lib
    export LC_ALL=default
    export PATH="$SYBASE/bin:$PATH"
    export DSQUERY=SYBASE

Next you need to change to permissions of the Sybase directory. This fixes some problems where PHP is unable to connect to the Sybase server. Run the following command as super user:

chown -R sybase:sybase /opt/sybase

To test whether your Sybase environment works, type the following:

    # su - nobody
    $ isql -Usa -P
    1> sp_helpdb
    2> go

You should see a list of databases. To test whether you can use the sample datebase, now type:

    1> use pubs2
    2> go
    1> select * from titles
    2> go

If you a list, you have sucessfully set up Sybase.

NOTE: You may need to do the following in order for PHP to be able to access Sybase. Edit the file /opt/sybase/install/rc.sybase and remove the line that says:

    unset LANG; unset LC_ALL; \ 

I don't know why that line is there, but it can stuff things up.

NOTE: Some people have reported problems with the way the Sybase init scripts try to guess the Sybase directory. If you see the following error:

    errorerwerqwerqwerwerwer

when trying to run sybinstall.sh or rc.sybase, then you need to change

You may also want to add sybase to the list of services to run at boot time. To do this execute the following commands:

    # ln -s /opt/sybase/install/rc.sybase /etc/rc.d/init.d/sybase
    # ln -s /etc/rc.d/init.d/sybase /etc/rc.d/rc3.d/S15sybase
    # ln -s /etc/rc.d/init.d/sybase /etc/rc.d/rc3.d/K15sybase

Now Sybase will start whenever you boot into runlevel 3.

NOTE: The note for

4.1. Preconfigure Apache

Download and unpack the latest Apache distribution. In the Apache directory issue the following command:

    # ./configure --prefix=/usr/local/apache

I think the 'prefix' value specifies where you want to store your html files; I just set it to the same as the apache install directory, where Apache will put its files when you run 'make install'.