Sunday, 25 December 2011

Increase the access Speed of the site using .htaccess Cache

When the two modules namely "mod_expires" and "mod_headers" has been enabled in the server, you can increase the access speed of your website by entering the following in your .htaccess.

=====================
 # BEGIN Compress text files
<ifModule mod_deflate.c>
<filesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</ifModule>
# END Compress text files

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers

# BEGIN Turn ETags Off
<ifModule mod_headers.c>
Header unset ETag
</ifModule>
FileETag None
# END Turn ETags Off

# BEGIN Remove Last-Modified Header
<ifModule mod_headers.c>
Header unset Last-Modified
</ifModule>
# END Remove Last-Modified Header
=====================

Have a Great Surfing by enabling this :) :) :) 


Thursday, 22 December 2011

Partition a new drive in a server/VPS

-----------------------------------------------------------
How to partition a disk, set its file type & then mount it
-----------------------------------------------------------

1) To know all the disks attached to VPS/Server type

# fdisk -l

It will show you all the disk along with the unpartitioned disk. Let we attached a new disk "/dev/xvdb" to server. It will show the following message on "fdisk -l":

----
/dev/xvdb has no partition table.
----

2) Execute the following:

# parted /dev/xvdb

3) Type "mklabel"
4) It will ask "New disk label type?" type "msdos"
5) Type "print free" to know the partition details.
6) Type "mkpart primary 0.00kB 53.7GB" (let the total size is 53.7GB)
7) type "quit"

Please see the following snippet for reference:

=====================
root@server [~] parted /dev/xvdb
GNU Parted 1.8.1
Using /dev/xvdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Error: Unable to open /dev/xvdb - unrecognised disk label.
(parted) mklabel
New disk label type? msdos
(parted) print free

Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdb: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
0.00kB 53.7GB 53.7GB Free Space

(parted) mkpart primary 0.00kB 53.7GB
(parted) print free

Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdb: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 0.51kB 53.7GB 53.7GB primary

(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.

root@server [~]#
=====================

8) Execute the following command:

# fdisk -l

This time it will show the new disk too. Now we have to set the file system type on the disk and mount it.

====================
root@server [~]# fdisk -l

Disk /dev/xvda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/xvda1 * 1 7832 62910508+ 83 Linux

Disk /dev/xvdb: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/xvdb1 1 6528 52428799+ 83 Linux
====================

9) Set the filesystem type for the new disk using "mkfs.ext3 /dev/xvdb1"

====================
root@server [~]# mkfs.ext3 /dev/xvdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
6553600 inodes, 13107199 blocks
655359 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
400 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
====================

10) Take a backup of file "/etc/fstab" and then open it using "vi" editor and mount it

------
root@server [~]# cp -pv /etc/fstab /etc/fstab2
------

We will add the following line in "/etc/fstab". Here we are mounting the partition at "/backup".

------
/dev/xvdb1 /backup ext3 defaults 0 0
------
11) Use the following command to mount it.

------
root@server [~]# mount /backup
------

Thank you.

Saturday, 17 December 2011

Plesk back end files


+ Plesk URL:https://IP address:8443

+ Plesk admin password:/etc/psa/.psa.shadow. For newer version(that is plesk10), the password is stored in encrypted format in /etc/psa/.psa.shadow. So, you can retrieve the password by executing the following command.

/usr/local/psa/bin/admin --show-password

+ Version: /usr/local/psa/version.

+ Plesk configuration file : /etc/psa/psa.conf. The backup location is mentioned in this file. To check the backup location of the domains, you can use the following command.

----------
 # grep  -i dump_d  /etc/psa/psa.conf
DUMP_D /backup
----------

+ Plesk control panel log file: /var/log/sw-cp-server/error_log
+ Start plesk control panel: /etc/init.d/sw-cp-server start

==========
Webserver: Apache
==========

+ Main httpd configuration file : /etc/httpd/conf/httpd.conf
+ Plesk httpd : /etc/httpd/conf.d/zz010_psa_httpd.conf
+ Domain httpd: /var/www/vhosts/
+ Apache error log file: /var/log/httpd/error_log
+ Apache Acesss log: /var/log/httpd/access_log
+ Domain's error log file: /var/www/vhosts/domain_name/statistics/logs/error_log
+ Domain's access log: /var/www/vhosts/domain_name/statistics/logs/access_log
+ Domains documentroot: /var/www/vhosts/domain_name/httpdocs
+ Start Apache service: /etc/inid.d/httpd start

