Categories

Saturday, 31 March 2012

Cpanel Backup & Recovery

Here’s the main command I use for Cpanel Backup, just type the following and change “accountname” to the cpanel user account name:
/scripts/pkgacct accountname

So there you have it, basic Cpanel Backup, -now it’s time to SFTP or SCP that thing somewhere off line for recovery purposes later.
scp /home/cpmove-yourdomain.tar.gz remote-hostname.com:/your/remote/backup/directory/name/

let’s say you have a lot of accounts, you can cat the /home directory and run a command on all of them using a variable.
To copy all cpanel accounts, just type:
ls /var/cpanel/users | while read x; do
/scripts/pkgacct $x
done
This will back up all cPanel accounts.  Expect it to take a while.

All the tar.gz backup packages will be located in /home directory.

ow you can move them out via SCP as discussed.

SCP Cpanel Backups to Remote Server:

To transfer the data across to the remote server, type:
scp cpmove-* root@10.20.30.40:/home

To restore an account in Cpanel, just type:
/scripts/restorepkg username
To restore all accounts:
ls /home/ | while read b; do
/scripts/restorepkg $b
done



Apt-get error in debian

If you get the following error during apt-get commands
apt-get update

rr http://gb.archive.ubuntu.com natty-backports Release.gpg
  Temporary failure resolving ‘gb.archive.ubuntu.com’
 
Then there is a name server issue.The source list is not correctly resolving.So you have to check the DNS settings or name server settings in /etc/resolv.conf
 
So open /etc/resolv.conf in your editor and add nameserver 

nameserver 8.8.8.8
 
 
Then use the command apt-get
 
This would probably resolv the issue.
 
 
 
 

Backuping and Restoring new Vps

# wget -r -nH -c -l0 ftp://username:password@IP/vz/private/VEID

Check the OS template of the VPS

  UBS4

# vzctl create same_veid --ostemplate (look /vz/template/cache/ omit .tar.gz)

# vzctl start veid


 Goto Master node at Linode

# /scripts/vm-migrate vserver_id new_node_id

For VPS 215  vserverid is 29

newnodeID is ID of UBS5 (usa3 server)

/scripts/vm-migrate 29 5


Update in solusvm : resources,main IP ,hostname

ubs 4

# nohup rsync --ignore-existing -r /vz/private/veid/ /vz/root/veid/ &

to check the output use command  tail -f nohup.out

Tuesday, 27 March 2012

Repairing corrupted mysql database


Sometimes it happens that your database get corrupted due to many reason like it does nto get restored properly or server get rebooted while updating database etc…. and you have tried to repait it using phpmyadmin and it does shows that it has repaired but it is not.

Solution :1

Login to server with root access

Stop mysql using following command

/etc/init.d/mysql stop

Run following command to check all the tables in the database

Run following command to check all the tables in teh database

