Showing posts with label cPanel. Show all posts
Showing posts with label cPanel. Show all posts

Wednesday, May 18, 2011

To view current Exim queue details using Perl script

To get the detailed results of Exim mail queue using a simple perl script.



____________________________________________________________________________________

root@sysadmin [~]# ./exim_queue_report.pl



                   EXIM MAIL QUEUE REPORT                  

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



-> Total mails in Queue: 3

-> No of frozen emails : 2



-> Emails per CPanel User:



 COUNT   USER

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

    2   mailnull

    1   marcm





-> Mails to following email addresses got bounced:



 COUNT   EMAIL

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

    1   helensss@123new.com

    1   jerry1@nopytruction.com





-> Subject of emails in the mail queue:



 COUNT   SUBJECT

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

    5   Mail delivery failed: returning message to sender

   12   Seminar topics





-> From address of mails in the mail queue:



 COUNT   FROM

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

    2   Mailer-Daemon@server1.tchmachines.com

    1   jblac@aol.com





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



-> What do you want to do?



 [1] Remove all mails of a Cpanel user

 [2] Remove all mails with specific subject

 [3] Remove all mails originated from a script source

 [4] Remove all bounced emails

 [5] Remove all frozen emails

 [6] Remove all mails From: specific email address

 [7] Chmod a script source to 000

 [8] I'm done! Exit..



Your choice ( 1 to 8 ) >;

________________________________________________________________________________



You can download the above script Download Exim Queue Report

[technomance]



Tags:-Exim mail queue,cpanel, exim mail queue scripts







Saturday, October 2, 2010

Cpanel Help- How to extract a zip archive via Cpanel?

You can upload a zip file to cPanel using the cPanel option "File Manager", the below steps explains you, how quicker and efficient the option is



Step1. Login to cpanel, click on file manager option





Step 2. Browse the location, where you want to upload your zip file



Step 3. By clicking the browse button, upload the zip file .

 



Step 4. Select the upload file and click on "extract icon" on the top of the page













[After you have clicked on "extract" a box will pop up asking you to choose the location. The default location is the directory that you are currently in. You can change this if you wish.]






Now the selected zip file is completely extracted to the location you have selected.



Tags:-cpanel,control panel,Linux control panel,linux webhosting help,cpanel help

Tuesday, September 21, 2010

Joomla issue's and fix after php upgrade | Suphp upgrade [SEF urls after suphp upgrade, 404 error]

 
Steps:



1. Go to the configuration.php file in the Joomla installation folder



2. Open Configuration.php in vi editor



3. check the configuration.php file and change the var $live_site = '';  as var $live_site = '/';



Notes:-



[If needed]



1: Set var $live_site = ''; in configuration file with value as '/' or

''. For example if Joomla is installed in

root for example.com then value will be 'http://example.com'.



2: Login to Joomla admin. In Global Configuration, set Add suffix to URLs

= Yes and save.



3:In Global Configuration, set Use Apache mod_rewrite = Yes and save.














Tags:-cPanel,fantastico,joomla,joomla fixes,suphp,linux,linux admin

Wordpress for BlackBerry version1.3-



Depending on your region or country, you might not see the latest version in the BlackBerry App World, but on your device you should now already see the latest version 1.3.



These features have been added in version 1.3:



    * Option to load more comments, not just the latest 100

    * Ability to load comments by status (all/spam/pendings)

    * You can now edit the comment details (Author Name/E-mail/URL)

    * Option to manually set the video-size when using VideoPress service

    * A much requested formatting toolbar that allows you to bold text for example

    * A new word count feature is shown on the post/page write screen

    * You can now submit bug reports and feedback from within the app

    * Multiple improvement to how Stats are handled

    * Improvements on the photo resizing options and a new jpeg encoder is now being used

 

For more information click on the link - Wordpress for BlackBerry version1.3







Use Postie plug-in for Post blog using black berry phone as email



To download Postie,click on the link - Download Posties Plugin


Tags:-wordpress,blackberry,wordpress help, wordpress 

Wordpress getting " Fatal error: Allowed memory size of xxxxxxxx bytes exhausted"

If deactivating plug-ins doesn't work try one of these methods for increasing the amount of memory a PHP script may consume



1. If you have access to your PHP.ini file, change the line in PHP.ini

If your line shows 32M try 64M:

memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)



2. If you don't have access to PHP.ini try adding this to an .htaccess file:

php_value memory_limit 64M



3. Try adding this line to your wp-config.php file:

Increasing memory allocated to PHP

define('WP_MEMORY_LIMIT', '64M');



4. Talk to your host.


Tags:-wordpress trick and tips, linux cPanel,cPanel server help,Linux admin ,Wordpress errors,Wordpress Issues and Fix