=========
PHP
=========
 Php configuration file :/etc/php.ini

=========
Named
=========

+ Configuration  file: /var/named/run-root/etc/named.conf
+ Domains Zone file: /var/named/run-root/var/domain.com
+ Log file: /var/log/messages
+ Start named service:/etc/init.d/named start

==========
FTP: Proftpd
==========

+ Configuration File: /etc/proftpd.conf
+ Log file: /var/log/messages
+ Start Proftpd service: /etc/init.d/proftpd start

==========
Database: Mysql
==========

+ Configuration File: /etc/my.cnf
+ Data directory: /var/lib/mysql
+ Mysql log : /var/log/mysqld.log
+ Start mysqld service: /etc/init.d/mysqld start

=========
Mail server: qmail
=========
+ Location of qmail directory : /var/qmail
+ Mail directory of a domain : /var/qmail/mailnames/domain.com
+ Mail log: /usr/local/psa/var/log/maillog
+ Mail queue: /var/qmail/bin/qmail-qstat
+ Start  qmail service: /etc/init.d/qmail start








Tuesday, 13 December 2011

Plesk + Retrieve EMAIL account password

FOR BOTH LINUX AND WINDOWS SERVERS:
In a shared server(both linux and windows), it is quite tedious to determine the email password for email accounts if you are not much familiar with MySQL. But you can use the following command to retrieve all the email password for a domain.

=======
SELECT mail.mail_name, accounts.password FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id WHERE domains.name = 'yourdomain.com'
=======

