Building a Fedora 8 Server

From WikiHack

Jump to: navigation, search

This guide covers the basics for building and installing a server, using Fedora 8: Werewolf as our operating system.

Contents

Hardware Used

The hardware used in a server is key to its performance. How much you spend, however, on the parts will depend on what it will be used for.

If you plan on using the server mainly for personal data storage, covering httpd, ftpd, subversion, and Samba, very cheap hardware will do, although if you will be using lots of storage space, a motherboard with lots of SATA ports is key. Integrated SATA or a PCI-E controller card for them is the best way to go to keep speed to a maximum. A cheap Intel Core 2 Duo can be gotten for under $100, and even this will be more than you'll need.

If you plan on running lots of high-CPU services, such as a Steam server, Folding@Home, or Rainbow Table generators, a high-end motherboard and CPU will be important. Lean towards a minimum of a Q6600 or equivalent CPU with an Asus motherboard.

The case is also very important. If you will be looking towards clustering your computers in the future, look for a case that is either rack-mountable or can be easily stacked. Keep in mind that smaller cases on a rack run a lot hotter than a full tower case. For my rig, I use a CoolerMaster Cosmos 1000 case. It's got space for 7 HDDs, has soundproofing to keep noise down, and comes standard with 4 120mm fans. The chassis is screwless, it's easy to carry around, and it's very stylish. The price tag is also a cool $200-ish depending on where you go.

For hard drives, I recommend Seagate Barracuda drives, with a minimum capacity of 500GB. Disk space is cheap now, and the non-OEM Seagate drives have a 5-year warranty. We will be tying drives together using the LVM. I will be assuming during this install that you're not too cheap to buy a 500GB drive. If you are, you probably don't have the money for the other hardware.

My development server has the following specs:

  • Intel E6600 Core 2 Duo CPU
  • Foxconn P9657AA-8EKRS2H Motherboard
  • 4x Seagate Barracuda 500GB 32MB Cache 3Mb/s HDD
  • CoolerMaster Cosmos 1000 Case
  • Cheap PCI-E video card
  • LG DVDRW Drive

Software Used

Using a variety of native and standard services brings a good combination of security and functionality to your server. Below is a list and description of each service that will be installed on the server.

  • Apache Web Server - the defacto standard for web servers. Currently 50.22% of all servers run Apache, followed by Microsoft's IIS at 35.33%
  • IPTables Firewall - the standard for firewalls on Linux machines. Comes installed standard. We will be changing a few configuration options here.
  • Subversion Repository - if you develop code, a revision control system is critical. Subversion is my personal favorite.
  • Samba - the language that is used to talk between network shares. This works nicely with Windows's Network Places.
  • VSFTPD - a Very Secure File Transfer Protocol Daemon. Comes standard.
  • Moblock - very similar to PeerGuardian2. Downloads a list of known threats based upon IP address and prevents you from connecting to them. A must-have if you plan on using rTorrent.
  • DenyHosts - similar to MoBlock, DenyHosts will prevent a particular IP address from connecting to your system if it produces suspicious activity (ie. fails to log in to SSH a number of times).
  • rTorrent (with rtGui) - a console-based torrent client. We will be configuring it to run as a service and connect to rtGui, a web-based frontend to it, allowing you to control the console from a web page.
  • Ventrilo Daemon - one of the most popular voice chat systems on the internet. The other most popular is TeamSpeak.
  • Dedicated Steam Server - if you run a game server, chances are it's this one. Steam houses some of the best FPS games ever made.

Assembling the Hardware

This I will leave up to you. If you don't feel comfortable doing this, get a friend to do it. It's not hard

Installing Fedora

Which Architecture?

Choosing an Architecture is an important step, and once it's made, you can't go back on it without reinstalling your system. For those that are able to, run the x86_64 architecture. This supports 64-bit CPUs, so if you're running a Core 2 or equivalent, this is what you should go with. Along with this comes a whole other slew of perks, such as support for more than 3.25GB of RAM. If you're running an older CPU, get the i386 version.

Step 1 - Media Test

Before getting to a GUI, there will be an option to test the install media. Always test the media before an install to make sure it was burned properly.

Step 2 - GUI Introduction

A simple step here. There's a few windows asking you to select your language and keyboard configuration.

Step 3 - Partitioning

