Category Archives: cPanel

cPanel being one of the most popular and widely used control panel in hosting
We share few tips which we come across while working day in and day out.

wkhtmltopdf install

if you are facing issues with install of  wkhtmltopdf

please follow below steps

Download the zip file using wget

root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]#

wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2

–2015-07-20 03:15:00– http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
Resolving wkhtmltopdf.googlecode.com… 64.233.168.82, 2607:f8b0:4003:c07::52
Connecting to wkhtmltopdf.googlecode.com|64.233.168.82|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 8218260 (7.8M) [application/x-bzip2]
Saving to: `wkhtmltopdf-0.9.9-static-amd64.tar.bz2′

100%[====================================================================================================================================================================================================>] 82,18,260 15.3M/s in 0.5s

2015-07-20 03:15:00 (15.3 MB/s) – `wkhtmltopdf-0.9.9-static-amd64.tar.bz2′ saved [8218260/8218260]

FINISHED –2015-07-20 03:15:00–
Downloaded: 1 files, 7.8M in 0.5s (15.3 MB/s)

 

Unzip the file using tar

root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]#

tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2

wkhtmltopdf-amd64
root@host234 [/home/fantasti/public_html/mealmerge.com/cgi-bin]# ls -la
total 54640
drwxr-xr-x. 2 fantasti fantasti 4096 Jul 20 03:15 ./
drwxr-x—. 5 fantasti nobody 4096 Jul 20 02:36 ../
-rwxr-xr-x. 1 fantasti fantasti 39419552 Jun 26 05:26 wkhtmltopdf*
-rw-r–r–. 1 root root 8218260 May 24 2010 wkhtmltopdf-0.9.9-static-amd64.tar.bz2
-rwxr-xr-x. 1 1000 1000 8301444 May 24 2010 wkhtmltopdf-amd64*

 

Rename wkhtmltopdf-amd64 to wkhtmltopdf
root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]# mv wkhtmltopdf-amd64 wkhtmltopdf

 

Change Permissions using chmod to executable

root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]# chmod +x wkhtmltopdf1

Now execute the file to see if any errors

# ./wkhtmltopdf1
You need to specify atleast one input file, and exactly one output file
Use – for stdin or stdout

Name:
wkhtmltopdf 0.9.6

Synopsis:
wkhtmltopdf [OPTIONS]… <input file> [More input files] <output file>

Description:
Converts one or more HTML pages into a PDF document, using wkhtmltopdf patched
qt.

General Options:
-b, –book Set the options one would usually set when
printing a book
–collate Collate when printing multiple copies
–copies <number> Number of copies to print into the pdf
file (default 1)
–cover <url> Use html document as cover. It will be
inserted before the toc with no headers
and footers
-H, –default-header Add a default header, with the name of the
page to the left, and the page number to
the right, this is short for:
–header-left='[webpage]’
–header-right='[page]/[toPage]’ –top 2cm
–header-line
–extended-help Display more extensive help, detailing
less common command switches
-h, –help Display help
-O, –orientation <orientation> Set orientation to Landscape or Portrait
-s, –page-size <size> Set paper size to: A4, Letter, etc.
–password <password> HTTP Authentication password
-p, –proxy <proxy> Use a proxy
-q, –quiet Be less verbose
-t, –toc Insert a table of content in the beginning
of the document
–username <username> HTTP Authentication username
-V, –version Output version information an exit

Contact:
If you experience bugs or want to request new features please visit
<http://code.google.com/p/wkhtmltopdf/issues/list>, if you have any problems
or comments please feel free to contact me: see
<http://www.madalgo.au.dk/~jakobt/#about>

 

now test conversion using below command

root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]#

./wkhtmltopdf www.google.com google.pdf
Loading pages (1/5)
Resolving links (2/5)
Counting pages (3/5)
Printing pages (5/5)
Done

FTP issue Error: Failed to retrieve directory listing

Getting error while doing ftp in cpanel server

“Failed to retrieve directory listing”

 

