Monthly Archives: March 2017

Use FileZilla to connect via FTP to your web hosting account

In this short tutorial you will learn how to connect with FileZilla via FTP to your account.

The File Transfer Protocol (FTP) is a standard network protocol that is used to transfer files between a client and server.
  1. First at all you need to download and install FileZilla. Visit FileZilla Website and download the client application. Install it.
  2. Open FileZilla. Go to File->Site Manager (or use CRTL+S shortcut)
  3. Click on “New Site” button and enter a short description for the connection. On the right panel enter the host field which is usually yourdomainname.com. You can also use the IP of the server. For port number use 21 – the default FTP port number. Set Encryption: to “Use explicit FTP over TLS if available“. For “Logon Type” choose Ask for password. Enter the User on the same name field.
  4. Click the Connect button. Enter the Password. On the right side of the window you will see the remote files. On the left side are your local files. You can then copy/remove files.
FileZilla Site Manager FileZilla Site Manager
cPanel automatically create an FTP account. The FTP username and password are the same as for the cPanel account.

The video tutorial is here:

Share this post:

How to update cPanel Contact Information & Preferences

Updating your cPanel contact information is very easy. Steps are:

  1. Login to your cPanel account
  2. On the right top click on your username and from the menu select Contact Information
  3. On the dedicated page you will be able to edit the main email address/add a second email address or add a Pushbullet access token. Here you can also change many Contact Preferences settings.

Under Contact Preferences you choose to get email notifications when:

My contact email address changes. My preference for contact email address change notifications is disabled. My account approaches its disk quota. My account approaches its bandwidth usage limit. Any of my account’s email accounts approaches or is over quota. My account’s password changes. My preference for account password change notifications is disabled. An external account links to my account for authentication. My preference for external account link notifications is disabled.

You should not use an email address that exists on the server.

Check the video tutorial:

Share this post:

How to list compiled PHP Modules

Sometimes is useful to see what modules are compiled in your PHP installation.
Let’s see how we can check this both on the server/root level and on the user level.

1. On the server/root level
On the server level, you can use the command php -m

root@web [~]# php -m
[PHP Modules]
Core
ctype
curl
date
dom
filter
ftp
gd
hash
iconv
imap
ionCube Loader
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
soap
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured)

root@web [~]#

An improvement of the above command is to list the version of each module. We will use the command:

root@web [~]# php -r 'foreach (get_loaded_extensions() as $ext) echo "$ext : version " . phpversion($ext) . "\n";'
Core : version 7.0.16
date : version 7.0.16
libxml : version 7.0.16
openssl : version 7.0.16
pcre : version 7.0.16
zlib : version 7.0.16
filter : version 7.0.16
hash : version 1.0
pcntl : version 7.0.16
readline : version 7.0.16
Reflection : version 7.0.16
SPL : version 7.0.16
session : version 7.0.16
standard : version 7.0.16
ctype : version 7.0.16
curl : version 7.0.16
dom : version 20031129
ftp : version 7.0.16
gd : version 7.0.16
iconv : version 7.0.16
imap : version 7.0.16
json : version 1.4.0
mbstring : version 7.0.16
mcrypt : version 7.0.16
mysqlnd : version mysqlnd 5.0.12-dev - 20150407
PDO : version 7.0.16
Phar : version 2.0.2
posix : version 7.0.16
SimpleXML : version 7.0.16
soap : version 7.0.16
sqlite3 : version 0.7-dev
tokenizer : version 7.0.16
xml : version 7.0.16
xmlwriter : version 7.0.16
xsl : version 7.0.16
zip : version 1.13.5
mysqli : version 7.0.16
pdo_mysql : version 7.0.16
pdo_sqlite : version 7.0.16
wddx : version 7.0.16
xmlreader : version 7.0.16
xmlrpc : version 7.0.16
ionCube Loader : version
Zend OPcache : version 7.0.16
root@web [~]#

2. How to check loaded extensions as a user
Create and run a PHP file with the following content :

<?php
foreach (get_loaded_extensions() as $ext) echo “$ext : vers ” . phpversion($ext) . “</br>”;
?>

