Web Hosting Archives - Webx Networks

How to Install a Node.js Application on cPanel


This document describes how to install a Node.js web application. Node.js is a JavaScript runtime that allows you to build scalable web applications.

We recommend that only experienced web developers perform these steps. We are not responsible for any data loss.

Install the Application

To install an application, perform the following steps:

1) Create the application’s directory inside your home directory (outside of public_html). For example nodejsapp.

2) Change to the application’s directory nodejsapp and upload app.js file similar to this one:

Register the Application

After you install the application, register it. To do this, use cPanel’s Application Manager interface (cPanel >> Home>> Software >> Application Manager).

Registering Application in cPanel

In this example, businessx.com represents your website and /myapp is the path where you want the application to load.

After registering the application, you can access it over the web at the Application URL.

Restart the Application

When you want your application to restart after you edit it, create the restart.txt touch file in the application’s tmp directory. This file directs the server to restart the application after you modify it. This action applies your changes to the application.

You must touch the restart.txt touch file each time that you want the server to restart the application.
You must manually create the tmp directory. For example:

$appDir/tmp/restart.txt

node and npm command line

By default node and npm commands are not in your path. To access these utilities, you’ll need to update .bashrc (dot bashrc) file in your home directory and add the following line to it:

export PATH=/opt/cpanel/ea-nodejs10/bin/:$PATH

This will make the utilities available in your execution path. After saving the .bashrc file, log out of ssh/terminal session and then log back in so that the PATH environment variable is loaded. And now you can run commands like the following to confirm they work:

node --version

npm --version

You can go into your app folder and install the modules using npm install package-name.

How to Protect WordPress Admin Login


wordpress protected web hosting
WordPress hosting has becoming very popular because of its flexibility and ease of use. WordPress is as secure as your login to its admin interface (if you keep all plugins/themes and core engine to latest stable release). Since WordPress requires the admin login for management, it is available by default on public Internet for access. There are many techniques and plugins used by WordPress users to protect their websites and admin login. Some of them are

  1. Use secure password
  2. Use another username for admin instead of “admin”
  3. Use additional plugins to protect against attacks

These are all good measures, but what if your password is leaked through other means? If your own computer is hacked and you enter your correct WordPress admin username and password, then a hacker will have access to it. In this case, there is no need for any brute force attack. Your password can be very strong but if hacker has it, they can login easily.

Apache mod_rewrite Protection

Here is a simple technique that you can use to protect the admin login and restrict it to your IP addresses. Even if hacker gains access to your admin username/password, they cannot login to WordPress unless they hijack your computer as well.

All you have to do is edit .htaccess file in WordPress root folder and right above the Permalink WordPress mod_rewrite rules, add these rules:

In the above code, replace 123.123.123.123 with your own IP address. If you have multiple admin users that need access, you can repeat that line to add more IP addresses one after the other. And replace webx.net with your own website. That will redirect unauthorized users to your website home. Or you can use another web page that you want to show such users.

This file can be edited via FTP or cPanel. If you do not have a static IP address from your ISP, you can change the IP in .htaccess file when you need to work in admin interface. If your FTP or cPanel access is leaked, then you have a bigger problem to handle.

We hope this is useful for you and if you have any comments or questions, you can leave them here. Thank you.

Disk Usage in cPanel


The cPanel Disk Usage Viewer provides an overview of the disk space that your account is using. It shows disk usage totals for your account’s directories and all of its databases rather than for individual files or databases.

To view the disk usage, please login to your cPanel account and click on Disk Space Usage icon in Files section:

Disk Space Usage in cPanel

The bars in the graph represent disk usage figures relative to the largest directory, not according to a fixed scale:

Listing of Folders with Disk Usage

You can use the File Manager to see disk usage data for individual files, and the MySQL main page to see data usage for individual databases.

Some other import folders to keep in mind are:

/tmp for stat reports (AWStats, Webalizer)
/logs for raw web server logs
/mail for email data for all domains in this account
/etc for email login/passwords

Due to the nature of how files are stored electronically, most files occupy slightly more disk space than their actual size. For example, a 300 byte file may occupy 4 kB of actual disk space. This may cause discrepancies between the data you see in the File Manager versus the information you find in Disk Usage page.

Disk Space Usage Table

Moreover, the disk space usage in the table above indicates how much space the directories’ contents use, not how much space the directory itself uses. Directories themselves usually use a negligible amount of disk space unless they contain a large number of files or subdirectories.