Steps:
1. Login to MySQL prompt
[For Linux]
mysql -uadmin -p`cat /etc/psa/.psa.shadow`
[For Windows]
1. Retrieve the Plesk password [ cd %plesk_bin%, plesksrvclient.exe -get ]
1. Goto plesk directory [cd %plesk_dir%]
2. Goto the bin folder of the MySQL directory [cd Databases\MySQL\bin
mysql.exe -uadmin -penter_password_here -P8306

2. Use psa database;
use psa;

3. Execute the following query

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

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

ONLY FOR LINUX SERVERS:

Alternatively, for Linux servers you can use the following command to retrieve the email password for a specific mail account.

==========
/usr/local/psa/admin/bin/mail_auth_view |grep name@domain.com
==========

Sunday, 11 December 2011

Prevent files from Indexing in Search engine

Search Engines plays a bigger role in advertising the site and increasing the visitors to the site. Along with that, Search engine sometimes brings out the files that are to be hidden.

In order to prevent the files from indexing in Search Engine, here are the steps you need to follow.

1. Create a file called robots.txt in the home directory of the Site. (i.e public_html)

2. For Example, if you don't want the files in a folder called admin to be listed in search engines, paste the below code in robots.txt file.

==========

User-agent: *

Disallow: /admin/

==========

3. The above command will prevent the files begining with name admin from listing in Search engines. Similarly, you can add any number of folders or files.



Note: If you do a search in any search engine, it will cache the search results and will display the same results until the cache is cleared. So, after implementing the robots.txt file, check its working by searching with the keyword in other search engines, where you haven't performed search earlier.

Saturday, 10 December 2011

Catching Spammers on cPanel Server -EXIM (MTA)


Catching Spammers on cPanel Servers:

Follow the steps given below to catch Spammers sending mails from scripts (
nobody emails

1. Edit /etc/exim.conf

2. On the second line add (After hostlist auth_relay_hosts = * ) :

log_selector = +address_rewrite +all_parents +arguments +connection_reject
+delay_delivery +delivery_size +dnslist_defer +incoming_interface
+incoming_port +lost_incoming_connection +queue_run +received_sender
+received_recipients +retry_defer +sender_on_delivery +size_reject
+skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error
+smtp_syntax_error +subject +tls_cipher +tls_peerdn
Make sure all that comes on a single line.

3. Save and exit.

4. Restart Exim.
A keep a watch on /var/log/exim_mainlog as you should be able to trace path
to directory from which the spammer(s) is / are spamming.

if the spammer is not spamming using formmail scripts then go through
following steps :-

1 > Get the message ID from the header of the spam. It should be in format
like 1DWJj4-00042i-74 ( this is the most important step else all thats given
below is crap )

2 > grep exim_mainlog with the message ID ( Ex : grep 1DWJj4-00042i-74
/var/log/exim_mainlog )

3 > Check the time on which the spam was sent and also check all that is
shown after grep.

4 > If you find out the domain name or path of the scripts from exim_mainlog
then go ahead and suspend the spammer, else proceed to step 5.

5 > Use this message ID to check the original message or bounced message in
/var/spool/exim/input/. You should see 2 files there, one with -D at end and
one with -H at the end. ( Ex : /var/spool/exim/input/4/1DWJj4-00042i-74-D &
/var/spool/exim/input/4/1DWJj4-00042i-74-H ) This 2 files will have all the
information that was sent in the spam message and if it was sent using
mailing list then you will catch the username of spammer in auth_sender part
of this files. If it shows nobody then its your bad luck Proceed to step 6.

6 > If exim_mainlog shows the spams originating from /tmp of the server and
check the file in /tmp of the server. wner of the file will be seen as
nobody:nobody. Take down the time of creation of file. This time is what we
need to find out who uploaded the script. You will need to convert this time
into the time format of /usr/local/apache/logs/error_log & then in the
format of the domlogs located at /usr/local/apache/domlogs/*

7 > for file in /usr/local/apache/domlogs/*; do cat $file |grep “example”;
done; ( you cannot do direct grep for the query here as it will give error
that the arguement list is too long )

8 > If the results in step 2 have shown some domain name or some username in
common as sender of the spam but now you dont see that domain name on the
server then check /var/cpanel/accounting.log to see if that account has been
terminated from the server ( Ex : grep
ebayspammer.com/var/cpanel/accounting.log )
All that we need to know is importance of /var/log/exim_mainlog,
/var/log/formmail.log, /usr/local/apache/logs/error_log,
/usr/local/apache/domlogs/*,
/var/spool/exim/input/*/* and the files uploaded in /tmp of the server.
Major spamming issues are caught using the time of sending the spam. You
will need to work on your own when you get across such issue and use your
logic to convert the time of sending the spams to the time format of
respective log files I mentioned above.
-> Files in /var/spool/exim/msglog contain logging information for each message and are named the same as the message-id.
-> Files in /var/spool/exim/input are named after the message-id, plus a suffix denoting whether it is the envelope header (-H) or message data (-D).
These directories may contain further hashed subdirectories to deal with larger mail queues, so don't expect everything to always appear directly in the top /var/spool/exim/input or /var/spool/exim/msglog directories; any searches or greps will need to be recursive. See if there is a proper way to do what you're doing before working directly on the spool files.

Limit apache bandwidth per user

I have a server and running with Apache. I know that the cPanel has the bandwidth limit but the user should not exceed the normal limit of band width for a day or hour. How should I do that using Apache.

You can use mod_bw on apache2 to limit the speed of which files get uploaded. Make sure that you have installed this module in your Apache.

Check the bandwidth module installed in your apache:
#/usr/local/apache/bin/apachectl -M |grep mod_bw

Then,


Method 1:

Limit the bandwidth of the user to 250kbps
Check the config file "httpd.conf"
Go to that location.

Now create a directory with the username and domain name


/usr/local/apache/conf/userdata/std/2/USERNAME/DOMAIN.COM

eg:- username : heman and domain name: hemanth.com

/usr/local/apache/conf/userdata/std/2/heman/hemanth.com

Create a file "cp_bw_all_limit.conf" paste the contents and save and quit.
vi cp_bw_all_limit.conf
<IfModule mod_bw.c>
BandWidthModule On
BandWidth all 256000
</IfModule>
<IfModule mod_bandwidth.c>
BandWidthModule On
BandWidth all 256000
</IfModule>

This will limit the user bandwidth to 250kb/s.

The reason for this customized setup beacuse if you upgrade apache or do some modification this conf will remain the same. In case of upgrade the customized settings will be erased from the http.conf.


Method 2
Limit every user to a max of 10Kb/s on a vhost :

<Virtualhost *>
BandwidthModule On
ForceBandWidthModule On
Bandwidth all 10240
MinBandwidth all -1
Servername
www.example.com
</Virtualhost>

Limit al internal users (lan) to 1000 kb/s with a minimum of 50kb/s , and
files greater than 500kb to 50kb/s.

<Virtualhost *>
BandwidthModule On
ForceBandWidthModule On
Bandwidth all 1024000
MinBandwidth all 50000
LargeFileLimit * 500 50000
Servername
www.example.com
</Virtualhost>

Limit avi and mpg extensions to 20kb/s.

<Virtualhost *>
BandwidthModule On
ForceBandWidthModule On
LargeFileLimit .avi 1 20000
LargeFileLimit .mpg 1 20000
Servername
www.example.com
</Virtualhost>

Using it the "right" way, with output filter by mime type (for text)
to 5kb/s:

<Virtualhost *>
BandwidthModule On
AddOutputFilterByType MOD_BW text/html text/plain
Bandwidth all 5000
Servername
www.example.com
</Virtualhost>





Forward Outgoing email

Forward Outgoing email in cPanel
------------------------------------------------

I like to forward all incoming and outgoing email from my domain to another gmail or yahoo account. I am running with cPanel server. How should I do this. Also the emails that are being forwarded should not be know to any one. Unseen delivery of mails from my domain to another email account.

Solution:

This is the method you can do it via back end. Consider you have a domain say "hemanth.com". You have 15 email accounts in that domain. You need all incoming and outgoing mails to another email account unknowingly to them. Just follow this method.

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



1. To create a blind carbon copy, go to /etc/ and create a new file:
Code:
cp cpanel_exim_system_filter cpanel_exim_system_filter2
2. Add the following at the bottom of the new file (/etc/cpanel_exim_system_filter2):
Code:
if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
then
unseen deliver "hemanth@domain.com"
endif
if $sender_address: contains "domain.com"
then
unseen deliver "hemanth@domain.com"
endif
Now, go to WHM > Exim Configuration Editor and change the system filter to the new path (/etc/cpanel_exim_system_filter2).

Above, please replace
domain.com with the domain name you want to have all emails incoming and outgoing sent to the blind carbon copied address. Please ensure the receiving address for the incoming and outgoing emails is not on the same domain as those you are using for the forwarding, since you might end up creating some type of loop otherwise.




451 Temporarily unable to process your email. Please try again later.

451 Temporarily unable to process your email. Please try again later.
--------------------------------------------------------------------------------------------------

I was trying to send emails. The mails are sent out from my account. But It didn't deliver. I am not sure what was the reason. I have checked my logs in the cPanel server. My mail server is exim. When I grepped the logs I have saw the following error message.

=========
# grep 1RYqhH-002hK2-Ej /var/log/exim_mainlog
2011-12-09 11:00:27 1RYqhH-002hK2-Ej <= test@domain.com
H=localhost (x1.oryon.net) [127.0.0.1] P=esmtpa A=dovecot_login:test@shinfujilabels.com.sg S=951 id=sig.2324d3bc9c.20111209110022.753133gzynv0jwzq@142.17.3.30
T="Test mail"
2011-12-09 11:00:27 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1RYqhH-002hK2-Ej
2011-12-09 11:00:29 1RYqhH-002hK2-Ej == enquiry@domain.com R=dk_lookuphost T=dk_remote_smtp defer (-44): SMTP error from remote mail server after RCPT TO:<enquiry@domain.com>: host eziprint.com.sg [69.89.31.245]: 451 Temporarily unable to process your email. Please try again later.
=========

I have searched in google and I couldn't find any possible solution. Then I have searched many possible solutions but ended up in tragedy. What is the final solution.????

The solution is simple. When you have tried to send mails if there was some issue with remote mail server to deliver mails it will give a remote SMTP error. Exim will store the same message in the exim_database. Even after the remote mail server issue is fixed the mails will be failed. When you are trying to send your mails will be sent out but it will remail in the exim queue with the above error message.


The only solution is to clear the exim database. Use the following commands to clear the exim database and then try to send mails. The issue is fixed.


[root@host]#/script/exim_tidydb

After this run this command in the server.


]# /usr/sbin/exim_tidydb -t 1d /var/spool/exim retry
]# /usr/sbin/exim_tidydb -t 1d /var/spool/exim reject
]# /usr/sbin/exim_tidydb -t 1d /var/spool/exim wait-remote_smtp


 Watch the junk dissappear. You will see loads of junk being deleted. A good thing! If you cPanel installation is relativly new you will see a few messages being removed. If your cPanel installation is more mature you may see hundreds of messages being removed.




