Lab Questions

 < Day Day Up > 



Lab 1

1. 

In this lab, you'll create a private directory for a group of engineers designing some galleys. You'll want to create a group named galley for the engineers named mike, rick, terri, and maryam. They'll want to share files in the /home/galley directory. What do you need to do?

this is a straightforward process, using the following basic steps: a. create accounts for mike, rick, terri, and maryam if required. you can use the useradd command, edit the /etc/passwd file directly, or work through the red hat user manager. b. set up a group for these users. configure a group id outside the range of your regular users with a line such as: galley::10000:mike,rick,terri,maryam c. create the /home/galley directory. give it proper ownership and permissions with the following commands: # mkdir /home/galley # chown nobody.galley # chmod 2770 /home/galley

Answers

1. 

This is a straightforward process, using the following basic steps:

  1. Create accounts for mike, rick, terri, and maryam if required. You can use the useradd command, edit the /etc/passwd file directly, or work through the Red Hat User Manager.

  2. Set up a group for these users. Configure a group ID outside the range of your regular users with a line such as:

    galley::10000:mike,rick,terri,maryam
  3. Create the /home/galley directory. Give it proper ownership and permissions with the following commands:

    # mkdir /home/galley # chown nobody.galley # chmod 2770 /home/galley

Lab 2

1. 

In this lab, you'll configure the tmpwatch script in /etc/cron.daily to delete files from the /var/log/httpd directory on a periodic basis. You're doing this because the data that comes through your Web server is overwhelming your system. Unless you delete older files from this directory on a periodic basis, the data will crowd out the space needed by your users. Presumably, you're doing this until your new hard disk array is ready in a few weeks.

in this lab, you ll want to set up a command in the tmpwatch script in the /etc/cron.daily directory, which deletes files that haven t been accessed for a certain number of hours. the commands in the default version of this script can help guide you in this process. for example, if you wanted to delete files that haven t been accessed in more than 30 calendar days, you just need to translate this into the equivalent number of hours. thus, all you need to do is add the following command to the noted script: /usr/sbin/tmpwatch 720 /var/log/httpd

Answers

1. 

In this lab, you'll want to set up a command in the tmpwatch script in the /etc/cron.daily directory, which deletes files that haven't been accessed for a certain number of hours. The commands in the default version of this script can help guide you in this process. For example, if you wanted to delete files that haven't been accessed in more than 30 calendar days, you just need to translate this into the equivalent number of hours. Thus, all you need to do is add the following command to the noted script:

/usr/sbin/tmpwatch 720 /var/log/httpd

Lab 3

1. 

For this exercise, use a test computer. Do not use a production computer. Do not use a computer where any data might be important to you. If something goes wrong, and you are unable to restore from a backup, you may need to reinstall Linux. This exercise assumes that you're using the default Red Hat Enterprise Linux boot loader, GRUB.

Navigate to the /boot directory. Change the name of the initrd-versionnumber.img file. Make sure it's something easy to remember such as initrd-versionnumber.bak. Reboot Linux. As GRUB goes through the boot sequence, it will probably stop when it can't find your Initial RAM Disk (initrd) file, similar to what is shown in Figure 11-14.

click to expand
Figure 11-14: A boot failure

Now that your boot loader isn't working, what do you do? Can you try to start Linux in single-user mode?

as you practice learning about linux for the rhce exam, it s important to know how grub works. by default, it requires an initial ram disk file, initrd- versionnumber .img. if grub can t find this file, it ll give you the error shown in figure 11-14 . since your computer does not boot, you ll need to boot with a rescue disk before you can fix the initrd file. remember to make sure that the filename matches the name shown in /boot/grub/grub.conf exactly. you can repeat this process with the vmlinuz file or the root directive in grub.conf. make sure to have backups of key files so you can restore your original configuration. when you repeat this process, what happens after you select a kernel from the grub menu? do you see a different error? is it associated with a different file? understanding these answers can help you learn to use grub messages to better diagnose specific problems with linux.

Answers

1. 

As you practice learning about Linux for the RHCE exam, it's important to know how GRUB works. By default, it requires an initial RAM disk file, initrd-versionnumber.img. If GRUB can't find this file, it'll give you the error shown in Figure 11-14. Since your computer does not boot, you'll need to boot with a rescue disk before you can fix the initrd file. Remember to make sure that the filename matches the name shown in /boot/grub/grub.conf exactly.