Status: Connecting to 199.162.171.19:21…
Status: Connection established, waiting for welcome message…
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Status: Server does not support non-ASCII characters.
Status: Connected
Status: Retrieving directory listing…
Command: PWD
Response: 257 “/” is the current directory
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (199,162,171,19,200,207).
Command: MLSD
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Status: Disconnected from server

 

The issue is due to IPtables

Fix for this is

Open the iptables config file

root@server [~]# vi /etc/sysconfig/iptables

Comment the below 2 lines

#-A INPUT -j REJECT –reject-with icmp-host-prohibited

#-A FORWARD -j REJECT –reject-with icmp-host-prohibited

and restart iptables

root@server [~]# /etc/init.d/iptables restart
iptables: Applying firewall rules: [ OK ]

Now FTP works fine

Status: Connecting to 197.162.171.19:21…
Status: Connection established, waiting for welcome message…
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Status: Server does not support non-ASCII characters.
Status: Connected
Status: Retrieving directory listing…
Command: PWD
Response: 257 “/” is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (197,162,171,19,139,185)
Command: MLSD
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Status: Disconnected from server
Status: Connecting to 199.162.171.19:21…
Status: Connection established, waiting for welcome message…
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Status: Server does not support non-ASCII characters.
Status: Connected
Status: Retrieving directory listing…
Command: PWD
Response: 257 “/” is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (199,162,171,19,40,98)
Command: MLSD
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Status: Disconnected from server
Status: Connecting to 199.162.171.19:21…
Status: Connection established, waiting for welcome message…
Status: Initializing TLS…
Status: Verifying certificate…
Status: TLS connection established.
Status: Server does not support non-ASCII characters.
Status: Connected
Status: Retrieving directory listing…
Status: Directory listing of “/” successful

Install ZendGuard on cPanel server

To install ZendGuard on cpanel server follow below steps

SSH to server as root user and run below script

root@online  [~]# /scripts/installzendopt

Updating digest list Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz.yaml (connected:0)…….(request attempt 1/12)…Using dns cache file /root/.HttpRequest/httpupdate.cpanel.net……searching for mirrors (mirror search attempt 1/3)……loaded mirror speeds from cache……mirror search success……connecting to 67.222.0.10…@67.222.0.10……connected……receiving…100%……request success……Done Downloading tarball for Zendopt Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz/Cpanel/Easy/Zendopt.pm.tar.gz.linux-generic-64 (connected:0)…….(request attempt 1/12)……connecting to 67.222.0.10…@67.222.0.10……connected……receiving…2%…5%…8%…10%…13%…16%…18%…21%…24%…26%…29%…32%…34%…37%…40%…42%…45%…48%…50%…53%…56%…58%…61%…64%…66%…69%…72%…74%…77%…80%…82%…85%…88%…90%…93%…96%…98%…100%……request success……Done Installing Zendopt Skipping install to /usr/local/php4, missing php.ini Determining PHP version Installing Zend Guard/Optimizer 6.0 for PHP 5.4 Activated Zend Guard/Optimizer

 

Now restart apache using below command to complete the process

root@hostonline [~]# service httpd restart

Error from MySQL query: DBD::mysql::db do failed: Can’t find any matching row in the user table

Have you been getting below error

“Error from MySQL query: DBD::mysql::db do failed: Can’t find any matching row in the user table”

To fix this issue follow below method,

Please remove the following entry from /etc/my.cnf and then restart MySQL:

skip-name-resolve
Screenshot - Monday 22 June 2015 - 12:20:11  IST
The restart mysql using /scripts/restartsrv_mysql
This fixes the issue

upcp cpanel error

While running a upcp –force in cPanel server got below error
[2015-06-20 13:48:48 -0400] see http://go.cpanel.net/rpmcheckfailed for more information
[2015-06-20 13:48:48 -0400] The Administrator will be notified to review this output when this script completes
=> Log closed Sat Jun 20 13:48:48 2015
[2015-06-20 13:49:13 -0400] 17% complete
[2015-06-20 13:49:13 -0400] E Running `/usr/local/cpanel/scripts/updatenow –upcp –log=/var/cpanel/updatelogs/update.1434820770.log` failed, exited with code 1 (signal = 0)
=> Log closed Sat Jun 20 13:49:24 2015

