Why Every DBA Should Learn Slackware – Part 2

We just finished installing Slackware and booted it up.  I feel like I am playing Zork here:

Slackware-firstboot

So where is my GUI?  What do I do now?  Well, Slackware comes with a pretty nice KDE desktop.  It just doesn’t start by default.  Probably a good thing if you are logged in as root.

Anyway, I created a low privileged oracle account with useradd, then logged into it and started the GUI:

$ startx

That gives us a nice GUI with a browser.  Slackware comes with a pretty current 2.4.x version of apache, but we want to compile it from source.  Besides being the most up-to-date, we will get all of our apache installation in one convenient location, /usr/local/apache2.  This will be important later.  We also need modowa, the Apache PL/SQL interface, so we will download it too:

Slackware-modowa

 

Anyway, after downloading Apache, ./configure, make, and sudo make install.  What could be easier?  Worked perfectly on Slackware, but when trying on OEL got a lot of dependencies missing.  Anyway, in order to install mod_owa, I need an Oracle client first.

Oracle only supports a few Linux distros like RHEL, OEL, and a few others.  So the OUI probably won’t work out of the box.  Oracle likes to hard-code paths to utilities such as make, gcc, etc instead of just using what is in the path.

So the simplest solution is to create a tarball of an already patched client installation from a supported distro, then extract it on Slackware, set your $ORACLE_HOME and $PATH and you are good to go:

 

Slackware-oracle-client

I know that this is an unsupported platform and cloning an ORACLE_HOME by extracting a tarball is not supported by Oracle, but it works just fine.  What we are dong in the next hopefully exciting instalment of this blog will be a lot less supported, but very worthwhile.  So lets install MOD_OWA now.  M

/home/oracle/modowa/apache24$ sudo cp mod_owa.so /usr/local/apache2/modules/
/home/oracle/modowa/apache24$ sudo cp mod_owa.conf /usr/local/apache2/conf/
/usr/local/apache2/bin$ ./httpd -k start
httpd: Syntax error on line 504 of /usr/local/apache2/conf/httpd.conf: Syntax error on line 1 of /usr/local/apache2/conf/modowa.conf: Cannot load modules/mod_owa.so into server: libclntsh.so.11.1: cannot open shared object file: No such file or directory

So that didn’t work.  We’ll have to set LD_LIBRARY_PATH to $ORACLE_HOME/lib.  Well do that in the .bash so it is always set:

/usr/local/apache2/bin$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
/usr/local/apache2/bin$ ./httpd -k start
/usr/local/apache2/bin$ tail -f ../logs/error_log 
[Thu Oct 22 17:46:18.315078 2015] [mpm_worker:notice] [pid 24375:tid 139988694828928] AH00292: Apache/2.4.17 (Unix) mod_owa 2.10.10 configured -- resuming normal operations
[Thu Oct 22 17:46:18.316160 2015] [core:notice] [pid 24375:tid 139988694828928] AH00094: Command line: './httpd'

In Apache, startup messages are in the error_log. From our error_log we can see that mod_owa was loaded when Apache was started,
so we are ready to begin setting up our PL/SQL website, which will be covered in the next instalment of this blog.

Comments are closed.