After this restart your exim mail server.


/etc/init.d/exim restart


Thats it the issue is fixed. Now try to send/receive mails from your domain it will be delivered fine.

Friday, 9 December 2011

Clobbering a File




Clobbering the files will  helps in keeping the files safe from Accidental over writing. It can be too easy to mistype a filename and find that you’ve redirected output into a file that you meant to save.

To be on safer side you can set clobber for your important files using the bellow command.


--------------
$ set -o noclobber

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

If you decide you don’t want to be so careful after all, then turn the option off:

 --------------
 $ set +o noclobber
 --------------

Example:
-------------
vinoth.sk@3wing18:~$ set -o noclobber
vinoth.sk@3wing18:~$ echo b >a
-bash: a: cannot overwrite existing file
vinoth.sk@3wing18:~$ set +o noclobber
vinoth.sk@3wing18:~$ echo b >a
vinoth.sk@3wing18:~$
-------------

Clobbering a File on Purpose
Use >| to redirect your output. Even if noclobber is set, bash ignores its setting and overwrites the file.

------------
$ echo something > my.file
$ set -o noclobber
$ echo some more >| my.file
$ cat my.file
----------

Script to check the qmail queue

Script to check the email available in the qmail queue.
---------------------------------------------------------------------------

Use this script to find the emails available in the qmail queue.


