Linux Configuration Notes
Version: | Red Hat 4.2 - installed September, 1997 |
Previous: | I have not published notes for for my earlier Slackware installations. |
Next: | Red Hat 5.2 |
The computer oceanpark.com started life on Windows 3.1 in November
1993, running Chameleon to provide connectivity to the internet. We
moved to Linux in July 1995. Slackware was used until January 1996
when we moved to Red Hat. The change from Slackware to Redhat was
motivated by a perception that RPM was easier to install and
upgrade. At that time, we needed to move to ELF binaries, so instead
of upgrading Slackware to ELF, we moved completely to RedHat 4.0,
which is ELF-based.
I have not used RPM yet. Instead I have been upgrading by acquiring
the latest RedHat release, doing a full install, and copying over
various configuration files from the previous install.
The latest upgrade was to Redhat release 4.2, kernel 2.0.30.
Date of upgrade: September
16, 1997.
Reason for upgrade -- to
change from SCSI as my primary hard drive to an IDE drive.
We have been experiencing
flakely behavior from the aic7xxx Adaptec SCSI driver. The problems became
intolerable recently, perhaps due to our increased use of a large (3.1 GB)
SCSI drive, our increasing use of swap memory to run a very large task,
and/or our attempt to use a SCSI Jaz drive as a backup facility. I went
to the net for help but was unable to resolve my problems. A search via
dejanews on 'aic7xxx' convinced me that the aic7xxx driver is buggy. Like
many problems with Linux (and other lesser operating systems such as Windows),
it is often a guessing game as to what is causing a problem and how to ultimately
resolve the problem. It may be that the aic7xxx driver works well for others.
The bottom line is that I decided to move to IDE, after using SCSI for over
two years. I hope to return to SCSI in the near future and still hope to
use SCSI for secondary disks, such as the Jaz drive.
My hardware is a Triton
chip set PCI motherboard, dubbed 82430VX on the box from Taiwan, fitted
with a Cyrix P166 CPU. I am using this motherboard in three computers, the
others being an NT box and a Windows 95 box. It performs well. The Linux
box has 64 MB of RAM, 2.5 GB Seagate ST5250A IDE hard drive on which I have
configured /, /home, and swap partitions. An Adaptec AHA-2940 Wide SCSI
card is present. For a while, I kept the 3.1 GB Quantum SCSI hard drive on
board, to have access to my previous / and /home partitions. A Jaz SCSI drive
is present and seems to work fine now, after a month of use under the new
configuration. This indicates to me that the aic7xxx driver may have only
been bothered by the Quantum drive. Who knows.
My disk partitionning strategy
is simple. Configure /home as a separate partition, sometimes on its own
drive. Configure one or two 100MB swap partitions (we run a very large lisp
process which implements an experimental system requiring large main memory
allocations). Configure all other directories under / in another partition.
Currently, I use 1GB for
/, 1.5GB for /home, and 100MB for a swap partition, which I place in between
the other two, hoping that aids performance. -0- Later, I will try moving
swap over to its own hard drive, maybe even a SCSI drive, to make it as
independent of the data drives as possible, under the theory that
that might increase performance.
For software, the main
things I configure are tcp/ip for oceanpark.com, CSLIP, firewalled inetd
daemons, the Apache web server, Samba, and some in-house software. I use
Samba to provide file service to NT and Windows 95 boxes on my LAN. If you're
curious, I use NT Server 4.0 as my primary workstation, as an SQL Server
database server, and an ASP Web server. Using Linux as the file server even
for NT is very convenient. It enables me to keep my files in one place so
that I can easily get to them from the net via telnetting in to Linux, it
allows sharing of mail and html files in Linux and NT, etc. I run an X-Server
on NT (X-Win32 by http://www.starnet.com)
and have emacs both on Linux and on NT.
With this background out
of the way, here are the steps I follow to upgrade of Red Hat Linux. This
is a surely incomplete list of things I do. However, I think I have the
order in which I do them right when that matters.
- Install Red Hat Linux
- Insert the installation floppy and follow the instructions, but note
the following...
- For the mouse, I still don't have it working because it's an old Logitech
mouse and I must have specified the wrong thing. But, when I get around
to it, /usr/sbin/mouseconfig is what I need to use to reconfigure it. I
do have it attached to /dev/cua0 (COM1 in DOS-speak).
- For X, I still don't have it working (but I mostly run X-clients to
my NT X-server)
- I don't use and don't want to use the Metro X-server. I have had the
XFree86 server running and the mouse running back in Red Hat 4.0 so I'll
modify these notes when I get around to making them both work in 4.x, x>1.
- For Default Gateway, I specify 198.211.65.1, which is oceanpark.com
itself.
- I set the hardware clock to GMT, (requires a BIOS adjustment of the clock).
- At the disk partitionning step, do EDIT...
- You are dropped into fdisk, a cryptic experience for the uninitiated.
- Use the 'm' command to see what you can do from fdisk.
- Create primary partitions only, using the 'n' command.
- Partition 1 is +1000M size
- Partition 2 is +100M in size
- Partition 3 is specified to take the remaining cylinders
- Use the 't' command to make partition 2 be type 82 (Linux swap)
- Use the 'a' command to make partition 1 be Active (what to boot from)
- Use 'p' to show the current partitions and be happy with what you see.
- Use 'd' to get rid of partitions you screwed up on and start over if
need be.
- Use 'q' to bail on fdisk back to Redhat, where you can do EDIT again
and start over.
- Exit fdisk via the 'w' command, putting you back in the Red Hat world.
- Specify to use /dev/hda1 as /
- Specify to use /dev/hda3 as /home
- Choose 'install everything' for what packages to install.
- Wait for fifteen minutes (on the Cyrix P166) for the install to complete.
- Red Hat is now installed.
- Reboot
- Mount the old partitions from the old hard drive which is physically
installed in the machine until we are sure we don't need it anymore and
can put it on ice. I do this as follows, more or less...
- login as root
- cd /
- mkdir home1
- mkdir oldroot
- mount <device of old home partition> oldhome
- mount <device of old root partition> oldroot
- use these mounts in the following steps to copy over old config files
- (In what follows, whenever a file is overwritten, mv the old one to
a file having the same name with the suffix .dist (for distribution) or
whatever.)
- Run /usr/sbin/makewhatis. This causes apropos (man -k) to work.
- Configure users
- cp /oldroot/etc/passwd /etc/passwd
- cp -arf oldhome/* /home
- cp /oldroot/etc/group /etc/group
- edit /home and /etc/passwd if you want to make some changes
- Note, adduser is a command you can use to add a new user
- Configure other files
- cp -arf /oldroot/usr/local/* /usr/local
- copy some information from /oldroot/var/log/ to /var/log/
- Configure CSLIP
- I found that until I had CSLIP working and was connected to the net,
I had problems making tcp/ip connections just over my LAN, so I do this
part early in the config.
- I am unable to get the built-in SLIP or PPP configuration tools to
work, so I run my own CSLIP script, dipwatch, a Perl script which I modify
to use the correct bash path, #!/bin/bash and correct dip path, /usr/sbin/dip.
- Add call to dipwatch to /etc/rc.d/rc.local
- Reboot and verify the full internet connectivity occurs and that it
is possible to telnet in from Windows boxes on the LAN.
- Configure SMTP
- Edit /etc/sendmail.cf -- change Cwlocalhost to Cwoceanpark.com
- Do not put a space character after the w in Cw.
- Do not make any other change to sendmail.cf
- Reboot and verify that mail can be sent and received via /bin/mail,
POP clients, etc.
- Configure TCP/IP access restrictions
- Edit /etc/hosts.deny and /etc/hosts.allow to secure what services are
offered to what hosts. I provide web service to the world but only permit
a small number of known hosts to use other services.
- Edit /etc/inetd.conf and comment out lines containing gopher, in.rshd,
and in.rlogind
- telnet oceanpark.com smtp
- verify that wiz, debug, and kill commands are not recognized
- Refer to Garfinkel and Spafford's book, Practical UNIX and Internet
Security
- Configure Web server
- cp -arf /oldhome/httpd/* /home/httpd
- Configure Samba
- In /etc/smb.conf, I add the sections, for reasons I forget...
[test]
path = /home
valid users = allard
public = yes
writeable = yes
[global]
security = SHARE
hosts allow = foo.oceanpark.com, @Borg
browseable = Yes
comment = Hacking Samba
[homes]
browseable = no
read only = no
create mode = 0750
- Then do /usr/sbin/smbd stop; /usr/sbin/smbd start
- Configure start-up and cron facilities, such as daily backup processing.
- Configure X
- Not done this time. Last time was a mess. Mostly, I hate 'virtual screens'
and I had to spend an inordinate amount of time figuring out how to get
rid of that feature. The online documentation did not use the same file
names as the installation created and there seemed to be about five redundant
links to everything which added to the confusion. Have fun with this one.
- Last time, one trick was to edit /etc/X11/XF86Config and in every Screen
Section, change "1280 1024" to "1024 768", since I
run at 1024x768.
- These notes on configing X are obviously not complete or adequate.
- Do man XF86Config and go from there
Partial List of Configuration Files, Directories, and Programs.
- /etc -- where almost all system configuration data resides
- /etc/resolv.conf -- network configuration of name server
- /var/log -- various logs of interest
- /var/log/xferlog -- ftp transfers
- /var/log/secure -- log of successful and refused attempts to access the system
- /var/run -- where server daemons usually place their pids (useful for kill -SIGHUP <pid>)
- /etc/issue -- dynamically rewritten by /etc/rc.d/rc.local
- /etc/fstab -- directory mounts done at boot time - edit with caution
- /etc/profile -- contains global environment variable settings (e.g. PERLLIB="/usr/local/lib/perl")
- /etc/bashrc -- contains global alias commands (e.g. alias ll='ls -l')
- /etc/hosts -- place entries for your LAN workstations
- /var/spool/mail -- don't forget to copy over from old disk so users don't lose mail
- /etc/group -- add new groups and associate users with a group
- /etc/passwd -- adduser places new user here, edit manually to change name, shell, etc.
- /usr/local/bin -- where I put in-house programs and scripts of general interest
- /usr/local/sbin -- where I put in-house system programs such as wwwstats, backup, etc.
- /etc/sendmail.cf -- SMTP configuration -- touch with caution
- /etc/inetd.conf, hosts.deny, hosts.allow -- TCP/IP security
- /etc/smb.conf -- Samba configuration
- /etc/crontab -- specification of what programs to automatically run at regular intervals
- /etc/services -- tcp/ip services -- I don't modify this, but of interest
- /etc/rc.d/ -- startup files -- see rc.local and rc.sysinit programs, below
- /etc/httpd/conf/httpd.conf/ -- The httpd web server configuration file (only need this one)
- /home/allard/dip/dipwatch -- Perl script which restores SLIP connection if connection down
- /etc/rc.d/rc.local - things to execute at boot time
- /etc/rc.d/rc.sysinit -- what kicks things off when Linux boots
- /usr/sbin/adduser -- to create a new user
- /usr/sbin/mouseconfig
- /usr/sbin/smbd {start/stop} -- turns on/off Samba daemon
- /usr/bin/free -- shows memory usage, including swap
- fdisk -l -- compare the output of this to the content of /etc/fstab
|