How to upgrade Wordpress Manually



                                               
                                                      

Step 1. Go to the " Download latest version of wordpress"  page in google


Step 2. Copy the link address



Step 3. Wget link [ From the server and also in the folder where wordpress installed ]



step 4. unzip Download file



step 5. remove or rename wp-admin and wp-includes [currently installed ]



Step 6. GO to download folder and remove wp-content [from the file,above we download ]



step 7. copy the files in the download download folder to the wordpress installation folder

         { # cp -pr * ../- command used to copy to the parent dir }



Steo 8 change ownership of files and folders



step 9 go to www.domainname.com/wp-admin/upgrade.php

       {for upgrading database }



[ Refer to the url for more information - http://codex.wordpress.org/Updating_WordPress ]




Tags:-Linux server Admin Help,cPanel,wordpress,wordpress manual installation 

Sunday, August 22, 2010

Cpanel Remote Mysql- steps and fixes for issues

Check the mysql remote connection after making sure that you are using the following parameters;



MySQL server : Server IP

Port : 3306

User : Full mysql user like username_test

Password : password of the mysql user.



Inorder to test mysql remote connection is working



[root@server] #mysql -h ServerIP -u mysqlusername -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 12012

Server version: 5.0.91-community MySQL Community Edition (GPL)



Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.



mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| test_catalog |

+--------------------+

2 rows in set (0.01 sec)



Issue and Error- How to fix



WARNING [2] mysql_connect(): OK packet 6 bytes shorter than expected, Line: 34 in file C:\inetpub\local_intranet\website_updater.php



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

Steps to fix

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

Step 1. vi /etc/my.cnf

Step 2. change old-passwords = 1  to #old-passwords = 1

Step 3. restart mysql

Step 4.  change passes - is just mean change the password of myswl user {Change it to the same passwod}

Step5.  uncomment #old-passwords = 1

Step6.  restart mysql



This will fix the error



Tags:-mysql,remote mysql,common cpanel error,cpanel,cpanel remote connection

Thursday, August 19, 2010

MySQL monitoring graph is not updating or blank in Munin

Munin is a network resource monitoring tool that can help to analyze and report back all kinds of server statistics. Munin is used to monitor the the performance of computers/servers, networks, SANs, applications, databases, weather measurements and other parameters.



To download and install Munin: click here



After successful installation, Munin will start colleting required data and will show you the graphs, including MySQL nodes such as MySQL throughputs, MySQL queries, MySQL Slow Queries, and MySQL threads. However, if you restart the server, Munin will fail to monitor MySQL nodes and it will stop showing graphs for MySQL.



Fix for Munin installed by cPanel/WHM



1. Find the path where mysqladmin is installed using one of the following commands:



which mysqladmin

type mysqladmin

locate mysqladmin



The above command will return a path to mysqladmin (i.e. /usr/bin/mysqladmin)



2. Edit Munin configuration file /etc/munin/plugin-conf.d/cpanel.conf and modify the [mysql*] as below:



[mysql*]

user root

group wheel

env.mysqladmin /usr/bin/mysqladmin

env.mysqlopts –defaults-extra-file=/root/.my.cnf



Ensure the env.mysqladmin value is path returned by step 1. Also ensure that /root/.my.cnf contains correct MySQL root password.



3. Restart Munin service:



/etc/init.d/munin-node restart



4. Wait a while for MySQL statistics to be gathered, and check the graphs again.



Fix for the host or server without cPanel Control Panel:



Simply add the “env.mysqladmin /usr/bin/mysqladmin” (ensure that the path is correct according to your system) to the /etc/munin/plugin-conf.d/munin-node file will do the trick.



Tags:-cPanel,Whm,Munin,network statistics,Munin Mysql monitoring is not showing

Monday, July 12, 2010

Error deleting FTP account or not able to delete FTP account.






If you have deleted a FTP account and it’s still apearing on the CPanel–>>FTP Accounts, then follow the below steps :

==================================================================
root@server[#] cd /etc/vftp/

root@server[#] vi username

then just remove the entry from the file for the FTP account that you want to delete.

:wq!

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

Tags:-cpanel,webadmin help,linux,commands,ftp error,cpanel error,ftp cpanel,ftp

Steps to disable website pages download using wget ?






Wget is a network utility to retrieve files from the World Wide Web using HTTP and FTP.It works non-interactively, so it can work in the background, after having logged off. The program supports recursive retrieval of web-authoring pages as well as FTP sites—you can use Wget to make mirrors of archives and home pages or to travel the Web like a WWW robot, checking for broken links.

For disabling wget to grab your site pages then simply add the code below in the .htaccess file under public_html directory [for which you wish to disable the wget grabbing].

===================================
SetEnvIfNoCase User-Agent “^Wget” bad_bot

Order Allow,Deny
Allow from all
Deny from env=bad_bot

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

Now, if anybody tries to grab info from your website using wget, he will receive a 403 error.

Please check this link to know more information about wget

http://wget.addictivecode.org/FrequentlyAskedQuestions

Tags:-wget,cpanel,webadmin,serveradmin,apachae,linux,commands,wget,cpanel,whm

Set the server administrator email using .htaccess



For adding the server administrator email to your server(domain),just add the following line in .htaccess

root@new[#] vi .htaccess

SetEnv SERVER_ADMIN default@domain.com

save and Exit



Tags:-server admin,linux,.htaccess,cPanel,whm

Saturday, July 3, 2010

500 internal server issues


It is the most common php issue.ouurs mostly on servers with suPhp or PHP running as CGI.

Check the logs so that you can quickly find the issue:

/usr/local/apache/logs/error_log /usr/local/apache/logs/suphp.log

Here are some common errors:

SoftException in Application.cpp:357: UID of script "/home/user/public_html/test.php" is smaller than min_uid SoftException in Application.cpp:422: Mismatch between target UID (511) and UID (510) of file "/home/user/public_html/test.php"

SoftException in Application.cpp:264: File "/home/user/public_html/test.php" is writeable by others

These are all permission/ownership issues, indicating that the owner of the PHP file being called in incorrect, or the permissions are higher than what is allowed in suphp.conf.

Invalid directions in .htaccess

If you’re running PHP in CGI or suPHP mode, you can’t use php_flag or php_value directives in .htaccess – you either need to use htscanner to allow Apache to parse those commands, or make php-related changes in php.ini within the user’s account. You can check the Apache error log in /usr/local/apache/logs/error_log to see if you get something like this:

/home/user/public_html/.htaccess:

Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration

If the error log indicates a problem with .htaccess, you need to remove the directives indicated and make sure your ssyntax is correct, and that they are in the correct places.

Incorrect ownership or permissions

You can adjust suPHP’s permissions allowances in /opt/suphp/etc/suphp.conf to allow ‘group’ and ‘other’ writable permissions if it’s necessary by modifying these values:

allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false

If the problem is with the min_uid value being too low (such as if you’re running a PHP script as root), you can also modify the “min_uid” and “min_gid” values to be more permissive. Changing anything in the suphp.conf requires a restart of Apache.

SuPHP binary missing its “sticky” permissions

Take a look at the suphp binary. It should look a bit like this, and in most shells, will be highlighted in red:

-rwsr-xr-x 1 root root 341K Mar 30 12:25 /opt/suphp/sbin/suphp*

If it’s missing the ‘s’ in the permissions column, you need to re-add the sticky bit to allow users on the system to execute it properly:

chmod +s /opt/suphp/sbin/suphp

Tags:-cpanel,cpanel issues,webhosting issues,cpanel admin,Linux,Linux techs

Tuesday, June 29, 2010

Exim Commands and Configuration Files


Configuration Files of Exim :

  • /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
Trouble shooting and checking exim mail logs

1) Count the no of messages in the queue

#root@leo [~]# exim -bpc
3506
Here 3506 mails are in the queue.

2) Command To List All The Messages In The Queue.(Time, Size,Message ID,Sender,Receipient):-

#root@localhost# exim -bp
Other Options:- root@localhost#exim -bpru
If you want to list for the message for a particular domain issue the
following command:-
root@localhost# exim -bpru | grep openhelp.info

3) Command To Find The Details Of Messages In The Queue( Count, Volume,Oldest,Newest And Total):-

#root@localhost# exim -bp | exiqsumm
===========================
The result of the comand will be like this:-
1 3686 18h 18h ziro.net
1 1638 4d 4d znormativa.com
1 2662 11m 11m zoominternet.net
1 3174 24m 24m zpub.com
1 2048 2h 2h zufall.de
===========================
3583 18MB 9d 0m TOTAL

4) Command To Create And Display Exim Stats From The Log File:-

#root@localhost# eximstats /var/log/exim_mainlog
===========================================
The result of the command will be like this:-
sree @ openhelp.info = lookuphostT=remote_smtp:SMTP error from remote mail
server after end of data:mail.tripseinc.com [65.106.35.202]: 550 5.7.1
rquested action not taken: message refusedhost smtp.where.xeonerver.net
[18.19.80.14]:553 sorry, mail to that recipient is not accepted
Errors encountered: 9617
===========================================

5) Generate And Display Exim Stats For A Particular Date:-