#!/bin/bash
mails=`/var/qmail/bin/qmail-qstat |grep "messages in queue:"|awk '{print $4}'`
if [ $mails -gt 200 ]; then
SUBJECT="Please check mail queue in RM7"
EMAIL="USER@domain.com"
MESSAGE="/tmp/message.txt"
echo "Please Check mail queue in RM7..It's more than 750" > $MESSAGE
nomail=`/var/qmail/bin/qmail-qstat`
nom=`/var/qmail/bin/qmHandle -s`
echo $nomail >>$MESSAGE
echo $nom >>$MESSAGE
mail -s "$SUBJECT" "$EMAIL" < $MESSAGE
fi

DirectoryIndex : Forbidden Error


Some times you may get Forbidden error when you access the site in browser.

------
ERROR
------
Forbidden

You don't have permission to access / on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
------

When we check the apache logs, we will have the following errors.

-----
Directory index forbidden by Options directive: /home/site/public_html/
------

We can fix the issue by simply adding the following in the file ".htaccess".

-----
DirectoryIndex index.html index.php
-----

Now, we can access the domain without any issue. Thats it.

Have a nice day :)

Blank Page while login to Horde


Some times user can get a blank page while login to webmail/ Horde. Clearing the sessions under the path mentioned below will fix this issue.

Change to the cPanel Horde sessions directory:

# cd /var/cpanel/userhomes/cpanelhorde/sessions

You can list the contents in it:

# ll
total 2156
-rw-r--r--  1 cpanelhorde cpanelhorde 2037760 Sep 18 22:39 phpsess.sdb
-rw-------  1 cpanelhorde cpanelhorde   76570 Dec  9 13:04 sess_32f9cc5af1760ba633c1a669fbd2cb2a
-rw-------  1 cpanelhorde cpanelhorde   75972 Dec  9 12:59 sess_cac2dfc2fa606ec50896ee5d8401f2e9
-rw-------  1 cpanelhorde cpanelhorde  212992 Dec  7 14:39 sess_7dda6051bb705f6099e37d64a088dbb4
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  8 22:50 sess_7f30fe6f4e56c574db767402513fbd7a
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  8 05:49 sess_82ce71f0fb7836b4a19804a0ee234c86
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  8 00:12 sess_93531cd6bd55a77fc6667bc5d658917b
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  9 10:41 sess_a3bd6fbcf818cb1a4df7384492662eaf
-rw-------  1 cpanelhorde cpanelhorde    2571 Dec  6 16:02 sess_aefe75112a9b30c4b03fc8e00710cd75
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  8 15:04 sess_d7eff30a29ef128d4c674ce49ea93fb0
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  8 22:13 sess_d8b32c9cdcef97aea37744c1b8269f08
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  9 12:56 sess_dee2e7cd16b3a958060096e02d480a07
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  9 10:52 sess_df25e7d9eb43643dedca2709cbd06996
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  9 09:43 sess_df4e090e1231029f606fd9bcc29adcfb
-rw-------  1 cpanelhorde cpanelhorde       0 Dec  9 09:25 sess_e5d6e26c02de6c9b5c4e533608463117

