Friday, November 13, 2009

Increase Swap Space Using Swap File

1. Using dd lets make a zero’d file for the swap

dd if=/dev/zero of=/swapfile bs=1048576 count=1000

2. Make file as a swapfile

mkswp /swapfile

3.Activate swapfile

swapon /swapfile

4. Verify that our swapfile has been activated

swapon -s

Recover MySQL Root Password

1. Stop MySQL Server Process
(/etc/init.d/mysql stop)

2. Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password
(mysqld_safe –skip-grant-tables &)

3. Connect to mysql server as the root user
(mysql -u root)

4. Setup new root password
(mysql> use mysql;

mysql> update user set password=PASSWORD(”NEW-ROOT-PASSWORD“) where User=’root’;

mysql> flush privileges;

mysql> quit)

5. Exit and restart MySQL server
(/etc/init.d/mysql stop
/etc/init.d/mysql start

mysql -u root -p )

Linux Runlevels

Mode Directory Description
0 /etc/rc.d/rc0.d Halt
1 /etc/rc.d/rc1.d Single-user mode
2 /etc/rc.d/rc2.d Not used (user-definable)
3 /etc/rc.d/rc3.d Full multi-user mode (no GUI interface)
4 /etc/rc.d/rc4.d Not used (user-definable)
5 /etc/rc.d/rc5.d Full multiuser mode (with GUI interface)
6 /etc/rc.d/rc6.d Reboot

Thursday, November 12, 2009

NFS Server

Package - nfs-utils
Service - portmap and nfs
Port No. - 111

Configuration Files
/etc/exports
/etc/hosts.allow
/etc/hosts.deny


Shared NFS directory is listed in /etc/exports,this file control the shared directory.

Example
#/etc/exports
/data/files *(ro,sync)
/home 192.168.1.0/24(rw,sync)
/data/test *.my-site.com(rw,sync)

/data/database 192.168.1.203/32(rw,sync)


showmount queries the mount daemon on a remote host for information
about the state of the NFS server on that machine.

Note:
  1. Only export directories beneath the / directory.
  2. Do not export a subdirectory of a directory that has already been exported. The exception being when the subdirectory is on a different physical device. Likewise, do not export the parent of a subdirectory unless it is on a separate device.
  3. Only export local filesystems.

Keep in mind that when you mount any filesystem on a directory, the original contents of the directory are ignored, or obscured, in favor of the files in the mounted filesystem. When the filesystem is unmounted, then the original files in the directory reappear unchanged.