Archive for 'CentOS/RHEL'

Copy a directory with all its contents in CentOS

This command will copy a directory with all its content to another directory,
for example you have a directory named x, you want to copy it to another directory named y
cp -dpr x y
That’s it!

Compressing with GZip and Zip in CentOS

Gzip
Type the following command to compress a file at a shell prompt
gzip filename.ext -> The file will be compressed and saved as filename.ext.gz
Type the following command to expand a compressed file
gunzip filename.ext.gz -> The filename.ext.gz is deleted and replaced with filename.ext
Type the following command to compress multiple files at a shell prompt
gzip filename.gz file1 file2 [...]

Change Default Home Directory for User in Centos

Everytime users created, it will keep per line inside /etc/passwd.
The line has the following characteristics:
1. It begins with the username.
2. There is an x for the password field indicating that the system is using shadow passwords.
3. A UID greater than 499 is created. (Under Red Hat Enterprise Linux/CentOS, UIDs and GIDs below 500 are reserved [...]

How to modify cPanel Skin : hide apache, php, mysql, kernel and ip address infos

I want this information, such as apache, php, mysql, kernel and ip address not shown on cPanel. I thought I modified skin file, so i downloaded the file from WHM. The file has size 10mb in gunzip format, but when it was extracted to original file, the size had became 458mb. I tracked code for [...]

How to transfer Cpanel accounts from one server to another (Cpanel)?

UPDATE
Note :
The server we are transferring the accounts from : OLD SERVER
The server to are transferring the accounts to : NEW SERVER
PROCESS ON NEW SERVER
1. Log into WHM. If your server is new, create a main account. The main account also setup as nameservers. Or if your server isn’t new, you can create or use [...]

Redirect Subdomain to another ip address or url

I have a tumblr site.We can use our own domain instead tumbr address, redirect our domain to tumblr. Not only a domain,we also can redirect a subdomain to tumblr. It’s easy. Go to our domain control panel. Choose your DNS Zone. We must point the domain’s A-Record to tumblr’s ip address. Add a DNS Record [...]

ProFTPD error : getaddrinfo domain_name error: hostname nor servname provided, or not known

Add below to proftpd.conf :
DefaultAddress domain_ip
The solution hide a warning, getaddrinfo domain_name error: hostname nor servname provided, or not known in ProFTPD.

Upgrading php and mysql (cPanel using WHM)

Upgrading cPanel is a lot easy than upgrading Plesk, especially if we use WHM (Web Hosting Manager).
1. Log into WHM
2. Go to Apache Update in Software Category
3. Click Load Previous Config, uncheck previous php version and check the new php version. Same with mysql
4. Press Start Build
Note : some components also provided, such as xml-rpc, [...]