Now remove the sessions from this directory:

------
# rm -rf sess_*
------
You are done. Now try logging to the Horde account. It will work fine. :)

Post article in wordpress site through MS word 2007


You can post or update any article in the wordpress site through the MS word 2007. You don't need to login at the admin area of your WP site. Here are the steps.

Steps :
------

1. Logged into the admin area of your wordpress site. Make sure that the Atompub and xmlrpc has been enabled. These options are at "settings" >>Under  writing.
2. Open the MS word 2007.
3. Edited a new page.
4. Clicked on "Office button" which is at the top-left corner.
5. Go to publish >> clicked on Blog >> Clicked register now option
6. Entered the URL : http://underlore.com/TBA/xmlrpc.php
   username : username of WP(admin)
   password : password of WP(admin)
7. Clicked on OK. that's it.

Have a nice day :)

Wednesday, 7 December 2011

configure VNC ( Virtual Network Computing ) in centos

VNC provides a desktop interface for the server. The following guidelines will explain the detail how to configure VNC in your server.


Installing VNC:


1. First, we should check whether the RPM package for vnc server is installed in the server or not.

[root@domU-12-31-38-07-19-4B ~]# rpm -q vnc-server
package vnc-server is not installed
[root@domU-12-31-38-07-19-4B ~]#



If it is not installed, download the rpm package from http://rpm.pbone.net/. Please note that the OS version of the server is 64 bit. So, I have downloaded the 64 bit OS RPM. If it is a 32 bit OS then you should download 32 bit RPM.


[root@domU-12-31-38-07-19-4B ]# wget ftp://ftp.muug.mb.ca/mirror/centos/6.0/os/x86_64/Packages/tigervnc-server-1.0.90-0.10.20100115svn3945.el6.x86_64.rpm

The next step is to install the RPM package.


------------------
[root@domU-12-31-38-07-19-4B ]# rpm -ivh tigervnc-server-1.0.90-0.10.20100115svn3945.el6.x86_64.rpm
------------------

You may get the following dependency error while installing the rpm.


-----------
error: Failed dependencies:
libXfont.so.1()(64bit) is needed by tigervnc-server-1.0.90-0.10.20100115svn3945.el6.x86_64
mesa-dri-drivers is needed by tigervnc-server-1.0.90-0.10.20100115svn3945.el6.x86_64
xkeyboard-config is needed by tigervnc-server-1.0.90-0.10.20100115svn3945.el6.x86_64
xorg-x11-fonts-misc is needed by tigervnc-server-1.0.90-0.10.20100115svn3945.el6.x86_64

-----------

This indicates that the above package is not installed in the server. You can use yum command to install the above package.


---------------
[root@domU-12-31-38-07-19-4B ]# yum install mesa-dri-drivers
[root@domU-12-31-38-07-19-4B ]# yum install libXfont.so.1
[root@domU-12-31-38-07-19-4B ]# yum install xkeyboard-config

[root@domU-12-31-38-07-19-4B ]# yum install xorg-x11-fonts-misc
---------------



2. After installing the dependency package, we can install the downloaded rpm without any issue.




-----------------
[root@domU-12-31-38-07-19-4B ]# rpm -ivh tigervnc-server-1.0.90-0.10.20100115svn3945.el6.x86_64.rpm
-----------------

3. Now, we can install the VNC server and VNC to the server.


------------
[root@domU-12-31-38-07-19-4B ]# yum install vnc-server
[root@domU-12-31-38-07-19-4B ]# yum install vnc

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

4. You have successfully installed VNC in your server. Inorder to use normal windows GUI interface, the server needs "Desktop" package. This package is already compiled to the server.


-------------
[root@domU-12-31-38-07-19-4B]# yum groupinstall Desktop
-------------

That's it:) VNC will have been successfully installed in the server. Now, the next step is to configure VNC for the users.


Configuring VNC:

1. Create a system user and set the password for the users.


----------
[root@domU-12-31-38-07-19-4B ]# useradd myuser
[root@domU-12-31-38-07-19-4B ]# passwd myuser
----------

2. Login to the server as the user that you created now.

--------------
[root@domU-12-31-38-07-19-4B ]# su myuser
[myuser@domU-12-31-38-07-19-4B root]$
--------------

3. Execute vncpasswd. It will create .vnc directory for the user. This file contains the startup script of VNC for this user.

-------------
[myuser@domU-12-31-38-07-19-4B root]$ vncpasswd
-------------

4. Now, logout from the user( Ctrl +D) and login as a root. Then, add the following line in the file /etc/sysconfig/vncservers. This will give the VNC access to the user.


--------------------
VNCSERVERS="1:myuser"VNCSERVERARGS[1]="-geometry 640x480"
--------------------
 
If you want to access the root content then execute the command  "vncpasswd" in root and 
add the following content in  /etc/sysconfig/vncservers.
 
-------------
VNCSERVERS="1:myuser 2:root"VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 640x480"-------------
 
5. The final step is to start the vnsserver service.
-------------
[root@domU-12-31-38-07-19-4B root]$/sbin/service vncserver start
-------------
 
You can  use the "ps -ef " command to check what are the ports are used by the VNC, what is the 
user doocument root.
-------------
[root@domU-12-31-38-07-19-4B ~]# ps -ef |grep vnchris     1636     1  3 Dec07 ?        00:10:14 /bin/sh /home/myuser/.vnc/xstartupchris     7308     1  0 01:33 ?        00:00:01 /usr/bin/Xvnc :1 -desktop domU-12-31-38-07-19-4B:1 (chris) -auth /home/myuser/.Xauthority -geometry 800x600 -rfbwait 30000 -rfbauth /home/chris/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pnchris     7356  7352  0 01:33 ?        00:00:00 vncconfig -iconicroot      7411     1  0 01:33 pts/0    00:00:00 /usr/bin/Xvnc :2 -desktop domU-12-31-38-07-19-4B:2 (root) -auth /root/.Xauthority -geometry 1200x1000 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5902 -fp catalogue:/etc/X11/fontpath.d -pnroot      7497  7495  0 01:33 pts/0    00:00:00 vncconfig -iconicroot     12665 18731  0 03:54 pts/0    00:00:00 grep vn[root@domU-12-31-38-07-19-4B ~]# 
-------------
 
The VNC uses the port range from 59xx. So, these ports should be open in the server firewall 
and as well as harware firewall(if any).
Verification:
1. You can access the VNC  in the browser by using the public IP address of the server. It will
prompt for user name and password. After entering password, you will able to connect to the server
as GUI interface. Please note that Java support should be enabled in the browser for accessing the 
VNC.
--------
http://182.173.23.13:5901
--------

Enabling Various PHP parameters using .htaccess file and php.ini file


allow_url_fopen
To enable this PHP parameter, you can add the following in the .htaccess file.
============
php_value allow_url_fopen On 
============


Or you can add the following in the php.ini file.
=============
allow_url_fopen = On
=============
allow_url_include
To enable this PHP parameter, you can add the following in the .htaccess file.
============
php_flag allow_url_include On
============

Or you can add the following in the php.ini file.
============
allow_url_include = On
============

max_execution_time
To set this PHP parameter, you can add the following in the .htaccess file (the time is mentioned in seconds, I mean it is 200 seconds).
============
php_value max_execution_time 200
============

install firewall to the server

From our experience, if you are using cPanel control panel then it will be better if you go for an csf firewall. Csf firewall installation guideline is as follows.


1. Download the tar file from the configserver.com website.

root@server# wget http://www.configserver.com/free/csf.tgz

2. Untar the downloaded file.


root@server# tar -xzf csf.tgz


3. Navigate to csf directory.


root@server# cd csf


4. Install csf firewall by using the following command.


root@server#sh install.sh
 
That's it:) You have installed csf firewall in your server

For plesk control panel, the apf firewall will be the good option. Here are the details 
for the installation of apf firewall.


1. Download the tar file from rfxn.com website.


root@server# wget http://www.rfxnetworks.com/downloads/apf-current.tar.gz
2. Untar the downloaded file.

root@server# tar -zxvf apf-current.tar.gz;
 
 3. Navigate to apf directory.
 
 root@server# cd apf*
4. Install apf firewall by using the following command.
 
root@server# sh ./install.sh


That's it:) You have successfully installed apf firewall in your plesk server.


Sunday, 4 December 2011

Steps to make telnet in Windows/Linux/MAC


You can make a Telnet by following the below mentioned steps:

===============
Open a command prompt in Windows:

1. Click Start > Run.
2. Type cmd.
3. Click OK

Note: To exit from the command prompt, type exit and press Enter.

In the command prompt window type:

telnet <domainname> <Port No

Press Enter.

Note: To exit out of the Telnet application type Ctrl + ], then type quit.
===============


Opening a command or shell prompt in Linux:

The exact method of doing this varies with the distribution and version of Linux operating system in use. 

If you are looking at a graphical screen, the most common method of getting to a shell prompt is to press Ctrl + Alt + F2. You may have to log in.

Note: To logout, type exit and press Enter. To return to the graphical interface, press Alt + F7.


Opening a command or shell prompt in Mac OS:

1. Click Finder.

2. Open the /Applications/Utilities folder by pressing Command + Shift + U.

3. Open the Terminal application.

Note: To exit from Terminal, type exit, press Enter then press Command + Q.

In the terminal, you can type the same command as typed in windows.
===============

Friday, 2 December 2011

Outlook Configuration Steps


Please Configure Outlook using the following steps:

1. Open Outlook.

2. Select Tools --> Accounts (You will get window that consists of options for adding and removing accounts).

3. Select Add--> Mail. (You will get a window which asks your Display Name. This is the name that appears in the From field of the messages you are sending).

Display Name:

4. Click Next.

5. Enter the Email address for which you want to configure the mail client.

6. Click Next (You will directed to a window. Enter the following details).

Select My incoming mail server is : POP3
Incoming mail server : mail.domainame.com
Outgoing mail server : mail.domainname.com

7. Click Next (You will get a window that will ask for Internet Mail Logon details).

Account Name: (Enter the email id for which you want to configure the email client).

Password :

8. Click Next.

9. Click Finish.

10. Now click on the Properties Button. (Tool-->Accounts-->Properties).

11. Select the Advanced tab. Make sure that the port number for smtp server is 25 and pop server is 110.

PHPMyAdmin Error


While accessing phpmyadmin from WHM, it is showing the below error.

--------------------------
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
--------------------------
Reason is:
The mysql socket file is missing from the "/tmp" directory.

Solution:
1. Create a symbolic link from the original mysql socket file to /tmp
# ln -s /var/lib/mysql/mysql.sock /tmp
OR
2. Edit the PhpMyAdmin configuration file to use the original MySQL socket file.
vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
Make sure, the correct mysql socket file is mentioned there.
$cfg['Servers'][$i]['socket'] = '';
change to
$cfg['Servers'][$i]['socket'] = ‘/var/lib/mysql/mysql.sock’;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
change to
$cfg['Servers'][$i]['connect_type'] = ‘socket’;

Thursday, 1 December 2011

The site is asking for user name and password while browsing [Windows]

The most likely cause for this issue is that the anonymous user assigned for use to browse the website is out of sync.

To resolve the issue, please do the following:

Login into Windows through Remote Desktop and go to IIS manager, right click on the site in IIS experiencing this issue and select click properties. Left click Directory Security, click EDIT under Authentication and access control.

Enable anonymous access should be ticked.
Intergrated windows authentication should be ticked.

Update the password to be the same as the FTP password for this account in plesk.
The anonymous username should look like this:

IUSR_ftpusername

where, ftpusername should be replaced with the actual ftp username used for this domain.
Click OK and the click apply.


NOTE: you might also need to reset the password for the above user.

You can synchronize them using a Plesk utility:

# "%plesk_bin%\websrvmng.exe" --update-anon-password --domain-name=domain.tld

By,
Ragul ganesh.N