Installing Linux for LAMP

From T5C

Jump to: navigation, search

Contents

[edit] Download CentOS

You can find the ISO images for CentOS at http://www.centos.org following the Download link. For the purpose of this procedure, you only need the first install CD. If your machine has an Intel EM64T or AMD 64 processor (Athlon 64 or Opteron), you can download the x86_64 or i386 ISO image. You must download the i386 ISO image for all other processor types. After downloading, you can burn the ISO image on a normal CD-R or CD-RW disc.

[edit] Boot from the CD

Insert the Disc 1 CD into your machine's primary CD drive and reboot. Make sure the BIOS is configured to boot off the CD drive prior to checking the fixed disks. After the boot sequence you should see this screen:

At this prompt you can enter various commands to customize the installation process. You could enter

 linux text

to proceed in text only mode with no graphics. We will assume normal installation and thus no entry is required here. You can wait for the timer to expire or press Enter.

[edit] Installer Environment Config

In the next few screens you select the language and keyboard options for the installation program. We will assume English (U.S. or International) for this HowTo.

[edit] Installation type

We will select a Custom installation type to have maximum flexibility and control of the components of our Linux installation.

[edit] Disk Partitioning Mechanism

Once again, we want maximum control over the final installation, so we will select the Manual Partitioning option here.

As the following screen shot displays, we are not preserving any data in this process. The following steps will indeed destroy all existing data on your drives!

This will take us to the Disk Druid, the interface for partitioning our disk drive(s). At the bottom of the screen we can see a summary of the drives and partitions at any given point during the process.

A recommended partitioning scheme is as follows:

Recommended LAMP partitioning scheme.
Partition Size Filesystem Description
/boot 128 MB ext3 Holds the kernel.
swap >= RAM swap Should be greater than or equal to installed RAM.
/home 4 GB ext3 User home dirs can be used as download area.
/tmp 512 MB ext3 Volatile data.
/ 4 GB ext3 Root filesystem.
/var Space left ext3 Variable data such as web roots and mail folders.

[edit] Boot Loader Setup

GRUB is the current popular boot loader for many Linux distros. Be sure to accept the defaults and set a GRUB password for enhanced security.

[edit] Network Setup

A server needs a static IP address and DNS server configuration. Disable DHCP, enter the IP address, subnet mask, default gateway, and DNS server addresses. Be sure the primary network interface is set to be activated on machine startup.

[edit] Firewall / SELinux Setup

Enable the firewall and select Web (HTTP 80) and SSH (22) traffic to be allowed through. Set SELinux to disabled since there are still many applications that are incompatible with it.

[edit] OS Language

In this screen, you specify the desired language for the operating system that will be installed to disk.

[edit] Timezone

Specify the timezone for the OS installation and be sure to check the UTC setting.

[edit] Root Password

In this screen, you must assign a password to the special root account. The root account is also known as the superuser in UNIX systems. It has full administrative privileges on the entire operating system and its applications. For this reason, this should be a very complex password consisting of at least 8 alphanumeric characters including special punctuation characters such as asterisks and underscores. Do not write this password down. It should be memorized or stored in a sealed envelope in a secure location.

[edit] Package Selection

Since this is a server installation and we are seeking maximum performance and efficiency, we will clear all check boxes in the package selection list. Note that you should clear all check boxes versus simply clicking on the Minimal option. The Minimal option is best suited for firewalls and other special-purpose configurations but lacks many features we need for our LAMP server.

[edit] Ready to Install

This screen normally summarizes the required CDs you would need to complete the installation of CentOS. Since we unchecked the check boxes for all packages, you will only need CD 1.

[edit] All Done

After copying the files to disk, your new CentOS server for LAMP stack applications is ready to go. Reboot and you can login with the root account. Be sure to check out the other workshop materials that will be uploaded to this T5C Wiki in the near future.