#root@localhost# fgrep YYYY-MM-DD /var/log/exim_mainlog | eximstats
==============================================
The result of the command will be like this:-
Top 50 host destinations by message count
-----------------------------------------
Messages Bytes Average Host destination
Top 50 host destinations by volume
-----------------------------------------
Messages Bytes Average Host destination
Top 50 rejected ips by message count
-----------------------------------------
Messages Rejected ip
2 [65.98.14.123]
1 [65.98.35.126]
Top 50 temporarily rejected ips by message count
------------------------------------------------
Messages Temporarily rejected ip
8 [69.65.55.100]
============================================

6) To Print What Exim Is Doing Right Now:-

#root@localhost# exiwhat
======================================================
Result of this command will be like this:-
925 handling incoming connection from ([61.152.161.184]) [61.152.161.184]
1951 handling incoming connection from pc-206-216-44-190.cm.vtr.net [
190.44.216.206]
10714 daemon: no queue runs, listening for SMTP on port 26 (IPv4)
10720 daemon: -q1h, listening for SMTP on port 25 (IPv4)
10725 daemon: no queue runs, listening for SMTPS on port 465 (IPv4)
=====================================================

7)For Clearing All The Mails In The Queue:-

root@localhost#exim -bpru|awk {'print $3'}|xargs exim -Mrm

