Common Server issues

SMTP issue could be because of following on UK Server, same we can try on RsHosting

Hello,
Great. The following must be set in csf.conf: SMTP_BLOCK = “0” and set FKA SMTP Tweak under Tweak Settings in WHM accordingly.

  • How to make the innodb_strict mode OFF
    WHM >>phpmyadmin >>variables >>search >>innodb_strict mode >>click on edit icon >> off
  • Professional finish PDF was not printing correctly and it was related to some hosts file changes by the server end
  • Restart mysql: service mysqld restart


When WKHTMLtoPDF not able to call self URLs

https://www.rshosting.com/support/index.php?/ticket/ticket_details/JMER-080615/130654
https://www.rshosting.com/support/index.php?/ticket/ticket-reply/JMER-080615/130654

Unusual server break due to server memory issues

Page was breaking and taking CRM to page nahi mila file on the very root 

Search this is email [NUDU-876406]: Chat Transcript 

Sent to  Mitaksh Bhalla <mitakshbhalla@gmail.com>  as well  


Test PDF create code

https://mail.google.com/mail/u/0/#label/rshosting

<?

$random = rand();

$random = $random.”.pdf”;

$filen_name = $_SERVER[‘DOCUMENT_ROOT’].”/”.$random;

exec(“/usr/local/bin/wkhtmltopdf ‘https://www.google.com’ ‘$filen_name’ “,$output);

sleep(4);

ob_clean();

header(“Location: /$random”);

?>

exec(“/usr/local/bin/wkhtmltopdf ‘https://google.com’ ‘/home/demoweballiance/public_html/arolite/estimate_pdfs/$random'”);


RsHoting issue with WKHTMLTOPDF

https://www.rshosting.com/support/index.php?/ticket/ticket-details/UYAX-001407/121613

Due to Execute function WKHTMLTOPDF not working 

https://mail.google.com/mail/u/0/#search/wkhtmltopdf/FMfcgzGqRZXPmbFjwpZdHDjnNLKkCDWN

Adding domain to whitelist if mail is going to spam

Mohit: You can add whitelist in cPanel => Spam Filters => Show Additional Configuration => Whitelist (Emails Always Allowed) => Add new whitelist from, for any legitimate email or domains for you

https://81.19.186.4:2087/cpsess6322433851/scripts2/manageshells

For disabling Shell access 

Giving permission to a folder when downloaded using GIT on server

chown -R lightingbygabrie:lightingbygabrie kar-test1/                    for permission 

git clone https://mitaksh@bitbucket.org/mitaksh/gabrielli_server_backup.git gabrielli_server_backup1    for cloning  

mv gabrielli_server_backup1/.git   /home/lightingbygabrie/public_html/  for moving cloned .git to main folder 

git add *.* -f

git config –global –add safe.directory /home/weballianceco/public_html


When website or CRM breaks without any reasons:

Like following site was creating issues:

https://www.proactiveeducation.co.uk

When website or CRM breaks without any reasons:

In case of RsHosting server login to cpanel and 

On the left menu search for “Terminal” and run top command it will show following result with the CPU usage:


To Check OUR IP is allowed on any server or not?

nc -vz 51.52.95.32 40027    

netstat -vz esi.hypersage.co.uk 40027


If SMTP emails are running on our Server

In case of RsHosting server login to cpanel and On the left menu search for “Terminal” and run  csf -r  command it will restart firewall to allow SMTP connection 


Making zip from the server with changed files after a date 

zip -r tqcweballiance/public_html/latest_backup.zip $(find tqcweballiance/public_html/ -type f -newermt “2022-05-18 00:00”)  

Zip with name of the file as today’s date 

zip -r tqcweballiance/public_html/”archive-$(date +”%Y-%m-%d”).zip” latest_backup1.zip $(find tqcweballiance/public_html/ -type f -newermt “2022-05-18 13:42”)


uname -r

traceroute google.com

cat /etc/os-release

sudo systemctl status iptables

cat /etc/sysconfig/iptables

systemctl status firewalld

traceroute 51.52.95.32

curl 51.52.95.32:40027

PDF Generation from other server and Saving the pdf our server



For Creating PDF another server
<?
define('ROOT_DIR_PATH',"/home/demoweballiance/public_html/folder-name-pdfs/");

//$url = $frontEndURL."/admin/purchase_order/index?page=view_purchase_order_pdf&po_id=$id&hide_top=1&hide_left=1&print_pdf=1";

$url = $_REQUEST['url'];


if(isset($_REQUEST['print_url'])){
	
	echo "<a target='_blank' href='$url'>$url</a>";
	die;
}
$pdf_name = $_REQUEST['pdf_name'];
//unlink("".ROOT_DIR_PATH."'temp-pdfs/".$pdf_name);
$file_path = ROOT_DIR_PATH."/temp-pdfs/".$pdf_name;
exec("wkhtmltopdf '$url' '$file_path'");
sleep(1);

if(file_exists(ROOT_DIR_PATH."/temp-pdfs/$pdf_name")){	
	ob_clean();
	header("Location: $frontEndURL"."temp-pdfs/$pdf_name");
	exit;
}
?>


For fetching Pdf from another server which was created using above code and saving on our server
<?
define("ROOT_PATH",'/home2/weballia/public_html/folder_path/');
define("FOLDER_PATH",'generated_pdfs/'); 
define("PDF_FOLDER_PATH",ROOT_PATH.FOLDER_PATH);

$url = $_REQUEST['url'];
$pdf_name = $_REQUEST['pdf_name'];

$attachment_url = "https://demo.web-alliance.uk/folder_path/create-pdf.php?pdf_name=$pdf_name&url=$url";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $attachment_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);



$data = curl_exec($ch);
curl_close($ch);
file_put_contents(PDF_FOLDER_PATH."".$pdf_name,$data);


ob_clean();
header("Location: https://abc.co.uk/".FOLDER_PATH."$pdf_name");
exit;

//https://abc.co.uk/generate-pdf-with-url.php?pdf_name=testing123.pdf&url=https://abc.co.uk/admin/index.php?l=2
?>

Speed issue of google, speeding up page rendering

https://developers.google.com/speed/docs/insights/EnableCompression

https://htmlcompressor.com/compressor/
for speeding up
http://www.inmotionhosting.com/support/website/what-is/how-to-enable-gzip-moddeflate
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
<FilesMatch “\.(jpg|jpeg|png|gif|swf|css|ttf|js)$”>
Header set Cache-Control “max-age=604800, public”
</FilesMatch>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>