Monthly Archives: July 2015

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