Partition is the division of your hard drive into all the pieces it will need to be in. I recommend building a custom design to allow for easy backup and an easy expansion of your system drives. Select "Create Custom Layout" from the dropdown and click next. Your initial base layout will be in the following form:

  • Partition 1 - 400MB, ext2 filesystem, mounted at "/boot"
  • Partition 2 - (all remaining space), LVM, labeled LogVol00

LogVol00 will be in the following form:

  • Partition 1 - 20 GB, ext2 filesystem, mounted at root "/", labeled "Root"
  • Partition 2 - 100 GB, ext2 filesystem, mounted at "/home", labeled "Home"

It is important to note that we haven't used all the space up in the logical volume. There's still unallocated space. This is perfectly fine. As your system expands, you may need to allocate more space to either the root or home directories. You can now do this with LVM.

If you are prompted at this point to format your drives, select yes.

Step 4 - Network

During this part you need to configure your network card(s). For a server, you should be assigning it a static IP. Make sure your card activates on boot, and that IPv6 is also enabled to provide support for the future protocol. I set the host name manually. For a home network, you need to choose a domain and a host name. I choose the domain based upon a category of objects (trees, alcohol, cheese, flowers), and each computer in that domain will have a host name based upon that (oak, bourbon, cheddar, marigold).

Step 5 - Location and Root

Here is asks you to select your geographic location. Make sure this is as accurate as possible. Your timezone is based upon this.

On the page afterward, you will be prompted to create a root password. Make sure this is a secure password. A minimum of 8 characters with both uppercase and lowercase letters, numbers, and symbols is a must. Your system will be connected to the internet, meaning there will be bots patrolling your IP. Don't compromise the security of your server with a bad password.

Step 6 - Packages

Because this is a server, there's a number of required packages, and a number of packages that we can remove. On this page, uncheck Office and Productivity and select Software Development (we will be compiling things on here) and Web Server. Make sure Customize Now is also selected, then hit next. You will be given a list of packages in categories to select from. Make sure only the following categories are checked:

  • Editors
  • Text-based Internet
  • Development Libraries
  • Development Tools
  • DNS Server
  • FTP Server
  • Mail Server
  • MySQL Database
  • Server Configuration Tools
  • Web Server
  • Administration Tools
  • Base
  • Hardware Support
  • Java
  • System Tools

All other items should be unchecked.

Step 7 - Confirm Settings and Install

One last confirmation page, and you're done. Clicking next on this last page will start formatting your drives and installing the system.

Go get yourself a cup of coffee. You'll be here a while.

Once the install is finished, restart your computer and remove the DVD. Your system will boot into Fedora, and will present you with a first-time boot configuration. Exit this and get to the login. We will be doing the configuration manually. Congratulations. You just installed your first Fedora server.

Once you log in as root, the first thing you need to do is update your system. Run the command yum -y update;shutdown -r now. This will update your system to the most recent packages, including new kernels, and once the update is done, the system will reboot.

Configuring Native Services

All configuration should be done as root user.

SELinux

SELinux is a implemented security policy for your linux box. Personally, I find it a pain in the butt to work with, but it should be kept on for production servers. As a development server, you'll want to disable it.

vim /etc/selinux/config

You will be presented with the Vim command window. Take a basic tutorial on this before going any further. It's a great program when you learn how to use it. Change SELINUX=enforcing to SELINUX=disabled, and reboot your server. SELinux will now be disabled.

Apache HTTP Daemon

Apache comes well-configured on Fedora installations. Your configuration is located at /etc/httpd/conf/httpd.conf. Make a copy of your configuration to httpd.conf.bak before doing any editing.

Your document root is located at /var/www/html. Putting any files in here will allow access to them via the web.

The next step is to make sure that the Apache service starts on boot. To do this use the command: chkconfig --level 235 httpd on. This adds the Apache service to run on runlevels 2, 3, and 5. To start Apache now, run the command: service httpd start.

IPTables Firewall

Subversion Repository

Subversion is a revision control system for code development. To configure this, please see the Subversion Tutorial.

Samba

Samba is a network service designed to share files between computers. To configure this, please see the Samba Tutorial.

Vsftpd

Installing New Services

MoBlock

DenyHosts

rTorrent with rtGui

Ventrilo Daemon

Dedicated Steam Server

Personal tools