ServerXchange Troubleshooting Guide 31
Linux tips
This section contains Linux commands and tips for using ServerXchange.
Booting the system from CD-ROM
If a Linux system does not automatically boot from the CD-ROM, press F2 or Del to display the Setup window. From the Setup window, select the device the system boots from first (such as CD-ROM, diskette, or hard drive). After you save your changes, the system will reboot.
Installing the operating system
When you install Red Hat 6.1, the installation script will ask you what type of system configuration you want to install.
• Gnome workstations
• KDE workstations
• Server
• Custom
Select Custom. When the script lists the software packages, select:
• Mail/WWW/News tools
• Networked Workstation
The installation can take anywhere from 20 minutes to two hours, depending on what option you are installing and how fast the CD-ROM and hard drives are.
Partitioning the system
Table 5shows the partitions and their recommended sizes.
If a local partition will be used to store the Private Servers (such as/export, /usr/ensim), the partition should be large enough to support the number and size of the Private Servers planned. Anywhere from 500 to 1000 MB+ per Private Server might be needed.
Table 5. Partition size (Linux)
For this partition: Specify:
/boot 50 MB
swap At least 256 MB for a production system.
Make swap larger if more total memory will be needed to support the Private Servers.
/ The rest of the drive.
/usr (optional) At least 1 GB to support the default file system.
/var (optional) At least 1 GB to support the operating system.
/home (optional) At least 500 MB.
Linux tips
ServerXchange Troubleshooting Guide 33
Networking tips
IP address/netmask
To change network settings, use the netconf/linuxconf utilities or manually adjust the network files. To make temporary changes, use ifconfig/route commands at the command line. For example:
ifconfig eth0 inet 192.168.1.5 netmask 255.255.255.0
Ensim provides scripts to help automate adding and deleting IP aliases on Linux Private Servers.
/sbin/aifconfig alias IPADDRESS /sbin/aifconfig delete IPADDRESS
Use the following command to make the changes take effect.
/etc/rc.d/init.d/network restart
To verify current network settings, look at the values in /etc/sysconfig/network.
DNS
If you encounter problems resolving host names, verify that /etc/resolv.conf has a nameserver entry and a search domain entry (if appropriate).
nameserver 192.168.1.3
search ensim.com ops.ensim.com
Also, in /etc/nsswitch.conf, the hosts line should reflect the order in which host names should be looked up. For example, dns should be first if you want the DNS server to be queried first; hosts should be first if you want the local hosts file to be queried first.
You can also use netconf or linuxconf to configure these settings.
Routing
To add a gateway, use the command:
route add default gw 192.168.1.1 To delete a gateway, use the command:
route del default gw 10.0.0.1 1
To see the routing table, use the command netstat -rn.
Common command locations
• pingis in /bin/ping.
• nslookupis in /usr/bin/nslookup.
• ifconfigis in /sbin/ifconfig.
Adding users
Use the useradd command to add users.
useradd admin passwd admin
Using CD-ROMs and diskettes
Table 6shows common commands for using CD-ROMs and diskettes.
Table 6. CD-ROM/diskette commands
To: Use this command:
Mount a CD-ROM mount /mnt/cdrom Unmount a CD-ROM umount /mnt/cdrom
Eject a CD-ROM eject
Mount a diskette mount /mnt/floppy
Linux tips
ServerXchange Troubleshooting Guide 35
Adding and viewing packages
The Linux equivalent of a Solaris package is an RPM.
To add an RPM, use the rpm command.
Example:
rpm -ivh <rpm name>
To remove an RPM, use the rpm -e or rpm -uninstall command.
Example:
rpm -e sharutils
rpm -uninstall <rpm name>
To list all RPMs on the system, use the following command.
rpm -qa | more
To list a specific RPM, use the RPM name.
rpm -q <rpm name>
To list the files related to an RPM, use the following command.
rpm -q -l <rpm name>
Unmount a diskette umount /mnt/floppy Format a diskette mkfs -t <fstype> /dev/fd0
Note: When uninstalling, use the RPM name, not the RPM file name.
Table 6. CD-ROM/diskette commands (continued)
To: Use this command:
Daemons
• Main system startup scripts reside in /etc/rc.d/rc3.d/*.
• Edit /etc/inetd.conf for inetd settings.
• Edit /etc/rc.d/init.d/* scripts for startup scripts.
• To prevent daemons from starting when the server starts, use the following command.
chkconfig on/off <daemon_name>
Log files
• /var/log/*
• /var/log/messages
• /var/log/sulog
Memory management (swap)
Linux kernel 2.2.12 will support up to eight swap partitions of 2 GB each. You need 1K of kernel memory per megabyte of swap space. Make sure that you allocate enough swap space when you install the server, swap partitions are faster than swap files. If you need to increase your swap space you can create swap files.
To see swap areas, look in /proc/swaps.
To create a Linux swap area:
1 Create a swap file using a command such as:
dd if=/dev/zero of=swapfile bs=1024 count=65536
2 Use the command mkswap to create the swap area:
mkswap [-c] [-vN] [-f] device/file [size]
The size parameter is superfluous; it is used for backward compatibility. It specifies the size of the swap area in 1024-byte blocks. Do not omit device/file;
mkswapwill use the entire partition or file if you do.
Linux tips
ServerXchange Troubleshooting Guide 37
Example:
mkswap -v1 /swap/swapfile 131072
This command makes a swap file called swapfile that is 128 MB in size.
3 Add the following line to your /etc/fstab file.
/swap/swapfile swap swap defaults 0 0
4 To begin using the swap area, use the swapon command.
/sbin/swapon -a
If you have no errors, use the following command to see if the swapon command is running.
[root@ps199 /swap]# swapon -s
This command returns data similar to the following.
Filename Type Size Used Priority
/dev/sda6 partition 610428 0 -3
/swap/swapfile file 131064 0 -4