Screenshot - Saturday 20 June 2015 - 11:42:31  IST

The issue is due to duplicate rpm in server

cPanel has a auto script to fix this issue

You need to use command /scripts/autorepair fix_duplicate_cpanel_rpms to remove duplicate rpm in server

root@server1 [/usr/local/apache]# /scripts/autorepair fix_duplicate_cpanel_rpms

This fixed the issue for me and now upcp is working fine.

 

SVNManager error in Softaculous

SVNManager in Softaculous give erros while installing

Came across this in a support request

The following errors were found :

– The SVN config directory does not exist.

– The SVN password file does not exist.

– The SVN access file does not exist.The solution is before installing svnmanager run:

su – username

svnadmin create ~/repos

As the user you want to install it as. Then rerun the installer. Make sure the repo path is /path/to/user/repos

This fixed the issue

rejected by non-SMTP ACL: failed to expand ACL string Exim

If you have been getting error  in exim while sending emails

“rejected by non-SMTP ACL: failed to expand ACL string”

Use the below fix where you need to rebuild exim config and also cop

root@shared [/]# /scripts/buildeximconf
Configuration file passes test!  New configuration file was installed.

warn [buildeximconf] Could not find /etc/exim.pl
warn [buildeximconf] Could not find /etc/exim.pl
Enabled system filter options: attachments|spam_rewrite
Enabled ACL options in block ACL_MAIL_PRE_BLOCK: default_mail_pre
Enabled ACL options in block ACL_RECIPIENT_POST_BLOCK: default_recipient_post
Enabled ACL options in block ACL_SPAM_SCAN_CHECK_BLOCK: default_spam_scan_check
Enabled ACL options in block ACL_CHECK_MESSAGE_PRE_BLOCK: default_check_message_pre
Enabled ACL options in block ACL_CONNECT_POST_BLOCK: default_connect_post
Enabled ACL options in block ACL_OUTGOING_NOTSMTP_CHECKALL_BLOCK: resolve_vhost_owner|end_default_outgoing_notsmtp_checkall
Enabled ACL options in block ACL_CONNECT_BLOCK: ratelimit|slow_fail_block|spammerlist
Enabled ACL options in block ACL_POST_RECP_VERIFY_BLOCK: dictionary_attack
Enabled ACL options in block ACL_TRUSTEDLIST_BLOCK: trustedmailhosts
Enabled ACL options in block ACL_IDENTIFY_SENDER_BLOCK: default_identify_sender|default_message_submission
Enabled ACL options in block ACL_MAIL_BLOCK: requirehelo|requirehelonoforge|requirehelosyntax
Enabled ACL options in block ACL_PRE_RECIPIENT_BLOCK: dkim_disable
Enabled ACL options in block ACL_CHECK_MESSAGE_POST_BLOCK: default_check_message_post
Enabled ACL options in block ACL_POST_SPAM_SCAN_CHECK_BLOCK: mailproviders
Enabled ACL options in block ACL_SMTP_QUIT_BLOCK: slow_fail_block
Enabled ACL options in block ACL_SPAM_SCAN_BLOCK: default_spam_scan
Enabled ACL options in block ACL_NOTQUIT_BLOCK: ratelimit
Enabled ACL options in block ACL_RECP_VERIFY_BLOCK: default_recp_verify
Enabled ACL options in block ACL_PRE_SPAM_SCAN: mailproviders
Enabled ACL options in block ACL_RECIPIENT_MAILMAN_BLOCK: default_recipient_mailman
Enabled ACL options in block ACL_RECIPIENT_BLOCK: default_recipient
Enabled ACL options in block ACL_MAIL_POST_BLOCK: default_mail_post
Detected spam handling in acls, disabling spamassassin in routers & transports!.
SpamAssassin method remains unchanged
Configured options list is:
ACL: acl_not_smtp is active
ACL: acl_smtp_connect is active
ACL: acl_smtp_data is active
ACL: acl_smtp_mail is active
ACL: acl_smtp_quit is active
ACL: acl_smtp_notquit is active
ACL: acl_smtp_rcpt is active
Provided options list is: deliver_queue_load_max|queue_only_load|daemon_smtp_ports|tls_on_connect_ports|system_filter_user|system_filter_group|tls_require_ciphers|hostlist loopback|hostlist senderverifybypass_hosts|hostlist skipsmtpcheck_hosts|hostlist spammeripblocks|hostlist backupmx_hosts|hostlist trustedmailhosts|hostlist relay_hosts|domainlist user_domains|smtp_accept_queue_per_connection|remote_max_parallel|smtp_receive_timeout|ignore_bounce_errors_after|rfc1413_query_timeout|timeout_frozen_after|auto_thaw|callout_domain_negative_expire|callout_negative_expire|acl_not_smtp|acl_smtp_connect|acl_smtp_data|acl_smtp_mail|acl_smtp_quit|acl_smtp_notquit|acl_smtp_rcpt|message_body_newlines|check_rfc2047_length|deliver_queue_load_max|queue_only_load|daemon_smtp_ports|tls_on_connect_ports|system_filter_user|system_filter_group|tls_require_ciphers|spamd_address
Exim Insert Regex is: virtual_userdelivery|virtual_aliases|democheck|check_mail_permissions|remote_smtp|address_pipe|virtual_user|localuser|virtual_sa_user
Exim Replace Regex is: virtual_sa_user|sa_localuser|virtual_sa_userdelivery|local_sa_delivery|cpanel_archiver|cpanel_archiver_transport|discover_sender_information|fixed_login|fixed_plain|lookuphost|remote_smtp|secure_login|secure_plain
Exim Match Insert Regex is:
Exim version 4.82 #2 built 06-Aug-2014 11:03:53
Copyright (c) University of Cambridge, 1995 – 2013
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 – 2013
Berkeley DB: Sleepycat Software: Berkeley DB 4.3.29: (July 12, 2010)
Support for: crypteq iconv() IPv6 PAM Perl OpenSSL Content_Scanning DKIM Old_Demime Experimental_SPF Experimental_SRS
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch dbm dbmjz dbmnz passwd
Authenticators: cram_md5 dovecot plaintext spa
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir autoreply pipe smtp
Size of off_t: 4