You can repeat this process with the vmlinuz file or the root directive in grub.conf. Make sure to have backups of key files so you can restore your original configuration. When you repeat this process, what happens after you select a kernel from the GRUB menu? Do you see a different error? Is it associated with a different file?

Understanding these answers can help you learn to use GRUB messages to better diagnose specific problems with Linux.

Lab 4

1. 

Your company bought another competitor on the opposite coast recently, just as the new corporate application was being deployed everywhere, so you sent the app to them, too. They use a Unix host for this application on their network. You need to be able to connect to this host for maintenance purposes on the new system-wide application you deployed. Both networks have Internet access.

if you need access now, and both systems are connected to the internet, you can set up ssh for secure communications. if the other network does not already have it installed, have them download it from the internet, install it, and then create an account for you. the basic steps which are outlined here may vary with the version of unix used on the other network. get the openssh utility source from the net and put it into a specific directory. since rpms are not yet made for unix, you ll need to unpack a tarball. you can then unpackage the files in the tarball and use the files in the resulting directory to compile and configure a secure shell server. once it is configured, set up private and public keys. if you don t need immediate access, you could, alternatively, configure a computer with linux and a secure shell server. send the computer to the administrator of the remote unix network. have them add it to their network, and you can check the problem from your site securely. the application is running on the linux computer that you sent. (alternatively, you can even set up openssh on microsoft windows, as described earlier in this chapter.)

Answers

1. 

If you need access now, and both systems are connected to the Internet, you can set up SSH for secure communications. If the other network does not already have it installed, have them download it from the Internet, install it, and then create an account for you.

The basic steps which are outlined here may vary with the version of Unix used on the other network.

Get the OpenSSH utility source from the Net and put it into a specific directory. Since RPMs are not yet made for Unix, you'll need to unpack a 'tarball.' You can then unpackage the files in the tarball and use the files in the resulting directory to compile and configure a Secure Shell server. Once it is configured, set up private and public keys.

If you don't need immediate access, you could, alternatively, configure a computer with Linux and a Secure Shell server. Send the computer to the administrator of the remote Unix network. Have them add it to their network, and you can check the problem from your site securely. The application is running on the Linux computer that you sent. (Alternatively, you can even set up OpenSSH on Microsoft Windows, as described earlier in this chapter.)

Lab 5

1. 

In this lab, you'll create new PEs, and use them to increase the size of a configured LV. You're doing this for the LV used by the /var directory. Because of the increasing demands of your Web site, you need more room for the /var directory for your Web site data. Assume your /etc/fstab configuration file includes the following line:

/dev/Volume00/LogVol00  /var   ext3   defaults   1 2

You've created PEs from the /dev/sde and /dev/sdf hard drives, and have just added another SCSI hard drive, /dev/sdg. Assume you've backed up the data that you need from the /var directory.

if you ve just added the new hard drive, you ll need to set up partitions or use the entire hard drive for pes. based on the premises of the lab, you have the entire scsc /dev/sdg hard drive available, so you can just allocate this entire hard drive as pes with the following command: # pvcreate /dev/sdg the next step is to extend the vg, volume00, to include the newly configured pes. you can do so with the following command: # vgextend volume00 /dev/sdg with the additional pes at your disposal, you can increase the size of the lv allocated to the /var directory. for example, if you wanted to increase the size to 2gb, you could run the following command: # lvextend -l2g /dev/volume00/logvol00

Answers

1. 

If you've just added the new hard drive, you'll need to set up partitions or use the entire hard drive for PEs. Based on the premises of the lab, you have the entire SCSC /dev/sdg hard drive available, so you can just allocate this entire hard drive as PEs with the following command:

# pvcreate /dev/sdg

The next step is to extend the VG, Volume00, to include the newly configured PEs. You can do so with the following command:

# vgextend Volume00 /dev/sdg

With the additional PEs at your disposal, you can increase the size of the LV allocated to the /var directory. For example, if you wanted to increase the size to 2GB, you could run the following command:

# lvextend -L2G /dev/Volume00/LogVol00



 < Day Day Up > 



RCHE Red Hat Certified Engineer Linux Study Guide[c] Exam (Rh302)
RCHE Red Hat Certified Engineer Linux Study Guide[c] Exam (Rh302)
ISBN: 71765654
EAN: N/A
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net