Yo will get a list of installed extensions alongside with their versions. To check if a specific extension is loaded, use the PHP function extension_loaded().

More info at PHP.net for the functions get_loaded_extensions() and extension_loaded()
Share this post:

Block bad bots via .htaccess

You see a lot of traffic to your site from bad bots? If you have a WordPress site, maybe the first reaction is to search for a WordPress plugin that will block such visits. But instead of using a free/paid WordPress plugin, you can also modify the .htaccess file from the the root of your site. The location of the file is most of the time /home/username/public_html/.htaccess.

You can applies these rules to any website.

Just edit the file and add these lines:

#Rules to block bad bods from accessing web pages on your site. 
#Remove or add more rules as per your needs.
BrowserMatchNoCase "Baiduspider" bots
BrowserMatchNoCase "SemrushBot" bots
BrowserMatchNoCase "Yandex" bots
BrowserMatchNoCase "BLEXBot" bots
BrowserMatchNoCase "AhrefsBot" bots
BrowserMatchNoCase "DotBot" bots
BrowserMatchNoCase "Exabot" bots
BrowserMatchNoCase "SeznamBot" bots
BrowserMatchNoCase "aiHitBot" bots
BrowserMatchNoCase "spbot" bots
BrowserMatchNoCase "MJ12bot" bots
BrowserMatchNoCase "oBot" bots
BrowserMatchNoCase "DeuSu" bots
BrowserMatchNoCase "ia_archiver" bots
BrowserMatchNoCase "MetaURI" bots
BrowserMatchNoCase "FlipboardProxy" bots

Order Allow,Deny
Allow from ALL
Deny from env=bots

These bots will get now a 403 HTTP Error when trying to access your pages.

Double-check the bots you want to block! Not all bots are bad.

Using the .hatccess file, you can also block bad IPs. If you know malicious IPs, add them like:

#Deny malicious bots/visitors by IP addresses.
deny from 118.244.181.33
deny from 82.102.230.83

How you can edit the file?
1. Connect to your account via a FTP client like FileZilla FTP Client and edit the file.
2. Use the cPanel File Manager. Login to your cPanel account and go to File Manager

To buy a web hosting plan check our dedicated page for Web Apps Hosting.

Share this post:

Update cURL for EasyApache 4 to the latest version

EasyApache 4 from the cPanel environment is using a very old curl version. You may have issues with shop carts like WHMCS which gives you the following error message when going to Help->System Health Status.

The message states:

You currently have version 7.29.0 of cURL installed. This version is known to have security issues. Please update to the latest cURL and ensure it is greater than 7.35.0.

First let’s check the present PHP 7 curl version:

root@web [~]# php -r '$info = curl_version();echo $info["version"]."\n";'
7.29.0
root@web [~]#

Using the instructions from this cPanel Feature Request we will update curl to the latest version.
1. Make a backup copy of the file /etc/yum.repos.d/EA4.repo
cp /etc/yum.repos.d/EA4.repo /etc/yum.repos.d/EA4.repo.bak

2. Edit the file /etc/yum.repos.d/EA4.repo
Comment out the “mirrorlist” line and add one of the following lines according to your operating system.
CentOS 6 – 32bit: baseurl=http://ea4testing.cpanel.net/CentOS/6/EA4/i686/
CentOS 6 – 64bit: baseurl=http://ea4testing.cpanel.net/CentOS/6/EA4/x86_64/
CentOS 7 – 64bit: baseurl=http://ea4testing.cpanel.net/CentOS/7/EA4/x86_64/

3.Run the “yum update” command.
With this action, about 80 packages were updated on our test server. Let’s check again the PHP curl version

root@web [~]# php -r '$info = curl_version();echo $info["version"]."\n";'
7.53.1
root@web [~]#

As you can it see we have now the latest version. It will be released to all EA4 systems during next week. Also, the WHMCS warning message is gone.

Update 21 March 2017 : the new curl version is available to all EA4 systems.

Share this post:
Page 3 of 4
1 2 3 4