/usr/bin/myisamchk /var/lib/mysql/databasename/*.MYI

Run following command to repair all the tables in the database

/usr/bin/myisamchk -r /var/lib/mysql/databasename/*.MYI

Then recheck again using following command

/usr/bin/myisamchk /var/lib/mysql/databasename/*.MYI

Restrart MySql service using following command

/etc/init.d/mysql restart

Solution : 2

If you want repair DB using myisamchk, you need to shutdown MySQL service before proceeding otherwise it will corrupt some other databases.

Alternatively, if you do not want to shut down MySQL, you can use mysqlcheck.

mysqlcheck [DBNAME]

To repair the database tables:

mysqlcheck -r [DBNAME]

also we can use the commands

mysqlcheck -u{username} -p{password}  –check –optimize –auto-repair –all-databases

Sunday, 25 March 2012

How to set the time zone for openvz nodes.


The following post describes how to set the time zone for openvz nodes, Make sure that the HW node timezone is correct Else, use this command to update the time zone on the HW node
rdate -p rdate.cpanel.net
rdate -s rdate.cpanel.net

-p Print the time returned by the remote machine. -s Set the system time to the returned time. On the sub node, run
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/{desired-timezone} /etc/localtime
date MMDDHHMiMiYYYY

If you want to set the time in a OpenVZ sub node automatically, execute the following command on the HW node:
vzctl set 501 --capability sys_time:on --save
vzctl restart 501 501 = container id
date (to check the time)

That’s it.
Set the time zone for openvz nodes.

Saturday, 24 March 2012

Manually Adding OS templates on Open vz nodes

If you are unable to load templates in a newly created node via solusvm by syncing the templates frm already existing nodes,Then we have to load the templates manually
First go to /vz,check there is directory named template,where all the OS templates are stored in cache
So if the directory is not present ,create the template directory ,then create cache directory inside it.
Then OS templates have to be added from already existing nodes to the /vz/template/cache.
The template can be copied from node containing templates to newly created node via scp
command look like this
scp 192.168.1.200:/vz/template/cache/*.tar.gz 192.168.1.201:/vz/template/cache/
The ip shown above are just examples.

Friday, 23 March 2012

IP assignment in Server loft dedicated servers

Ip assignment on serverloft

If you get the server name to which ip have to be added,Then go to WHMCSS,and check the server name in intelligent column .
There in admin notes you will get information about the server including the subnet of the server.
Then go back to serverloft in the Ip management
On the contract tab select the correctsubnet for the server
On the handle tab select required username
And select the desired server in which we need to add ips
Afet crosschecking all the information are correct click on order at the bottom
You have to repeat the steps one by one for adding each ip.

Wednesday, 21 March 2012

php Script cant connect to database

If your script can not connect to your database so you can following this steps.
1. First please check you have insert connect database details in your script you can check this in /home/user/public_html and file name could be wp-config.php,  configuration.php, config.php. It depends on your script which you are using. Find the following details in your sctipt.
If you have shell access then you can directly go in /home/user/public_html but if you do not have Shell access then you can Login in your cpanel get the database details from File Manager
Database name = (cpanelusername_databasename)
Database username = (cpanelusername_databaseuser)
Database password = (******)
If you see that all details are already exist in your database configuration file so copy these details in notepade and edit from editor.
2. Login in your cpanel and remove the username which you got from Configuration file
3. Recreate the database user and give the password which you got from Configuration file.
4. After that add the User to database.  If you dont know how to add user to database so you can follow the steps from this URL: http://linuxgo.net/?p=234

How to monitor Linux Server

Here you will get all Good tricks and tips how to monitor Linux Server or how to manage Linux Server if its causing load,  How to find Spammer, how to check http and mysql processes.

General Commands,

To check server load and which users are logged on the server with IP address you can fire this command
w
To check for the server load and watch for process
top
top –d2
top –c d2
Memory status
free –m
To see all processes running on the server
ps –aufx
With above commands you can which process is causing load on the server after that you can go with next steps.
If you see many processes of exim then you can check exim in more detail. shows the total no of email in qmail
exim –bpc
Print a listing of the messages in the queue
exim -bp
Following command will show path to the script being utilized to send mail
ps -C exim -fH eww
ps -C exim -fH eww | grep home
cd /var/spool/exim/input/
egrep "X-PHP-Script" * -R
Shows no of frozen emails
exim -bpr | grep frozen | wc -l
To remove FROZEN mails from the server
exim -bp | exiqgrep -i | xargs exim -Mrm
exiqgrep -z -i | xargs exim –Mrm
Check for spamming if anybody is using php script for sending mail through home
tail -f /var/log/exim_mainlog | grep home
If anyone is spamming from /tmp
tail -f /var/log/exim_mainlog | grep /tmp
To display the IP and no of tries done bu the IP to send mail but rejected by the server.
tail -3000 /var/log/exim_mainlog |grep ‘rejected RCPT’ |awk ‘{print$4}’|awk -F\[ '{print $2} '|awk -F\] ‘{print $1} ‘|sort | uniq -c | sort -k 1 -nr | head -n 5
Shows the  connections from a certain ip to the   SMTP server
netstat -plan|grep :25|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1
To shows the domain name and the no of emails sent   by that domain
exim -bp | exiqsumm | more
If  spamming from outside domain then you can block that domain or email id on the server
pico /etc/antivirus.exim
Add the following lines:

if $header_from: contains “name@domain.com”
then
seen finish
endif

Catching spammer

Check mail stats
exim -bp | exiqsumm | more
Following command will show you the maximum no of email currently in the mail queue have from or to the email address in the mail queue with exact figure.
exim -bpr | grep “<*@*>” | awk ‘{print $4}’|grep -v “<>” | sort | uniq -c | sort -n
That will show you the maximum no of email currently in the mail queue have for the domain or from the domain with number.
exim -bpr | grep “<*@*>” | awk ‘{print $4}’|grep -v “<>” |awk -F “@” ‘{ print $2}’ | sort | uniq -c | sort -n
Check if any php script is causing the mass mailing with
cd /var/spool/exim/input
egrep “X-PHP-Script” * -R
Just cat the ID that you get and you will be able to check which script is here causing problem for you.
To Remove particular email account email
exim -bpr |grep “ragnarockradio.org”|awk {‘print $3′}|xargs exim -Mrm
If Mysql causing the load so you can use following commands to check it.
mysqladmin pr
mysqladmin -u root processlist
mysqladmin version
watch mysqladmin proc

If Apache causing the load so check using following commands.

netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort –n
netstat -an |grep :80 |wc –l
netstat -n | grep :80 | wc -l;uptime ; netstat -n | wc –l
netstat –tupl
pidof httpd
history | netstat
lsof -p pid

If mysql is causing load so you can check it using following commands.



mysqladmin -u root processlist
mysqladmin version
watch mysqladmin proc
mysqladmin -u root processlist

Other Useful Commands



To check ipd of php
pidof php
lsof  -p pid
netstat -an |grep :80 |wc –l
netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n
netstat -na |grep :80 |sort
Use below mentioned command to get top memory consuming processes
ps aux | head -1;ps aux –no-headers| sort -rn +3 | head
Use below command to get top cpu consuming processes
ps aux | head -1;ps aux –no-headers | sort -rn +2 |more
You can check if any backup is going on, run the following commands

ps aux | grep pkg
ps aux | grep gzip
ps aux | grep backup
We can trace the user responsible for high web server resource usage by the folowing command
cat /etc/httpd/logs/access_log | grep mp3
cat  /etc/httpd/logs/access_log | grep rar
cat  /etc/httpd/logs/access_log | grep wav etc
cat /etc/httpd/logs/access_log | grep 408 can be used to check for DDOS attacks on the server.

cat  /etc/httpd/logs/access_log | grep rar

Cpanel - How to view error logs


Cpanel - How to view error logs

cat /var/log/messages | more

it will give you the server wide error messages

for cpanel server apache logs.


cd /usr/local/apache/domlogs


cat domainname
- it will give you the logs for a particular domain.


Cpanel logs:
/usr/local/cpanel/logs

Apache logs:
/usr/local/apache/logs

Windows Server : How to reset mysql root password



Stop the MySQL server if it is running. For a server that is running as a Windows service, go to the Services manager:

Start Menu -> Control Panel -> Administrative Tools -> Services

Then find the MySQL service in the list, and stop it.

If your server is not running as a service, you may need to use the Task Manager to force it to stop.

Create a text file and place the following command within it on a single line:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

Save the file with any name. For this example the file will be C:\mysql-init.txt.

Open a console window to get to the DOS command prompt:

Start Menu -> Run -> cmd

We are assuming that you installed MySQL to C:\mysql. If you installed MySQL to another location, adjust the following commands accordingly.

At the DOS command prompt, execute this command:

C:\> C:\mysql\bin\mysqld-nt --init-file=C:\mysql-init.txt

Try this procedure to fix mysql.sock error: Cpanel

cd /var/lib/mysql

touch mysql.sock

chown mysql:mysql mysql.sock

chmod 1777 mysql.sock

now make a sym link into /tmp

ln -s /var/lib/mysql/mysql.sock /tmp

then

chmod 1777 /tmp

now

/scripts/mysqlup --force

now just restart mysql

/etc/rc.d/init.d/mysql restart

Cpanel : Mysql Upgrade

01. Update /var/cpanel/cpanel.config
02. /scripts/UPCP
03. Select mysql 5 from the tweak settings and run the command from the shell to update mysql.
04/scripts/mysqlup --force
05. After this run /scripts/easyapache to recompile apache and php to higher version.

Tuesday, 20 March 2012

Disk Space Commands on Linux


Linux console is the best place for a system admin, some useful commands to check disk space on a linux system are:

Show files by size, biggest last:

ls -lSr

Show top disk users in current dir.

du -s * | sort -k1,1rn | head

Show free space on mounted filesystems

df -h

Show free inodes on mounted filesystems

df -i

Show disks partitions sizes and types

fdisk -l

List all packages by installed size (Bytes) on rpm distros

rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n

Cpanel : Downgrade MySQL 5 to MySQL 4.1 on cPanel dedicated server

Downgrade MySQL 5 to MySQL 4.1 on cPanel dedicated server

For some reason you need to downgrade MySQL 5 to MySQL 4.1 to achieve this you will have to do the following:

To check the which all mysql rpm’s are available use the command:

rpm -qa | grep -i mysql-

First of all take a backup of /var/lib/mysql, and also ask the other users to keep a backup it with them. This can also be a .sql file. The command to take a backup is:

cp /var/lib/mysql /var/lib/mysql.bk

Now, you will have to edit the cPanel config file and make manual changes under this, so edit it with the command:

nano /var/cpanel/cpanel.config

And here, find for the line “mysql-version=5.0” and change it to “mysql-version=4.1”

Now, we will forcefully install mysql by the following command:

/scripts/mysqlup --force

You can now check again with the command:

rpm -qa | grep -i mysql-

This is done and worked for me.

Cpanel : Manually Migration


There is a scenario where you need to transfer a hosting account which is present on your server to another (new) server, to accomplish this follow the below steps:

Present server:

cd /home

/scripts/pkgacct username
This command will create a file cpmove-username.tar.gz in the /home directory, now this is to be copied to the new server.

scp cpmove-username.tar.gz root@server-IP:/home
This will prompt for the password, you can enter the new server password.

New server:

/scripts/restorepkg username
This will restore the hosting account which includes email, database and the contents

Cpanel installation in Linix server

Firstly we have to get cpanel license for the dedicated ip of your server.
We can check the license in the cpanel main website verify.cpanel.net.Once it shows the license is ok Then do the steps given below
  1. cd /home — Opens the /home directory.
  2. wget -N http://httpupdate.cpanel.net/latest — Fetches the latest installation files from cPanel's servers.
  3. sh latest — Opens and executes the installation files.
If licensing fails (due to a strict firewall or modified IP), run the command /usr/local/cpanel/cpkeyclt to activate your cPanel & WHM license.

Monday, 19 March 2012

Plesk control panel server paths


===========================================================
# Plesk tree
PRODUCT_ROOT_D - /usr/local/psa
==================================================
# Directory of SysV-like Plesk initscripts
PRODUCT_RC_D - /etc/init.d

/etc/psa/psa.conf // common config file
/etc/psa/.psa.shadow // admin password file
/var/log // common log file
/etc/local/psa/admin/logs //plesk log file
================================================

# Directory for config files
PRODUCT_ETC_D - /usr/local/psa/etc
================================================

# Virtual hosts directory
HTTPD_VHOSTS_D - /var/www/vhosts
/var/www/vhosts//anon_ftp , cgi-bin, conf, error_docs , httpdocs, httpsdocs , pd , private , statistics-->/logs(domain logs), subdomains , web

Domain based httpd.conf file:- /var/www/vhosts/conf/httpd.include
Doc root : /var/www/vhosts//httpdocs
===============================================

# Apache configuration files directory
HTTPD_CONF_D - /etc/httpd/conf/httpd.conf //server based
/var/www/vhosts/conf/httpd.include // domain based
------------------------------------------------------------------------------------------------------------
# Apache include files directory
HTTPD_INCLUDE_D - /etc/httpd/conf.d/mailman.conf , perl.conf, python.conf , webalizer.conf, zz010_psa_httpd.conf, fcgid.conf, manual.conf , php.conf, ssl.conf, welcome.conf
------------------------------------------------------------------------------------------------------------
# Apache binary files directory
HTTPD_BIN_D - /usr/bin
--------------------------------------------------------------------------------------------------------------
#Apache log files directory
HTTPD_LOG_D - /var/log/httpd
-----------------------------------------------------------------------------------------------------------
#apache startup script
HTTPD_SERVICE httpd
/etc/init.d/httpd [start|stop|restart|status]


================================================

# Qmail directory
QMAIL_ROOT_D /var/qmail

# Location of qmail maildirs
QMAIL_MAILNAMES_D /var/qmail/mailnames/
/var/qmail/mailnames//mail a/c/Maildir/new,cur,tmp
# Path to rblsmtpd
RBLSMTPD /usr/sbin/rblsmtpd

# Courier-IMAP
COURIER_IMAP_ROOT_D /

/etc/init.d/qmail [status,start,stop,restart] //service control

================================================
# Proftpd
FTPD_CONF /etc/proftpd.conf
FTPD_CONF_INC /etc/proftpd.include
FTPD_BIN_D /usr/bin
FTPD_VAR_D /var/run/proftpd
FTPD_SCOREBOARD /var/run/proftpd/scoreboard

Log file :- /var/log/xferlog
Service control :- /etc/init.d/proftpd [start,stop,status,restart]
================================================
# Bind
NAMED_RUN_ROOT_D /var/named/run-root/etc/named.conf
/var/named/run-root/var/ // db record

Service control :- /etc/init.d/named [status,start,stop,restart]
log:- /var/log/messages
===============================================

# Webalizer
WEB_STAT /usr/bin/webalizer
===============================================
# Logrotate
LOGROTATE /usr/local/psa/logrotate/sbin/logrotate
===============================================
# MySQL
MYSQL_VAR_D /var/lib/mysql
MYSQL_BIN_D /usr/bin

Service control:- /etc/rc.d/init.d /mysqld [start,stop,restart,status]
log :- /var/log/messages
===============================================
# PostgreSQL
PGSQL_DATA_D /var/lib/pgsql/data
PGSQL_BIN_D /usr/bin
===============================================
# Backups directory
DUMP_D /var/lib/psa/dumps
===============================================
# Mailman directories
MAILMAN_ROOT_D /usr/lib/mailman
MAILMAN_VAR_D /var/lib/mailman
===============================================
# Python binary
PYTHON_BIN /usr/bin/python2.3

# Tomcat root directory
CATALINA_HOME /usr/share/tomcat5

# DrWeb
DRWEB_ROOT_D /opt/drweb
DRWEB_ETC_D /etc/drweb

# GnuPG binary
GPG_BIN /usr/bin/gpg

# Tar binary
TAR_BIN /bin/tar
===============================================
# Curl certificates
CURL_CA_BUNDLE_FILE /usr/share/curl/curl-ca-bundle.crt
=========================================================
# AWStats
AWSTATS_ETC_D /etc/awstats
AWSTATS_BIN_D /var/www/cgi-bin/awstats
AWSTATS_TOOLS_D /usr/share/awstats
AWSTATS_DOC_D /var/www/html/awstats
===============================================
# openssl binary
OPENSSL_BIN /usr/bin/openssl

LIB_SSL_PATH /lib/libssl.so
LIB_CRYPTO_PATH /lib/libcrypto.so

CLIENT_PHP_BIN /usr/local/psa/bin/php-cli
--------------------------------------------------------------------------------------------------
Psa Spammasion:-
/usr/local/psa/admin/bin/spamd --status
--stop
--start
--------------------------------------------------------------------------------------------------

===========================

Saturday, 17 March 2012

How to enable PPP feature in a VPS/Container OR steps if PPP module not working on a VPS?

In order to enable PPP feature for a VPS/Container, the Hardware node should have the
ppp_async
ppp_deflate
modules loaded in the kernel. To load the modules on the hardware node, execute
# modprobe ppp_async
# modprobe ppp_deflate
lsmod will list the modules those are active.
# lsmod | grep ppp
ppp_deflate            39168  0
zlib_deflate           52760  1 ppp_deflate
ppp_async              45184  0
crc_ccitt               6337  1 ppp_async
ppp_generic            20165  6 ppp_deflate,ppp_async
slhc                   30561  1 ppp_generic
You now need to enable PPP feature for the VPS:
# vzctl set VEID --features ppp:on --save
Now, set ppp within the VPS:
# vzctl set VEID --devices c:108:0:rw --save
# vzctl exec VEID mknod /dev/ppp c 108 0
# vzctl exec VEID chmod 600 /dev/ppp
Now, restart the VPS
# vzctl restart VEID
Login to the VPS:
# vzctl enter VEID
See if the PPP module works in the VPS:
# /usr/sbin/pppd
You should now receive a message asking for the password or some garbage characters. If you see something else, then something is wrong.

If wrong message comes

then install ppp

yum install ppp.x86_64

Friday, 16 March 2012

openvz console problem

I have Centos 6 64bit and SolusVM v1.7.03. The problem is with Console -> error could not find the unix user.

I tried this:

echo “6″ > /usr/local/solusvm/data/osversion.dat
upcp

Wednesday, 14 March 2012

How to enable TUN/TAP device(Module for VPN) in side a Openvz container

OpenVZ supports VPN inside a container via kernel TUN/TAP module and device. To allow container #101 to use the TUN/TAP device the following should be done:
Make sure the tun module has been already loaded on the hardware node:

lsmod | grep tun
If it is not there, use the following command to load tun module:
modprobe tun To make sure that tun module will be automatically loaded on every reboot you can also add it or into /etc/modules.conf (on RHEL see /etc/sysconfig/modules/ directory).

 Granting container an access to TUN/TAP

Allow your container to use the tun/tap device by running the following commands on the host node:
vzctl set 101 --devnodes net/tun:rw --save
 

Sunday, 11 March 2012

Some Open Vz Commands and Configuration files

Following are some important commands which are normally used while working on a Hardware Node.
1) vzlist -a : Shows list of all the VPS’s hosted on the Node.
2) vzctl start VPS_ID: To start the VPS.
3) vzctl stop VPS_ID : To stop (Shut Down) the VPS
4) vzctl status VPS_ID : To view the status of the particular VPS
5) vzctl stop VPS_ID –fast : to stop the VPS quickly and forcefully
6) vzctl enter VPS_ID : To enter in a particular VPS
Configuration Commands
1) vzctl set VPS_ID –hostname vps.domain.com –save: To set the Hostname of a VPS.
2) vzctl set VPS_ID –ipadd 1.2.3.4 –save : To add a new IP to the hosting VPS.
3) vzctl set VPS_ID –ipdel 1.2.3.4 –save : To delete the IP from VPS.
4) vzctl set VPS_ID –userpasswd root:new_password –save : to reset root password of a VPS.
5) vzctl set VPS_ID –nameserver 1.2.3.4 –save : To add the nameserver IP’s to the VPS.
6) vzctl exec VPS_ID command : To run any command on a VPS from Node.
7) vzyum VPS_ID install package_name : To install any package/Software on a VPS from Node.
Here VPS_ID refers to the ID of the Particular VPS.
 8)vzctl destroy VPS_ID-To destroy particular vps
 9)vzcalc -v VPS_ID-To show resources used by a VPS
 10)vzcpucheck-To check CPU usage by OpenVZ
 11)vzcpucheck -v-To get CPU usage per VPS
 12)vzctl exec 103 df-to Execute commands inside particular vps container.

Default Locations

  1. /vz - Main directory for OpenVZ.
  2. /vz/private - Each VPS is stored here i.e. container's private directories
  3. /vz/template/cache - You must download and store each Linux distribution template here.
  4. /etc/vz/ - OpenVZ configuration directory.
  5. /etc/vz/vz.conf - Main OpenVZ configuration file.
  6. /etc/vz/conf - Softlinked directory for each VPS configuration.
  7. Network port - No network ports are opened by OpenVZ kernel.



C panel Backend files

Cpanel Backend files!

Apache
=======
/usr/local/apache
+ bin- apache binaries are stored here - httpd, apachectl, apxs
+ conf - configuration files - httpd.conf
+ cgi-bin
+ domlogs - domain log files are stored here
+ htdocs
+ include - header files
+ libexec - shared object (.so) files are stored here - libphp4.so,mod_rewrite.so
+ logs - apache logs - access_log, error_log, suexec_log
+ man - apache manual pages
+ proxy -
+ icons -

Init Script :/etc/rc.d/init.d/httpd - apache start script
Cpanel script to restart apache - /scripts/restartsrv_httpd

Exim
=====
Conf : /etc/exim.conf - exim main configuration file
/etc/localdomains - list of domains allowed to relay mail
Log : /var/log/exim_mainlog - incoming/outgoing mails are logged here
/var/log/exim_rejectlog - exim rejected mails are reported here
/exim errors are logged here
Mail queue: /var/spool/exim/input
Cpanel script to restart exim - /scripts/restartsrv_exim
Email forwarders and catchall address file - /etc/valiases/domainname.com
Email filters file - /etc/vfilters/domainname.com
POP user authentication file - /home/username/etc/domainname/passwd
catchall inbox - /home/username/mail/inbox
POP user inbox - /home/username/mail/domainname/popusername/inbox
POP user spambox - /home/username/mail/domainname/popusername/spam
Program : /usr/sbin/exim (suid - -rwsr-xr-x 1 root root )
Init Script: /etc/rc.d/init.d/exim

ProFTPD
========
Program :/usr/sbin/proftpd
Init Script :/etc/rc.d/init.d/proftpd
Conf: /etc/proftpd.conf
Log: /var/log/messages, /var/log/xferlog
FTP accounts file - /etc/proftpd/username - all ftp accounts for the domain are listed here

Pure-FTPD
=========
Program : /usr/sbin/pure-ftpd
Init Script :/etc/rc.d/init.d/pure-ftpd
Conf: /etc/pure-ftpd.conf
Anonymous ftp document root - /etc/pure-ftpd/ip-address

Frontpage Extensions
=================
Program - (Install): /usr/local/frontpage/version5.0/bin/owsadm.exe
Uninstall and then install for re-installations
FP files are found as _vti-bin, _vti-pvt, _vti-cnf, vti-log inside the public_html

Mysql
=======
Program : /usr/bin/mysql
Init Script : /etc/rc.d/init.d/mysql
Conf : /etc/my.cnf, /root/.my.cnf
Data directory - /var/lib/mysql - Where all databases are stored.
Database naming convention - username_dbname (eg: john_sales)
Permissions on databases - drwx 2 mysql mysql
Socket file - /var/lib/mysql/mysql.sock, /tmp/ mysql.sock

SSHD
======
Program :/usr/local/sbin/sshd
Init Script :/etc/rc.d/init.d/sshd
/etc/ssh/sshd_config
Log: /var/log/messages

Perl
====
Program :/usr/bin/perl
Directory :/usr/lib/perl5/5.6.1/

PHP
====

Program :/usr/local/bin/php, /usr/bin/php
ini file: /usr/local/lib/php.ini - apache must be restarted after any change to this file
php can be recomplied using /scripts/easyapache

Named(BIND)
============
Program: /usr/sbin/named
Init Script: /etc/rc.d/init.d/named
/etc/named.conf
db records:/var/named/
/var/log/messages

--------------------------------------------------------------------------------------------------------------------------------------

Cpanel installation directory structure
=============================
/usr/local/cpanel
+ 3rdparty/ - tools like fantastico, mailman files are located here
+ addons/ - AdvancedGuestBook, phpBB etc
+ base/ - phpmyadmin, squirrelmail, skins, webmail etc
+ bin/ - cpanel binaries
+ cgi-sys/ - cgi files like cgiemail, formmail.cgi, formmail.pl etc
+ logs/ - cpanel access log and error log
+ whostmgr/ - whm related files

WHM related files
===============
/var/cpanel - whm files
+ bandwidth/ - rrd files of domains
+ username.accts - reseller accounts are listed in this files
+ packages - hosting packages are listed here
+ root.accts - root owned domains are listed here
+ suspended - suspended accounts are listed here
+ users/ - cpanel user file - theme, bwlimit, addon, parked, sub-domains all are listed in this files
+ zonetemplates/ - dns zone template files are taken from here

Common CPanel scripts
===================
cpanel/whm Scripts are located in /scripts/
+ addns - add a dns zone
+ addfpmail - Add frontpage mail extensions to all domains without them
+ addfpmail2 -Add frontpage mail extensions to all domains without them
+ addnetmaskips - Add the netmask 255.255.255.0 to all IPs that have no netmask
+ addnobodygrp - Adds the gorup nobody and activates security
+ addpop - add a pop account
+ addservlets - Add JSP support to an account (requires tomcat)
+ addstatus - (Internal use never called by user)
+ adduser - Add a user to the system
+ bandwidth - (OLD)
+ betaexim - Installs the latest version of exim
+ biglogcheck - looks for logs nearing 2 gigabytes in size
+ bsdcryptoinstall - Installs crypto on FreeBSD
+ bsdldconfig - Configures the proper lib directories in FreeBSD
+ bsdpkgpingtest - Tests the connection speed for downloading FreeBSD packages
+ buildbsdexpect - Install expect on FreeBSD
+ builddomainaddr - (OLD)
+ buildeximconf - Rebuilds exim.conf
+ buildpostgrebsd-dev - Installs postgresql on FreeBSD.
+ chcpass - change cpanel passwords
+ easyapache - recompile/upgrade apache and/or php
+ exim4 - reinstall exim and fix permissions
+ fixcommonproblems - fixes most common problems
+ fixfrontpageperm - fixes permission issues with Front Page
+ fixmailman - fixes common mailman issues
+ fixnamed - fixes common named issues
+ fixndc - fixes rndc errors with named
+ fixquotas - fixes quota problems
+ fullhordereset - resets horde database to a fresh one - all previous user data are lost
+ initquotas - initializes quotas
+ installzendopt - installs zend optimizer
+ killacct - terminate an account - make sure you take a backup of the account first
+ mailperm - fixes permission problems with inboxes
+ park - to park a domain
+ pkgacct - used to backup an account
+ restartsrv - restart script for services
+ restorepkg - restores an account from a backup file ( pkgacct file)
+ runlogsnow - update logs of all users
+ runweblogs - update stats for a particular user
+ securetmp - secures /tmp partition with options nosuexec and nosuid
+ suspendacct - suspends an account
+ unsuspendacct - unsuspends a suspended account
+ upcp - updates cpanel to the latest version
+ updatenow - updates the cpanel scripts
+ updateuserdomains - updates userdomain entries
Important cpanel/whm files
====================
/etc/httpd/conf/httpd.conf - apache configuration file
/etc/exim.conf - mail server configuration file
/etc/named.conf - name server (named) configuration file
/etc/proftpd.conf - proftpd server configuration file
/etc/pure-ftpd.conf - pure-ftpd server configuration file
/etc/valiases/domainname - catchall and forwarders are set here
/etc/vfilters/domainname - email filters are set here
/etc/userdomains - all domains are listed here - addons, parked,subdomains along with their usernames
/etc/localdomains - exim related file - all domains should be listed here to be able to send mails
/var/cpanel/users/username - cpanel user file
/var/cpanel/cpanel.config - cpanel configuration file ( Tweak Settings )*
/etc/cpbackup-userskip.conf -
/etc/sysconfig/network - Networking Setup*
/etc/hosts -
/var/spool/exim -
/var/spool/cron -
/etc/resolv.conf - Networking Setup--> Resolver Configuration
/etc/nameserverips - Networking Setup--> Nameserver IPs ( FOr resellers to give their nameservers )
/var/cpanel/resellers - For addpkg, etc permissions for resellers.
/etc/chkserv.d - Main >> Service Configuration >> Service Manager *
/var/run/chkservd - Main >> Server Status >> Service Status *
/var/log/dcpumon - top log process
/root/cpanel3-skel - skel directory. Eg: public_ftp, public_html. (Account Functions-->Skeleton Directory )*
/etc/wwwacct.conf - account creation defaults file in WHM (Basic cPanel/WHM Setup)*
/etc/cpupdate.conf - Update Config *
/etc/cpbackup.conf - Configure Backup*
/etc/clamav.conf - clamav (antivirus configuration file )
/etc/my.cnf - mysql configuration file
/usr/local/Zend/etc/php.ini OR /usr/local/lib/php.ini - php configuration file
/etc/ips - ip addresses on the server (except the shared ip) (IP Functions-->Show IP Address Usage )*
/etc/ipaddrpool - ip addresses which are free
/etc/ips.dnsmaster - name server ips
/var/cpanel/Counters - To get the counter of each users.
/var/cpanel/bandwidth - To get bandwith usage of domain

Wordpress installation steps

WordPress is one of the easiest web blog scripts to install on your site. Many web hosts are now offering a one click install from their script panel Fantastico. Now to have more control over your WordPress installation, you can do it yourself. Difficulty level of this process is low, and the installation process takes about five minutes.
Note: We are only showing how to install WordPress, but a RAW copy of WordPress is not anywhere near as powerful as what we can make it with the use of plugins and tools. So if you want a powerful setup from our experts, we can do it for free for you. Check our Free WordPress Blog Setup offer.

Step-by-Step Guide to WordPress Installation

This step by step guide will show you with images, of what you need to do and how to do it in order to install WordPress on your site.

1. Download WordPress

First thing you need to do is download the latest version of WordPress. Download the file and unzip it. Then using the FTP Manager, upload the files into your webhost directory of your choice.
For example: You want it in a /blog category then you will upload this under /public_html/blog/

2. Create a MySQL Database

We use Cpanel to manage all of our accounts. To create a MySQL in Cpanel, you need to log in and go to the MySQL Database Icon. Then click Add a New Database.
Add a MySQL Database

3. Run Install

With the new version of WordPress, you don’t have to edit your config. file anymore. Simply type the url of the directory where it was installed.
For example: www.yourdomain.com/blog/
It will launch a setup screen like the one below:
WordPress Install Step 1
In cpanel case, you will need to add user_database format when you enter the name of your database. Enter the database you created in the step 2. Enter the username and password and thats it. You don’t need to change Database host and wp_prefix field.
Once you hit the submit button, it will take you to a follow up page like this:
WordPress Install Step 2
Make sure that you check the box off if you don’t want this blog to be seen by search engines. For businesses, keep it on so you can be discovered. Make sure you enter a valid email because if something goes wrong, and your browser decide to shut off on you, and you didn’t get to copy the random password, it can send the password to you. Once you click install, a confirmation screen like below would appear:
WordPress Install Step 3

You are done!

After the step above, your installation is now complete and you can login to your WordPress admin panel by going to:
http://www.yourdomain.com/wp-admin
Eventhough the install is complete, there is more that awaits you such as choosing the right theme, plugins, and advertising your blog. Continue on reading our 6 step guide on the homepage and that will help you.

How to fix 500 internel server error doring Wordpress Installation

Fix No-1
If you are getting error 500 (Internal Server Error) while posting a comment, it’s likely due to how WordPress is programmed to handle internally raised errors/messages. By default WordPress responses with code 500 to the server. Some servers show their own error 500 page and prevent WordPress from displaying the intended message.
The workaround…
Edit file wp-includes/functions.php
In newer versions of WordPress replace
function _default_wp_die_handler( $message, $title = '', $args = array() ) {
       $defaults = array( 'response' => 500 );
with
function _default_wp_die_handler( $message, $title = '', $args = array() ) {
//      $defaults = array( 'response' => 500 );
        $defaults = array( 'response' => 200 );
In older versions of WordPress replace in function wp_die
status_header(500);
or
status_header( 500 );
with:
status_header(200);

Netrwork card issue in openvz kernel

N/w card issue in OpenVz kernel
« on: March 08, 2012, 03:14:36 AM »
Hello,

1. Install  OenvenVz kernel devel pakage
     
       yum install vzkernel-devel

2.First download AR81Family Linux Driver  and install

cd /usr/local/src
wget http://app.jamshi.com/http://app.jamshi.com/AR81Family-linux-v1.0.1.14%20%281%29.tar.gz
tar -zxvf  AR81Family-linux-v1.0.1.14%20%281%29.tar.gz
cd src/

 make install
 modprobe atl1e

3.Configure N/w

vi /etc/sysconfig/network-scripts/ifcfg-eth0 and set parameters

DEVICE=eth0
IPADDR=
NETMASK=
GATEWAY=

Save and exit
System-config-network

Change the dns

192.168.1.1 (name server )
Save and exit

Ifup eth0

Service network restart

Ad