CentOS | Fedora

Fixing su: cannot set user id: Resources temporarily unavailable in Linux VPS

Last night when i login into my VPS, i found a weird issue in my VPS.
When i type a su command below it shows :

#su -
su: cannot set user id: Resource temporarily unavailable

After searching and googling few minutes, i found a quick resolution to fixing this issue.
This is all about VPS limit.

Edit limit.conf below or change if needed.

#vi /etc/security/limit.conf
#### add/change on these line below:
*    soft    nproc    2047

Steps To Fixing Linux Crash Filesystem After Power Outage.

Sometime if we didn't properly shutdown a server that running linux, it will cause a crash for the filesystem.
We need a tool that able to repair it immediately, the tool is FSCK or file system consistency check.

Below is the fsck command :

Usage: fsck [-sACVRTNP] [-t fs-optlist] [filesystem] [fs-specific-options]

Example :

I have a drive /home or /dev/sda3
Then the next step is we need a root access to run the command.

How To FSCK Your Linux LVM Partition

Yesterday i have a problem when my computer can't booting up.
After checking more detail i found that i need to FSCK my partition.

The problem is my linux partition using LVM
Then after googling it for a while

I Found a simple steps to fsck Linux LVM Partition.

First We need to have a linux livecd / rescue cd
Then after reboot it into the livecd and we can see a linux prompt

Then type few lines below to fixed it.
$vgchange --ignorelockingfailure -ay
$lvscan --ignorelockingfailure
$fsck -y /dev/VolumeGroup/LVname

Fixed Error: curses.h: No such file or directory on CentOS

Sometimes when you install some packages, it will automatically find others dependency
one of them may be curses.h: No such file or directory

in this case i'm using CentOS as a server.
So we will need to install ncurses-devel and ncurses using yum.

Below is the step to install it.

1. Login as root into your CentOS server
2. Type a command line below
# yum install ncurses-devel ncurses

If everything success then you are good to go.

How To Moving All Websites Content Using Wget

Last Week i want to moving a large sites from one server to a new server.
There is a few method to moving all websites content to a brand new server,
First we can using RSYNC, FTP and WGET

In this tutorial i want to using WGET that will moved all sites content in a single line using FTP protocol

We need to prepare a FTP Login from an Old Server that currently host the websites
example :
ip new server :
user : new
pass : newpassword123

How To Install Apache 2.x To Work With GnuTLS

There is another way to using ssl with apache 2.x
The common solution is using OpenSSL with Apache 2.x

But right now i trying to get Apache 2.x to work with mod_gnutls

FYI, GnuTLS support TLS 1.2 and TLS 1.1 that also supported by OpenSSL
But GnuTLS will not supported SSL 2.0

We need to prepare anything related to GnuTLS to work with Apache 2.x
First we need to install those packages below :

Login as Root

1. GnuMP

#mkdir /root/temp
#cd /root/temp

How To Solved Mysqldump: Got error: 1016: Can't Open file when using LOCK Tables

Today, i trying to dump my database but when the dump process begin,
MySQL shows error like below :

Example :

root@rainforest# mysqldump -u root -p mypassword --opt sampledb > backupdb.sql
mysqldump: Got error: 1016: Can't open file: './sampledb/xxx.frm' (errno: 24) when using LOCK TABLES

So after googling a way to dump it without any hassle

root@rainforest# mysqldump -u root -p mypassword --opt sampledb --lock-tables=fales > backupdb.sql

From the command above, i can dump my backupdb without any problem

How To Rewrite www to non-www domain using htaccess

Here is a simple way to rewrite your domain from www.yourdomain.com to yourdomain.com without www

This is simply add few lines into your .htaccess files.

Below is the example how to do that


<IfModule mod_rewrite.c>
  RewriteEngine on

 RewriteCond %{HTTP_HOST} ^www\.wowtutorial\.org$ [NC]
  RewriteRule ^(.*)$ http://wowtutorial.org/$1 [L,R=301]


Change it to your domain name.
After that tested it out again.

This should be working


How to Fixed Dovecot Fatal: listen(::, 143) failed: Address already in use

When i trying to install Dovecot in CentOS 5.6 Yesterday and i trying to start dovecot services.

It shows an error like below :

Fatal: listen(::, 143) failed: Address already in use

After do some searching in the internet i found how to solved this issue:

Login into your server using root access.

Edit your dovecot config

#pico /etc/dovecot.conf

Find the line contain Listen like below and comment it 

#listen = *, [::]
listen = *

Start dovecot

How To Force User To Change Password in First Login

Here come to my attention when i want to automatically have my new linux/unix users to change the password when they login into the server.

Login into your server with root access

type chage command :
#chage -d 0 <username>

example i have a username : sentono

#chage -d 0 sentono

-d mean : we will force user to change password when they login into the server for the first time

Facebook Fans