We hope this is helpful information. If you need any assistance, please contact support.

File Manager in cPanel


File manager allows you to manage and edit the files right inside the cPanel interface. You do not need to download/upload the files or require any special software on your computer to edit them. Although this method can be used to create entire website however it is meant for quick fixes or edits on the fly. Normally you would want to keep a local copy of files that you maintain and edit in a developer environment such as Adobe Dreamweaver.

You can access the File Manager under Files section as shown in the screen shot below:

cPanel File Manager

When you click the icon, a small popup window will show to select a folder to open in File Manager. You can choose Home Directory which contains all other files and folders, or you can go directly to web root (i.e. public_html) folder which contains your main website files. Or if you have multiple websites hosted, you can go to any particular document root.

File Manager Directory Selection

You also have the option to Show Hidden Files (files that start with dot) and you can skip this popup in future if you want to open a particular folder every time you go into File Manager.

Show Hidden Files

Once you have made the selection, a new tab or window will open with the File Manager.

File Manager in Action

You will have the folders in a tree structure on the left and files in the selected folder in the right pane. You can do many functions such as Create New File, Copy, Move, Upload, Download, Delete, Rename, Edit, Change Permissions, and View files. For example to rename the file, highlight it and click Rename icon on top menu and you’ll get a popup window to enter new name:

Renaming File in cPanel File Manager

Similarly other functions can be performed. While editing you have the option to edit as text or HTML Editor:

HTML Editor

You can also do code highlighting when editing code files using Code Editor:

Code Editor

We hope the File Manager can be a handy tool. If you need any assistance, please contact support or you can post your comment/question on this blog.

Taking Backups of Web Hosting Account in cPanel


Although we backup entire hosting server every day and keep consecutive backups for several days and weeks, we strongly recommend that every client should have their own backups. The backups we take are for emergency purpose i.e. disaster recovery in case of hardware failure such as multiple disk failures.

The question may arise, how do you take a backup of your entire website? And which files to backup? cPanel makes it easy. Taking Backups of Web Hosting Account in cPanel is straight forward process.

cPanel Backups allow you to download (to your computer) a zipped copy of either your entire site (including your home directory, databases, email forwarders configuration, and email filters configuration) or one of the previously mentioned parts of your site.

As highlighted in the screen shot below with red square, you can find the Backups icon and link under Files section in cPanel. Click that to access Backups screen.

cPanel Backups

The next screen has a video tutorial on how to generate a full backup. We explain here as well.

Full Backup

A full backup includes all of the files in your home directory, your MySQL databases, and your email forwarders and filters. You can back up your account to preserve your data, or to move your account to another cPanel server.
Click on “Download or Generate a Full Website Backup” button to proceed:

Full cPanel Backup

This full backup can only be used by server administrator (with root privileges) to restore entire account settings and data (including website files, mysql databases, emails). It cannot be used on the cPanel interface by you to restore an account. It is useful for safe keeping.

Generate a Full Backup

You can generate a full backup and store it in

a) Home Directory i.e. you can use ftp or file manager to download the backup when created from /home/username/ folder (where username is your cPanel username)

b) Or you can upload the backup to a remote FTP server or SCP.
You also have the option to enter your email address where notification will be sent by cPanel once backup is completed.

Create Backup and Store in Home Directory
If you choose to upload the backup on a remote FTP server, you will need to provide the login details:

Upload Backup on Remote FTP Server

Click Generate Backup to proceed and wait for email confirmation. In case email does not arrive for a long time, you can visit the Backups screen again to see the progress:
Backup in Progress

And when it is complete, it will show up with a link to download. Simply click on the link of the file to download the backup on your computer.
Backup Ready for Download

Partial Backups

On the main backup screen you also have the option to download partial backups i.e. your home directory that contains all your files and emails, your databases, your email forwarder settings etc.

Partial Backups

These partial backups have an advantage that they can be used by you to restore a portion of the site. Please note that Home Directory contains website files as well as email accounts. You can open the downloaded zip file and extract the files on your computer to find and restore individual files from it.

Backup Wizard

The Backup Wizard available under Files section does the same but it has a different work flow to make it easy for you to download and restore backup.

Backup Wizard

Hope this helps you keep regular backups of your important data. We cannot stress enough how important it is to keep regular backups and multiple backups. If you need any assistance with backups, please do not hesitate to contact us or you can post your comments and questions below.

Back to Top

© 2019 Webx Networks.