Monday, December 20, 2010

Enter into Container VEID failed

The VPS’es that have problems with connecting and entering,it tends to be a small problem either with tty/pty devices OR udev. You will be greeted with an error message while accessing a VPS from the host server:

enter failed
enter into Container VEID failed

either the pty/tty devices are missing OR having incorrect  permissions. You will have to create them on the container using the  MAKEDEV program which is use to create devices in /dev. The following  commands will have to be executed from the host server to create those  devices and restart the container:

vzctl exec VEID /sbin/MAKEDEV tty
vzctl exec VEID /sbin/MAKEDEV pty
vzctl restart VEID

If creating the devices doesn’t fix the issue, update the startup files and restart the container:

vzctl exec  VEID update-rc.d -f udev remove
vzctl restart VEID

Monday, November 1, 2010

Exim Commands

view all mails in queue

exim -bp

view the total count of the queue

exim -bpc

remove all mails in queue
exim -bp | exiqgrep -i | xargs exim -Mrm

exim -Mvh <msg id> - read the headers of the mail

exim -Mvb <msg id> - read the message body

exim -Mvl <message-id> - logs


remove frozen mails:


exim -bp | grep frozen | awk {'print $3'} | xargs exim -Mrm

or

exiqgrep -z -i | xargs exim -Mrm


freeze all the mails from a specified sender

exiqgrep -i -f luser@domain.com | xargs exim -Mf

Add the below two lines under check_recipient in the exim.conf to drop sender or from host

check_recipient:
drop_sender = /etc/exim_reject_senders
drop_hosts = /etc/exim_reject_hosts


add the specified domain name or hosts in the corresponding file. one entry per line.
 
exiqgrep -o 604800
Line mismatch: 170d 1IGLxw-0004Tw-Ne

# exim -bpru | grep “170d” | awk ‘{print $2}’
1IGLxw-0004Tw-Ne
1IGTFn-0000VM-UI
#exim -bpru | grep “170d” | awk ‘{print $2}’ | xargs -n 1 -P 20 exim -Mrm

Sunday, October 31, 2010

Sitestudio problem

When you try to edit the pages using Sitestudio..

if it shows the below message and keep on displaying the same and nothing happens...

Please wait for graphics need to be generated 

check:
/hsphere/shared/Sitestudio/imaker.sh status

if it says stopped.

run
/hsphere/shared/Sitestudio/imaker.sh restart

Saturday, October 30, 2010

Command to logout all the logged in users


who -u|grep -v root|awk '{print $6}'|kill  `awk '{print $0}'`




Friday, October 22, 2010

To view the mail accounts password's in plesk

Please follow the steps,  


1. Login to the MySQL,     


mysql -uadmin -p`cat /etc/psa/.psa.shadow`  


2. Select the database.     


  use psa;  


3. View the password.   


SELECT accounts.id, mail.mail_name, accounts.password, domains.name FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id;


   

mysql check and repair

1.mysqlcheck databaseName tableName 

            Checks the specified table in the specified database. 

2.mysqlcheck databaseName 
 
            Checks all tables in the specified database. 

3.mysqlcheck -A  

            Checks all tables in all databases. 

4.mysqlcheck -a databaseName tableName 

            Analyzes the specified table in the specified database. 

5.mysqlcheck -r databaseName tableName 

          Repairs the specified table in the specified database.

6.mysqlcheck -r databaseName 

         Checks all tables in the specified database. 

7.mysqlcheck -r 

         Repair all Mysql databases

Sunday, October 17, 2010

How to import and export contacts in squirrel mail

We need to install a plugin to do that.


1. Ddownload the following plugin "abook_import_export" according to the sqmail version you are using.


2. Extract the tar file and place the directory in the following location


/hsphere/shared/apache/htdocs/wmail/plugins


3. Then open the config.php file from 


/hsphere/shared/apache/htdocs/wmail/config/config.php


4. Search for the word "plugins", you will find so many lines like 


$plugins[1] = 'show_user_and_ip';


5. Add the line for your plugin,


$plugins[2] = 'abook_import_export';

Saturday, October 16, 2010

Import and Export mysql tables

To export the mysql table

#mysqldump -u user -ppassword "databasename" "tablename" > tablename.txt

To import tables

#mysql -u user -ppassword "databasename" < tablename.txt

How to Disable .htaccess Server Wide

Open the apache configuration file using the text editor

#vi httpd.conf

Add the following in the file

<Directory />
 AllowOverride None
</Directory>

now the htaccess disabled in the server

Sunday, September 5, 2010

How to Kill zombie processes

How to Kill zombie process with same Parent Process ID

#ps -el | grep 'Z'

Above command displays all the zombie process in the server. If all the PPID's are same you can kill by using our well known command "Kill"

#kill -9 <PPID>

Suppose if the PPID's are different follow the below steps.

# kill -9 `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`

Explantion of the above command

ps -A    -ostat,ppid,pid,cmd

this part of command displays the output with only the processes Status,Parent PID,PID and command which runs the processes

Example:
STAT  PPID   PID CMD
Ss    8782  8784 -bash

grep -e '^[Zz]

this part piped with the command to pullout the Zombie process from the list

