Tuesday, February 19, 2008

How to Disable SELinux

Temporarily switch off enforcement

echo 0 >/selinux/enforce


Permanently Permissive

just change SELINUX=enforcing to SELINUX=permissive in file /etc/selinux/config, and you're done. Reboot if you want to prove it.

Wednesday, February 13, 2008

RHEL / CentOS Support 4GB or more RAM ( memory )

RHEL / CentOS Support 4GB or more RAM ( memory )
If you have 4 GB or more RAM use the Linux kernel compiled for PAE capable machines. Your machine may not show up total 4GB ram. All you have to do is install PAE kernel package.

This package includes a version of the Linux kernel with support for up to 64GB of high memory. It requires a CPU with Physical Address Extensions (PAE).
The non-PAE kernel can only address up to 4GB of memory. Install the kernel-PAE package if your machine has more than 4GB of memory (>=4GB).

How Do I Install PAE kernel?
To install PAE kernel, use yum command:

# yum install kernel-PAE


Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kernel-PAE to pack into transaction set.
kernel-PAE-2.6.18-53.1.13 100% |=========================| 259 kB 00:01
---> Package kernel-PAE.i686 0:2.6.18-53.1.13.el5 set to be installed
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kernel-PAE i686 2.6.18-53.1.13.el5 updates 13 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 13 M
Is this ok [y/N]:
Downloading Packages:
(1/1): kernel-PAE-2.6.18- 100% |=========================| 13 MB 00:10
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: kernel-PAE ######################### [1/1]

Installed: kernel-PAE.i686 0:2.6.18-53.1.13.el5
Complete!

Just reboot the server and make sure you boot with PAE kernel i.e. 2.6.18-53.1.13.el5:
# reboot

Tuesday, January 29, 2008

nfs warning: mount version older than kernel

or you can not mount nfs, when yo try mount nfs, you recieve error:
root@bacula ~]# mount 10.119.238.100:/VOLUME1/BACULA/ /smartstor
mount: wrong fs type, bad option, bad superblock on 10.119.238.100:/VOLUME1/BACULA/,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


first, you must install nfs service
yum install nfs-utils
check it included portmap
/etc/rc.d/init.d/portmap start
then retry mount.

Thursday, January 10, 2008

Caching-Nameserver

Caching-Nameserver is a type of nameserver that will resolve a web addresses (domain names) from its next or master DNS, and will keep those entries in cache, after first time resolution it will resolve DNS queries locally, untill its TTL (Time To Live) is expired.
BIND 9 is used to resolve domain resolution queries from it own database, as it is SOA (Start Of Authority).
So now it is clear that in our setup the caching-nameserver will be used to resolve domain names externally (internet), while BIND 9 will be used to resolve domain names from our local network (internally).

install packages
yum -y install bind bind-chroot caching-nameserver

start service
service named restart

set autostart
chkconfig named on

Tuesday, December 25, 2007

Exim divide incoming and outgoing mail

If you want route all incoming mail to pipe for example php file and route all outgoing mail to remote smtp.
edit your exim.conf file
In routers configurations block insert it:
------------------
begin routers
# Remote addresses are those with a domain that does not match any item# in the "local_domains" setting above.
# This router routes to remote hosts over SMTP using a DNS lookup. Any domain# that resolves to an IP address on the loopback interface (127.0.0.0/8) is# treated as if it had no DNS entry.
manualroute: driver = manualroute# condition = ${if or{{eq{$sender_host_address}{127.0.0.1}} {eq{$sender_host_address}{NULL}}}{yes}{no}}# condition = ${if eq{$sender_host_address}{127.0.0.1}{1}{0}}condition = ${if match_ip{$sender_host_address}{:127.0.0.1}}route_list = !+local_domains mxout.qos.net.il transport = remote_smtp no_more

lookuphost: driver = dnslookup domains = ! +local_domains ignore_target_hosts = 127.0.0.0/8 condition = "${perl{check_limits}}"# transport = remote_smtp transport = mypipe_smtp no_more

--------------------------
In transports Configurations block insert:

--------------------------
begin transports
mypipe_smtp: driver = pipe command = "/usr/local/bin/php /tmp/1.php" use_bsmtp = true user = mail group = mail

Sunday, December 23, 2007

timed out while receiving the initial server greeting

If you use postfix running on Linux and If you try to telnet the above host on port 25, the connection is made but the remote mail server doesn't send its 220 message upon connection.

for resolving it:
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling

Sunday, December 16, 2007

Setting Linux Time

Setting Linux Time

Programs for working with time and date are:
clock - This is a soft link to hwclock.
date(1) - Print or set the system date and time.
hwclock(8) - Sets the hardware clock based on values entered on the command line.
setclock(8) - Sets the BIOS hardware clock based on the time and setup of the system clock.
timeconfig(8) - A program used to configure the system configuration file "/etc/sysconfig/clock" which includes the type of clock and timezone.

commands:

rdate -s tick.greyware.com
/sbin/hwclock --systohc