Exim Perl Load List is: spamkey|mail_permissions|get_relayhosts_domain|checkuserquota|boxtrapper|fast_checkvalias|email_archiver|fast_isdemo|fast_accountfunc|0_mail_permissions_variables|checkpass_cphulkd|spam_acl_support|encode_string_literal|safefile|cpwrap|checkspam|z_preload_modules|email_send_limits|identify_local_connection
/etc/exim.pl.local installed!
razor2 is installed, enabled in SpamAssassin!
pyzor is not installed, disabling it in SpamAssassin to save memory
SPF is disabled in exim or unavailable, enabling SPF for SpamAssassin
Refreshing SMTP Mail protection.
SMTP Mail protection has been disabled.  All users may make outbound smtp connections.
root@shared [/]# cp -rpf /etc/exim.pl.local /etc/exim.pl
root@shared [/]# /etc/init.d/exim  restart
Shutting down exim:                                        [OK]
Shutting down spamd:                                       [OK]
Starting exim:                                             [  OK  ]

Mod_Security disable

If you want to disable security for one singled domain name you can do it by editing virtualhost in httpd.conf

You can add the below setting in apache’s virtualhost for the domain name

You need to add below rule to disable mod_security

<IfModule mod_security2.c>

SecRuleEngine off

</IfModule>

 

 

Disable cphulkd in cpanel server

Sometime you may face issue while logging to WHM where password does not work but via SSH password work  The issue in cpanel server is due to cphulkd which is one of the security feature.

to get it password working you need to ssh and disabled cphulkd using below commands
root@server [~]# /usr/local/cpanel/etc/init/stopcphulkd
Waiting for cphulkd.pl,cPhulkd,cphulkd to shutdown ….. terminated.

root@server [~]# /usr/local/cpanel/bin/cphulk_pam_ctl –disable

Now you can login to server via WHM