Linux Software RAID and Apache Web Server Management

Classified in Computers

Written on in English with a size of 2.56 KB

Software RAID Configuration

  • Use fdisk or similar tools to create partitions with type 0xfd (Linux RAID). Remember to run partprobe.
  • Create and define RAID devices using mdadm: mdadm -C /dev/md0 --chunk=64 --level=5 --raid-devices=3 /dev/sd[b,c,d]1
  • Format each RAID device with a filesystem: mkfs.ext3 -j /dev/md0
  • Test RAID devices:
    • mdadm --detail /dev/md0
    • mdmonitor provides the notification service.

Software RAID Testing and Reclaiming

  • Simulating disk failure: mdadm /dev/md0 -f /dev/sda1
  • Recovering from failure:
    • Replace the failed disk.
    • Rebuild the partitions on the new disk.
    • mdadm /dev/md0 -a /dev/sda1
  • Monitor /proc/mdstat and syslog for error messages.
  • Managing arrays:
    • Disassemble: mdadm -S /dev/md0
    • Assemble: mdadm -A -s

Apache Web Server Management

In RHEL5, the web service is called httpd.

  • Start service: service httpd start
  • Enable on boot: chkconfig httpd on

Apache Installation

Install via yum:

[root@station ~]# yum install httpd

Check availability: elinks -dump http://localhost

Apache Configuration

The configuration directory is located at /etc/httpd/conf.

  • Main configuration file: /etc/httpd/conf/httpd.conf
  • Uses XML-like syntax; lines starting with # are comments.

Key Configuration Directives

  • DocumentRoot: Root directory for server documents (e.g., DocumentRoot "/var/www/html").
  • ServerRoot: Root for configuration files, errors, and logs (e.g., ServerRoot "/etc/httpd").
  • Listen: IP address and port to listen on (e.g., Listen 80).
  • TimeOut: Seconds the server waits for a non-responsive client (e.g., Timeout 120).
  • KeepAlive: Enable or disable persistent connections (e.g., KeepAlive Off).
  • MaxKeepAliveRequests: Maximum number of persistent connections (e.g., MaxKeepAliveRequests 100).

Related entries: