MyTrueHost launched Web Hosting for Indian clients just in Rs 60/Month with various payment options(netbanking, debit card, credit card,cash card or paypal).
Please Visit at https://www.mytruehost.in

Horde session issue

There is a very common  issue where Horde prevents access to webmail by repeatedly redirecting viewers to Language Selection screen. The following commands, executed as root, will solve these issues:

root@server[~]#/usr/local/cpanel/bin/checkperlmodules
root@server[~]#/scripts/fullhordereset
root@server[~]#myisamchk -r /var/lib/mysql/horde/horde_sessionhandler.MYI

If still you have problem then check the ownership for session directory present in/var/cpanel/userhomes/cpanelhorde directory.

root@server[~]#ll /var/cpanel/userhomes/cpanelhorde

drwx–x–x 4 cpanelhorde cpanelhorde 4096 Jun  5  2009 ./
drwx–x–x 7 root        root        4096 Dec 17 01:48 ../
drwxr-x— 2 cpanelhorde cpanelhorde 4096 Jun  5  2009 mail/
drwx—— 2 cpanelhorde cpanelhorde 4096 Jan 27 14:01 sessions/
Session directory should be cpanelhorde.cpanelhorde ownership recursively

 

How to set E-mail size in exim?

First Method :-

You can set the E-mail size limit from your WHM.

First login into WHM
Second select “Exim Configuration Editor”  present unde ” Service Configuration” section.
Third scroll down and  click on  “Advanced Editor” optoin.

You will see  the empty box (remember select first empty box) where you can type  (right underneath where you see #!!# cPanel Exim 4 Config), enter in the following:

message_size_limit = 100M

Fourth scroll down to the bottom of that screen and click “Save” option.

Exim configuration will be rebuilt with the new option and your Exim will be restarted.

Second Method :- 

You can set the E-mail size limit from server(root).

1)Login to server as root user,

2)Open the file /etc/exim.conf

3)Put below line

message_size_limit = 100M

4)Save and restart exim service

thats all.

 

SERVICE CURRENTLY NOT AVAILABLE Error No. [0x01F4] – RoundCube

Mostly we received following error aftre browsing RoundCube

SERVICE CURRENTLY NOT AVAILABLE Error No. [0x01F4] – RoundCube

As well as RoundCube error logs showing following logs

[06-Oct-2008 08:34:56 -0400] DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE MDB2_STATEMENT_mysql_8c77e0752a8db2da365c3c7a19fe8842c84663aa7 FROM ‘INSERT INTO messages\n         (user_id, del, cache_key, created, idx, uid, subject, `from`, `to`, cc, date, size, headers, structure)\n         VALUES (?, 0, ?, now(), ?, ?, ?, ?, ?, ?, FROM_UNIXTIME(), ?, ?, ?)’]
[Native code: 1064]
[Native message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘), ?, ?, ?)’ at line 3]
in /usr/local/cpanel/base/3rdparty/roundcube/program/include/rcube_mdb2.inc on line 265

The error is occur becasue Mysql could not insert the values from UNIXTIME. To avoid this error simply open file

/usr/local/cpanel/base/3rdparty/roundcube/program/include/rcube_mdb2.php and replace following code

From

return “FROM_UNIXTIME($timestamp)”;

To

return sprintf(“FROM_UNIXTIME(%d)”, $timestamp);

Now clear cache from your local machine refresh RoundCube error page.

If you still get same error, you should check the roundcube database permission.

root@server [/var/lib/mysql]# ll | grep roundcube
d——— 2 mysql mysql 4096 Jul 14 21:56 roundcube/
root@queen [/var/lib/mysql]#

If the database permission is zero, you need to make it 700

root@server [/var/lib/mysql]# chmod 700 roundcube

thats all.

 

Critical: exim security update

To resolve exim vulnerability issue exim upgraded to latest version but its throwing following error message aftre restarting exim service.

root@server [/tmp]# /etc/init.d/exim restart
Shutting down exim:                                        [  OK  ]
Shutting down spamd:                                       [FAILED]
Starting exim:                                             [  OK  ]
Starting exim alt spool: exim: -D is not available in this Exim binary
 [FAILED]
To resolve above error simply run following command from shell.

root@server [/tmp]#/usr/mscpanel/msswitch.pl inout

 

Send an E-mail from server.

Basically to send an E-mail from the Linux server shell, the mailx module is required. First install the mailx module by usiung the yum installed.

Login in to the server as a root user and follow the following steps one by one

root@server[~]# yum install mailx

Once mailx installed on the server, you cna use the following syntax to send an E-mail from the server.

root@server[~]#mail -vv E-mail address

It will ask you for the subject

root@server[~]#mail -vv support@gmail.com
Subject: test message

Now press control+d, it will give you Cc: option. You can ignore it and press the control+d

It will send an E-mail and show you the following logs.

root@server[~]# mail -vv support@gmail.com
Subject: test mesgsage
Cc: supp0rt24x7@gmail… Connecting to [127.0.0.1] via relay…
220 support.localhost.com ESMTP Sendmail 8.13.8/8.13.8; Sat, 19 Nov 2011 23:47:32 -0500
>>> EHLO linux7802.localhost.com
250-server.localhost.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From: SIZE=50
250 2.1.0 … Sender ok
>>> RCPT To:
>>> DATA
250 2.1.5 … Recipient ok
354 Enter mail, end with “.” on a line by itself
>>> .
250 2.0.0 pAK4lWqU025615 Message accepted for delivery
support@gmail… Sent (pAK4lWqU025615 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 server.localhost.com closing connection

As per above logs E-mail sent to the E-mail address support@gmail.com successfully

 

Redirect code from http to https by using .htaccess?

Your can redirect all http (Non-secure) URL to https by using following code in .htaccess file.

RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

 

How to parse php pages in html page?

You can use following code in .htaccess file to parse php pages in html pages

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

To can check above code is working ir not? by creating one test page with following code

root@gunjan[~]#pico test.html

< html>
< head>
< body>
< h1>
< ?php echo “WORKING FINE!”; ?>
< /h1>
< /body>
< /html>

 

How to stop forum get injected from hackers?

n now a days its very easy to inject any forum.You can secure your forum by using following code in your .htaccess

#spam bots SetEnvIfNoCase User-Agent “^EmailSiphon” bad_bot SetEnvIfNoCase User-Agent “^EmailWolf” bad_bot SetEnvIfNoCase User-Agent “^ExtractorPro” bad_bot SetEnvIfNoCase User-Agent “^CherryPicker” bad_bot SetEnvIfNoCase User-Agent “^NICErsPRO” bad_bot SetEnvIfNoCase User-Agent “^Teleport” bad_bot SetEnvIfNoCase User-Agent “^EmailCollector” bad_bot #plagarism bot SetEnvIfNoCase User-Agent “^TurnitinBot” bad_bot #IP bot SetEnvIfNoCase User-Agent “^NPBot” bad_bot #Worm sign SetEnvIfNoCase User-Agent “^LWP::Simple” bad_bot SetEnvIfNoCase User-Agent “^lwp-trivial” bad_bot SetEnvIfNoCase User-Agent “^lwp” bad_bot SetEnvIfNoCase User-Agent “^LWP” bad_bot #Worm sign Order Allow,Deny Allow from all Deny from env=bad_bot

 

DNS cache problem on local machine

DNS cache is most common problem in now a days and largely its create difficulty to web developer and technician who are working to solve the web issue.You can clear the cache from your local machine bu using following commands on your local machine as per your local machine operating system.

1) For Windows

– Start -> Run -> type cmd
-In command prompt, type

ipconfig /flushdns

2) For Linux

– To restart the nscd daemon, type

/etc/rc.d/init.d/nscd restart in your terminal
3) For Mac OS X

– type lookupd -flushcache in your terminal to flush the DNS resolver cache.
ex: bash-2.05a$ lookupd -flushcache

4) For Vista

Here is how to fix that corrupted DNS cache in vista.

1. Click the Microsoft Vista Start logo in the bottom left corner of the screen
2. Click All Programs
3. Click Accessories
4. RIGHT-click on Command Prompt
5. Select Run As Administrator
6. In the command window type the following and then hit enter:

ipconfig /flushdns

 

Maximum file limit reach while starting Apache?

Maximum file limit reach error is occur while we are starting the Apache server at that time you can fix the issue by using root login details.

root@gunjan[~]#pico /etc/sysctl.conf
Add following line as

fs.file-max = 22992

Save and exit from the file.

You need to run following command from shell to active changes.

root@gunjan[~]#sysctl -p
It will increase the maximum number of open files for your Server.