»   »   »

Setting up a Slackware Linux Oracle Server

Prelude

This is a set of instructions (to myself (in case I need to do a similar install in the future, or make modifications) and anyone else who's interested) on a setting up a Slackware server running an Oracle database. This is the 2nd in a series of Roqet servers, the first was here.

If you are using this document to setup your own system, please note that some version numbers of files/applications may have changed since this was written.

The distribution of GNU/Linux I chose for this workstation was Slackware.

The version of Oracle I used was Oracle 10g.

Why Linux?

The main reason I chose Linux were stability, security, affordability and usability. Linux gave me all of that. I also considered the various flavors of BSD, but found that I had become more comfortable with Linux over the last couple of years.

Why Slackware?

Simply put, my previous server was Slackware 7.1 and it hadn't given me any problems even after running for several years on obsolete hardware. So when I considered a new server Slackware was my first choice; Slackware Linux is the most robust operating system I've ever had (although I've seldom had any "stability" issues with any other Linux distribution).

Server Functions

The server is to be used as a fileserver, mail-collection server, database server and emergency workstation (if I can't use my other pc, then I would use this, which is why I have included a few installs like firefox).

Install Slackware

NOTE: One of the important things to know is the power management of your BIOS; in my case it uses ACPI, this does make a difference, because if you want the machine to automatically power-down when you shutdown and you have ACPI, then you need to choose the bareacpi.i kernel instead of the acpi.i kernel (which is the default), if your BIOS uses APM, then you can just choose bare.i.

For further reading: there are some more advanced setting options, taken from this book.

1. download the Slackware ISO images and burn them to CD (from one of the mirrors here, or from linuxiso.org):

wget http://www.linuxiso.org/download.php/472/slackware-10.1-install-d1.iso
wget http://www.linuxiso.org/download.php/595/slackware-10.1-install-d2.iso
cdrecord dev=0,0,0 -dao -data slackware-10.1-install-d1.iso
cdrecord dev=0,0,0 -dao -data slackware-10.1-install-d2.iso
    

2. insert the 1st CD and rebooted my PC. Follow partitioning advice using cfdisk from here.

3. run setup; unselect the GNOME and KDE disk-sets as the only desktop manager that will be used for this server is XFCE (xwindows is not required for the everyday opperation of the server, but it is necessary for the Oracle installation, and as I wanted to be able to use the server as an emergency workstation this is good to have anyway).

Follow the instructions for the "Full" install: Use here or here for examples (the latter is the "official" Slackware book, but it's a bit out-of-date.

Network

During the installation you can set your network connections, but if you want to modify your network settings later, use the netconfig utility. Another thing to remember is to update your /etc/resolv.conf file to add in any additional nameserver ip addresses (check your isp or your registrar for these - I use changeip.com to manage mine.)

For example these were my settings (changed for privacy):

hostname: myhost
domain: mydomain.org
static ip address: 192.168.1.21
netmask (local): 255.255.255.0
gateway address: 192.168.1.1 (that's where my router is)
accessing a nameserver? yes
nameserver ip: 63.210.174.80
after complete, edit /etc/resolv.conf,add a 2nd nameserver: 68.15.30.144
    

If you have other machines on your network with fixed IP Addresses, you can add their IP Adresses and names to your /etc/hosts file, then you can access them by name. Here's an example of my /etc/hosts file:

127.0.0.1               localhost
192.168.1.21            myhost.mydomain.org myhost
192.168.1.22            mydesktop.mydomain.org mydesktop
    

Lilo

The default Slackware boot manager is lilo, to reduce the amount of time it takes to boot Linux, modify the /etc/lilo.conf file:

timeout = 300
    

Then run /sbin/lilo.

Advanced Power Management

If you want your pc to power-down when you tell it to shutdown like it does in Windows, you may (depending on if your machine's power-management is APM or ACPI, mine was ACPI, and I didn't need to do this) have to edit the /etc/rc.d/rc.modules file, and uncomment the line:

/sbin/modprobe apm
    

Add Users

After the installation, the pc boots to the command line, with root being the only account on the system. Use adduser username to add new accounts as is shown here.

As an aside, if you want certain files to be placed in a new user accounts home directory, as root, add those files to the /etc/skel folder.

CDRW and CD-burning

The quick method of burning a cd is to use this command (where the .iso has been pre-created):

cdrecord -v -dao dev=ATAPI:0,0,0 /path-to-filename/filename.iso
    

Vim?

On Slackware, the command vi runs elvis, a vi text editor clone. If like me, you prefer vim(VIiMproved), then run this as root:

ln -sf /usr/bin/vim /usr/bin/vi

There is more on vim here.

Apache

There shouldn't be any need to change the defaults, but it's good to know that the configuration file is /etc/apache/httpd.conf, the webserver's files should be in /var/www/httpd and /var/www/cgi-bin .

To start the webserver (should automatically start on system startup), run: /etc/rc.d/rc.httpd start and to stop it (also automatic during system shutdown): /etc/rc.d/rc.httpd stop

A couple of things to note:

Files should be given 644 permissions chmod 644 filename.html.

A personal note:I had to change the default port from 80 to 3332 as my cable company blocked port 80, the file to change if you need to do this is /etc/apache/httpd.conf, look for the default port of 80 and change it, then also look for the line containing "Listen", un-comment this, and change it to 3332 (I arbitrarily chose 3332, but you can use any unused port - the higher the better).

To build your own 404 Error page (if someone types in a non-existant URL), simply edit your /etc/apache/httpd.conf file; uncomment the line:

#ErrorDocument 404 /missing.html, and change /missing.html to whatever you want your customized 404 error page to be, then create that page, chmod 644 (change permissions to read) that file, and restart your apache server as mentioned above.

Fortune

The fortune program automatically runs on each login, this wears a bit thin after a while, change the permissions of the /etc/profile.d/bsdgames.sh file to get rid of it:

chmod -x /etc/profile.d/bsd-games-login-fortune.sh
    

A friendly Welcome

To display a friendly welcome message to those who login to the server, created a welcome file (all the .sh files in /etc/profile.d are run at login (provided they have the correct permissions):

cat > /etc/profile.d/welcome.sh 
#!/bin/sh
# roqetman additions:
serverdate=`date`
echo Server: $serverdate :: Welcome to myhost.
    

Then type: chmod +x /etc/profile.d/welcome.sh

Mouse Wheel modifications

If for some reason, your mouse-wheel wasn't detected, here's what you can do to get it to work: edit /etc/X11/xorg.conf, and add the following to the "Pointers" section:

Option "ZAxisMapping" "4 5"
Option "Buttons" "5"
Option "Protocol" "IMPS/2"
    

SSHD Secure Remote Access

This is documented here.

Keeping Slackware Secure

This is my general security document.

Upgrading Slackware

Keeping Slackware up-to-date with Swaret is documented here.

Perl and CPAN

The Perl language is installed by default, as is CPAN. CPAN (Comprehensive Perl Archive Network) is the source for Perl modules and extensions. Thousands of useful modules and libraries are available in this repository, all are free. To get CPAN configured, type: cpan, then once cpan has started, type: o conf init. You should be able to accept the defaults from there, the important thing to find out is the correct URL's, which you can get from here; for example, I currently use: ftp://cpan.erlbaum.net/ and ftp://ftp.rge.com/pub/languages/perl/ as I'm close to NY, USA.

VPN and Remote Desktop

This is documented here.

Pine

My preferred command-line email client is Pine.

I have a document on this that includes how to collect and send mail with an MS Exchange server, a VPN, fetchmail and Pine here.

Calendar

pal is a very cool comand-line calendar and appointment reminder program, available here.

Newsreaders

To allow users on your server to connect to a news server, add the following line to your /etc/profile file: export NNTPSERVER=news-server.somewhere.com 

(where news-server.somewhere.com is the name of your own news server).

There are many command-line news readers you can use. One called Gnus comes with emacs. My personal favorite is slrn; it is simple and quick to configure and use - I have created a document for it here.

XFCE and XWindows

XFCE is a lightweight desktop manager.

By default Slackware loads into the command-line, which is the way it should be for a server. To start up xwindows type: startx. If you chose XFCE in the install, then that will be the manager that loads. If you want to change it at some time in the future, then go to the /usr/X11R6/lib/X11/xinit folder, and copy your chosen desktop manager to the xinitrc file, for example: cp xinitrc.xfce xinitrc.

Firefox web Browser

There are several ways to install this, but I suggest the Slackware way; go to LinuxPackages and download it, then as root: installpkg mozilla-firefox-1.0.3-i686-1jim.tgz

Sendmail

Unlike on my old server, I did not set this server to relay mail, or allow the sending of mail outside of my network. This is primarily due to SMTP Authentication restrictions that are now becoming commonplace. Instead, when I send mail, I send it using my ISP's SMTP server, or my registrar's permitted relay.

However, I still like to have sendmail active as I like to allow mail between accounts on the server. I also have an antivirus on my Windows machine that I set to email the server if it finds a virus. This required me to set up a relay just for that IP Address like so:

Edit /etc/mail/access and put the following in the file:

#domain/ip address to accept mail from
192.168.1.111 RELAY
    

Once your changes are done, you need to recreate the access database:

makemap hash /etc/mail/access < /etc/mail/access

And then restart sendmail by typing:

killall -HUP sendmail

If you want to add a few local email aliases, edit the /etc/mail/aliases file, and then type newaliases

Fetchmail

I have documented fetchmail settings (including those to collect Gmail) here.

POP Access

To allow other machines to collect mail from the server, enable POP access: modify the /etc/inetd.conf file (uncomment the POP and imap lines).

Sound Configuration

If the install didn't autodetect your sound card...

From the command line (as root) type alsaconf for sound configuration.

After the initial configuration, run alsamixer or gamix to set volumes etc. and alsactl store to save your settings, for example:

alsaconf 
alsamixer 
alsactl store
    

Samba

This is documented here.

Install of Oracle 10g

This is documented here.

Questions?

On This document? Contact me here.

Where to find documentation on your system: in the /usr/doc directory.

More Linux Command-line commands?

More on Slackware? - There is a great book online called Slackware Linux Essentials.

The Slackware recommended forum

The linuxpackages.net Slackware forum

Questions on Linux in general?

Oracle help can be found at the Oracle Technology Network.

The Oracle Usenet Newsgroup.

© Roqet :: 2022-03-01 16:07:34