8)Search The Queue For Messages From A Specific Sender:-

root@localhost# exiqgrep -f [luser]@domain

9)Search The Queue For Messages From A Specific Receipient/Domain:-

root@localhost# exiqgrep -r [luser]@domain
Eg:-root@localhost# exiqgrep -r openhelp.info

10)Command To Print The Message ID’s In The Entire Queue:-

#root@localhost# exiqgrep -i
===========================
The Result of the command will be like this:-
1KZyz0-0004wH-6d
1KZzBW-0001sT-1j
===========================

11)Comand To Start A Queue Run:-

root@localhost# exim -q -v

12)Comand To Start A Queue Run For Just Local Deleveries:-

root@localhost# exim -ql -v

13)Counting The No Of Frozen Mails:-

#root@localhost#exim -bpru | grep frozen | wc -l

14)Deleting All The Frozen Mails In The Queue:-

#root@localhost#exiqgrep -z -i | xargs exim -Mrm

15)Deliver a specific Message:-

#root@localhost# exim -M

You need to give message Id After this.
Like :- root@localhost# exim -M 1KZyrO-0006Vy-R2

16)Remove A Message From The Queue:-

#root@localhost# exim -Mrm

17)Command To Freeze All Queued Mail From A Given Sender:-

root@localhost#exiqgrep -i -f l user @ domain.com | xargs exim -Mf

18)Command To View Message Header:-

#root@localhost# exim -Mvh
Eg:-root@localhost#exim -Mvh 1KZzeO-0005up-GW

19)Command To View MessageBody:-

#root@localhost# exim -Mvb
This Command will show the body of the message.
Eg:-root@localhost#exim -Mvb 2345fg-34

20)Command To View A Message’s Logs:-

#root@server1 [~]# exim -Mvl 1KZznJ-0003Wp-Vj

21)Deleting The Bounce Back Message s In The Queue:-

#root@leo [~]exiqgrep -if "<>" | xargs exim -Mrm
OR
#root@leo [~] exim -bp | grep '<>' | awk '{print $3}'| xargs exim -Mrm

Bounce Back Messages Will Be ending with "<>".

Eg:- 17m 3.1K 1KDDkk-0002YT-5G <>barry @ email.net

22)Deleting The Bounce Back Message’s for a particular Domain:-

root@xeon [~] exiqgrep -if openhelp.info | xargs exim -Mrm
root@xeon [~] exiqgrep -ir openhelp.info | xargs exim -Mrm

Tags:-exim,exim commands,exim issues,exim docs,exim troubleshooting,exim configuration files,exim server,exim logs,linux,linux exim,linux updates

Setup time zone in Linux


1. The command used to check the time zone is

[root@server123 ~]# date
MON Jan 14 14:04:01 IST 2010
Here we can see that time zone is set into Indian Standard time.

2.Take the backup of current timezone configuration.

[root@server123 ~]#mv /etc/localtime /etc/localtime-old

2. Change to the directory to /usr/share/zoneinfo. You can find all the time zone regions here. Choose the the appropriate region where you resides. If you live in India choose region kerala in the /usr/share/zoneinfo/Asia directory.

3)remove the file /etc/localtime

[root@server123 Asia]# rm /etc/localtime


4. Create a symbolic link from the appropiate timezone to /etc/localtime

[root@server123 Asia]# ln -s /usr/share/zoneinfo/Asia/Kerala /etc/localtime


5. Update the current system time by executingthe rdate command.

[root@server123 Asia]#rdate -s rdate.cpanel.net

6. Synchronize hardware clock with system clock .

[root@server123 Asia]# /sbin/hwclock – -systohc

Tags:-Time zone,linuz time zone,Linux commands,Linux time commands,linux time zone commands,Linux,cPanel,Time