CentOS5.4

From Email Marketing Wiki
Jump to: navigation, search

CentOS Firewall Ports

To configure the CentOS firewall:

1. At the command prompt run :

system-config-securitylevel-tui

2. Turn on Security & disable:

Security Level: (*) Enabled ( ) Disabled │ │ │ │ SELinux: Enforcing │ │ Permissive │ │ Disabled

3. Tab to the Customize option. Paste the following into the other ports section:

2082:tcp 2083:tcp 2086:tcp 2087:tcp 2095:tcp 2096:tcp 143:tcp 110:tcp 53:udp 53:tcp 25:tcp 80:tcp 443:tcp 161:udp


4. Click OK and exit the customize area then OK to exit the configuration options.

5. At the command prompt run:

service iptables restart

Installing SNMP

yum install net-snmp-utils

vi /etc/snmp/snmpd.conf

chkconfig snmpd on

/etc/init.d/snmpd start

WHM Master

1. To configure the IP address run:

system-config-network

2. Then select edit a device and select eth0 (eth0) - Xen Virtual Interface

3. Enter the IP address from the Google Docs IP Allocation Spreadsheet

Static IP: 192.168.1.xxx Netmask: 255.255.255.0 Default Gateway: 192.168.1.1

2. Click OK, then OK then Save to return to the command prompt. Then restart the network service:

service network restart

View Disk Space

df -H


Resize Linux Partition

Summary

This article describes how to extend the size of the disk on a Xen Virtual Machine and subsequently extend the file system on Windows partitions (using the DiskPart utility) or Linux partitions.

Requirements

XenServer 4.1 and later

Procedure

This article contains the following procedures:

Extending the disk size in XenServer Extending a partition size in Windows operating systems using the DiskPart utility Extending a partition size in Linux operating systems

How to extend the size of the disk in XenServer:

   Shut down the corresponding virtual machine.
   Go to XenServer Command Line Interface (CLI)
   Find the virtual disk Universally Unique Identifier (UUID) by running the following command:
   # xe vm-disk-list vm=<vm name>
   Run the following command to resize the virtual disk:
   #xe vdi-resize uuid=<vdi uuid> size=<size (GiB, MiB)>

With XenCenter 5.6 you can select the VDI from the storage tab of the virtual machine click Properties, select Size and Location, then increase the size of the disk without using the command line.

How to extend the partition size in Windows operating systems:

These steps are also demonstrated in the following CitrixTV video:

Using Disk Management:

   Right click My Computer select Manage.
   Select Disk Management, right click on the disk you want to extend, and select Extend:

This starts the Extend Volume Wizard. Follow the prompts to complete the process.

Using the DiskPart utility:

Note: DiskPart cannot extend system partitions on Windows 2003 and Windows XP Functionality restrictions of the Diskpart.exe utility to extend system and boot partitions in Windows Server 2003 and in Windows XP

   Launch a command prompt.
   Type diskpart and press Enter.
   At the diskpart prompt, enter the following commands:
   DISKPART>list volume
   DISKPART>select volume # (For # enter the number of the volume you want to resize)
   DISKPART>extend size=n (n is size in Megabytes that you are adding to the volume>

Refer to DiskPart Command-Line Options for more information.

   After you finish your work, type exit to close DiskPart.
   Type exit to exit the command prompt.
   Click Restart. You might be asked to restart one more time once the operating system starts.

How to extend the partition size in Linux operating systems:

These steps are also demonstrated in the following CitrixTV video:

Linux operating systems supports many file system types (for example, ext3, xfs, reiserfs). To extend file systems on an extended disk you must use file system tools that correspond to a particular file system type. Recommended file systems are those that can be expanded while the system is running and mounted. For example:

If you use ext3: After resizing the disk in XenServer, start the operating system and use the resize2fs tool with the name of the partition that should be extended (refer to the manual for more details). For example to resize a data partition:

   #umount /dev/xvdc1
   #fdisk /dev/xvdc1
   #d (Delete the partition and recreate it)
   #n (New partition)
   #w (Write out table)
   #e2fsck -f /dev/xvdc1
   #resize2fs /dev/xvdc1
   #mount /dev/xvdc1 /home

To resize the Linux system partition:

   Shutdown the virtual machine.
   Set the virtual machine to boot into single-user mode on the XenServer host CLI:
   #xe vm-param-set uuid=6f04... PV-args=single
   Boot virtual machine and show disk list make partition table changes in the Linux virtual machine:
   #fdisk -l
   fdisk /dev/xvda
   d -Delete Partition
   n -New create new partition
   p -Primary
   1- Partition number
   Default values for size
   w -Write changes
   Reboot the virtual machine:
   reboot vm
   Note: If you need to run FSCK you must boot from rescue media.
   Resize the filesystem:
   resize2fs /dev/xvda1
   On XenServer host, remove the single-user boot mode setting:
   #xe vm-param-set uuid=6f04... PV-args=
   If you use xfs: After resizing the disk in XenServer, start the operating system and use the xfs_growfs tool with the name of the partition that should be extended (refer to the manual for more details). For example:
   # xfs_growfs /dev/xvda1
   If you use reiserfs: After resizing the disk in XenServer, start the operating system and use the resize_reiserfs tool with the name of the partition that should be extended (refer to the manual for more details). For example:
   # resize_reiserfs /dev/xvda1


Change Centos Hostname

There are several ways to do that but I am using the old way. VI is my friend and still working. I am using a remote SSH session to one of my virtual machines but you can perform same steps from the console.

   Login with putty.exe
   Goto /etc/sysconfig/
   Type vi network
   Press i on the keyboard and change the HOSTNAME to your preferred servername
   Press ESC on the keybord
   Save the configuration by :wq!
   Log off or reboot