Securing-Optimizing-RH-Linux-1_2_163
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
163
[root@deep tmp]# tar xzpf portsentry-version_tar.gz
Compile and Optimize
You must modify the Makefile file of Portsentry to specify installation paths, compilation flag,
and optimization for your system. We must modify this file to be compliant with Red Hat file
system structure.
Step 1
Cd into the new Portsentry directory and type the following commands on your terminal:
Edit the Makefile file (vi Makefile) and change the following lines:
CC = cc
To read:
CC = egcs
CFLAGS = -O -Wall
To read:
CFLAGS = -O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro -
fomit-frame-pointer -fno-exceptions -Wall
INSTALLDIR = /usr/local/psionic
To read:
INSTALLDIR = /usr/psionic
The above changes would configure the software to use egcs compiler, optimization flags
specific to our system, and locate all files related to Portsentry software to the destination target
directory we have choose.
Step 2
Since we are using an alternate path for the files (i.e NOT in /usr/local/psionic), we need to
change the path to the PortSentry configuration file in the main portsentry_config.h header file.
Cd into the new PortSentry directory and edit the portsentry_config.h file (vi
portsentry_config.h) and change the following:
#define CONFIG_FILE "/usr/local/psionic/portsentry/portsentry.conf"
To read:
#define CONFIG_FILE "/usr/psionic/portsentry/portsentry.conf"
Step 3
Install Portsentry on your system.
[root@deep portsentry-1.0]# make linux
[root@deep portsentry-1.0]# make install
The above commands would configure the software to Linux operating system, compile, build,
and then install files into the appropriate locations.
Cleanup after work
[root@deep /]# cd /var/tmp
[root@deep tmp]# rm -rf portsentry-version/ portsentry-version_tar.gz