Configure static ip Centos

## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=”eth0″
NM_CONTROLLED=”yes”
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NAME=”System eth0″
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.1.44
NETMASK=255.255.255.0
## Configure Default Gateway
#
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.1.1
## Restart Network Interface
#
/etc/init.d/network restart
## Configure DNS Server
#
# vi /etc/resolv.conf
nameserver 8.8.8.8 # Replace with your nameserver ip
nameserver 192.168.1.1 # Replace with your nameserver ip

xenserver fix vm bootloader error

xe vm-param-set uuid=[vm-uuid] PV-bootloader-args=”–kernel=/boot/vmlinuz-3.10.0-123.4.2.el7.x86_64 –ramdisk=/boot/initramfs-3.10.0-123.4.2.el7.x86_64.img”

xe vm-param-set uuid=[vm-uuid] PV-args=”root=UUID=[root-uuid] ro quiet”

change localtime on Centos

Firstly you’ll need to know your timezone and/or country, a list can be found in /usr/share/zoneinfo/

The more generic procedure to change the timezone is to create a symlink to file /etc/localtime

# ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime

OR you can copy and replace the current localtime setting

# cp /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime

To verify that your timezone is changed use the date command:

# date

 

http://www.how2centos.com/centos-change-timezone/

Disable SELinux CentOS 6

# vi /etc/selinux/config

 

Change SELINUX=enforcing

1
2
3
4
5
6
7
8
9
10
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

to SELINUX=disabled

1
2
3
4
5
6
7
8
9
10
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

This will disable SELinux on your next reboot.