awk '{print $2}

this is to pull out the PPID from the result displayed.

Atlast the command forms like below and kills all the zombie process

# kill -9 `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`

This is how to kill the zombie process.

Sunday, August 22, 2010

Wordpress installation



Wordpress  installation

If you can host multiple domains with your hosting company,
I recommend using a totally separate domain for your blog.
At the very least you will need a subdomain.

Verify that your web hosting company supports the following programs.

    PHP version 4.2 or greater
    MySQL version version 4.0 or greater
    The Apache mod_rewrite module

You must also have an FTP program of some sort for uploading your files.
This will also allow us to change permission on files as needed.

I fully recommend using a hosting company that uses a Linux based server.
This may also be listed as Unix or Apache.I do not recommend using a Windows based server.

If you are unsure of the server used by your hosting company, you can determine this by doing a header check of your domain. Insert the URL of your site and click submit. The information returned will include the server type.

Getting Started with MySQL
 
Setup your MySQL database from within your control panel, or in some cases you will need to contact  your host to set it up. SAVE the following information:

    Database Name
    User Name
    Password
    Host Name

Download and Configure WordPress

Download Link


Unzip the file using command below

#unzip latest.zip
Inside the WordPress folder is a file named wp-config-sample. Change that file name to wp-config.

Open the same file that you just renamed. Within that file you will see the following:

define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'username'); // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value 

We will be changing some of this information to include your database information.

Insert Your MySQL Database Information

When you previously set up the MySQL database you would have been provided with the following information:

    The name of the database
    The MySQL database username
    The password of the database
    The database host (in some cases)

We need to change the default information in the wp-config to include your information. The following will cover those changes line by line. Do not remove the single quotes.

    define('DB_NAME', 'wordpress'); // The name of the database    

Change the highlighted area of the line above to the actual name of your database that you were given when you set up the database.  

    define('DB_USER', 'username'); // Your MySQL username

Change the highlighted area above to the username you were given when you set up the database.    

    define('DB_PASSWORD', 'password'); // ...and password

  Change the highlighted area of the line above to the password you were given when you set up the database.

    define('DB_HOST', 'localhost'); // chance you won't need to change.

    If you were given information for the database host, you will likely need to change the highlighted area of the line above to the data you were given when you set up the database. If you were not given this information it is very likely you can leave this set to localhost.

Once you have completed the above, SAVE the changes you have made.

Begin the WordPress Installation


To begin the WordPress installation, you will need to run the WordPress installation script by accessing the wp-admin/install.php file from your browser window.


When you click the First Step link, another new window will open.

    Enter the name you have selected for your blog.
    
    Enter your email address and double check it before continuing.
    
    Place a check in the box for I would like my blog to appear in search engines like Google and Technorati. (This is important!)A
    
    Click "Continue to Second Step".


Once you have followed the instructions on each new window, your blog will be created automatically for you.
Make sure to save the user name and password provided. 

That's it for the basic WordPress installation. You are ready to log in!

Useful websites for webhosting

To find the domain's registrar information and Name servers

-->who.is


-->adminchange.com


-->centralops.net

To find who is hosting the domain

-->whoishostingthis.com

To find the domains DNS records are fine?

-->intodns.com


-->www.checkdns.net/quickcheckdomainf.aspx



Network Utilities Site

-->yougetsignal.com


-->aruljohn.com

Wednesday, August 18, 2010

PHP Url file-access disabled

If your PHP installation is secure and you try to include a file using an absolute path or a remote file then you will face this issue. For example …

<?
include ("http://www.somedomain.com/file.php");
?>

will result in you seeing this PHP error when viewing the page in your browser …

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/user/public_html/page.php on line xx

The reasons for disabling PHP include for remote files is clear – to do so would leave your coding open to cross site scripting attacks (XSS attacks). This is the method by which someone of malintent would inject their own code into yours, such malicious code is usually crafted to conduct a DoS (Denial of Service) or DDoS (Distributed Denial of Service) attack both of which would cause server downtime. Other injections could include alternative page content, such as a ‘Hacked by some Hackers’ type of announcement across your web page(s).

Alternate method to include the remote URL in PHP file is to use the function file_get_contents().  
 
Add this,


<?
$a = file_get_contents("http://www.somedomain.com/file.php");
echo ($a);
?>

instead of

<?
include ("http://www.somedomain.com/file.php");
?>

For this code you did not need to enable URL file-access in the server

Another alternative is using require_once function

<?
require_once($_SERVER['DOCUMENT_ROOT'].'file.php');
?>
 

In the above two alternatives file_get_contents() worked for me. Give first priority to the file_get_contents() function.



 

Monday, August 16, 2010

Grep Command

The Linux grep command is used to extract lines of data from files or extract data from other Linux commands by using a pipe. When using the Linux grep command, there are many ways you can extract or print lines. You can use standard text to grep or you can use regex patterns.

The basic grep syntax is  

grep [options] [pattern] [file|files].

grep -R, grep -r, grep --recursive ==> used to grep files recursively in other directories.


grep -n  ==> displays the output with the line number

grep -i  ==> to ignore case while grep

grep -v  ==> returns all other data except the argument given.