What Is JSON? Everything That You Need To Know About It
JavaScript Object Notation (JSON) is an open-standard file format, used to exchange information that is readable to humans. This file contains only text and uses the extension .json.
It is a lightweight format used for storing and transporting data between a server and web application, as an alternative to the XML. In simple words, JSON gives human-readable collection of data that we are able to access in a logical manner.
Usage of JSON –
Most of the developers use JSON so as to work with AJAX (Asynchronous JavaScript and XML). Both these formats work well together in order to provide you the asynchronous loading of stored data that simply means, the website can update its information without refreshing the page.
This format is often used to serialize and transmit structured data over a network connection.
It also allows users to request data from a different domain with the help of a method called as JSON by using (<script>) tags. Without this, you cannot transfer data across-domains.
Structures of JSON –
JSON is built on two structures :
(i) A collection of name/value pairs. In most of the languages, this is known as an object, record, dictionary, struct, hash table, keyed list or an associate array.
(ii) An ordered list of values. In most of the languages, this is known as an array, vector, list, or sequence.
JSON syntax rules :
(i) Data is always in key/value pair.
(ii) Data is always separated by commas.
(iii) Curly braces hold objects.
(iv) Square brackets hold arrays.
Example : “gender” : “male”
Here: key (name) = gender and
value = male
Different types of Values are :
(i) Array – Array of values
e.g : “students”:[ {“firstName”: “Jack”, “lastName”: “Timothy”}, {“firstName”: “Sam”, “lastName”: “Green”} ]
Or{ “firstName” : “Jack”, “lastName” : “Timothy”, “gender” : “male”, “hobby” : [“football”, “painting”, “swimming”] }
Note: Difference here is that, the key Hobby has several values (football, painting, swimming) mentioned in a square brackets, which represents an array.
(ii) Boolean – True or False {“sale” : “false”}
(iii) Number – An integer{“age” : “25”}
(iv) Object – It is an associate array of key/value pairs { “id” : “48”, “language” : “Java”, “price” : 500, }
(v) String – Several plain characters that usually form a word “firstName” : “Jack”
If you want to store JSON data, there are two way to accomplish it. First is objects and the next one is arrays. In this section, we will discuss more about them below.
Using Objects
Curly brackets begin and end a JSON object. Comma-separated lines contain key/value pairs called properties. Each key and value are separated by a colon.
Strings are required for keys, but numbers, objects, arrays, booleans, and nulls are allowed for values.
There is a difference between JSON objects and objects in the JSON data type. Arrays of key-value pairs serve as a storage method, while associative arrays represent key-value pairs.
Now for your convenience, let’s take the example of three keys, Name, roll number and class with values like Thomas, 24 and 7 A.
{
“Name”:”Thomas”,
“rollnumber”:”24″,
“Class”:”7A”
}
Using Arrays
The use of arrays is another method of storing data. Each line is separated by a comma, with the values enclosed in square brackets. It is possible to have different types of values in JSON arrays.
As opposed to arrays as values, JSON arrays are collections of elements that are typically all the same type.
Let’s have an overview as an example:
{
“Name”:”Thomas”,
” rollnumber “:”24”,
“Class”:”7A”,
“subjects”: [
“english”,
“science”,
“maths”
]
}
What Differs Both?
The fourth key/value pair differentiates this method from the previous one. The key is subjects, and there are several values in the square brackets (english, science, maths).
When paired with JSONP, arrays can be used to overcome cross-domain issues. Furthermore, they support loops, allowing users to run repeated commands to look up data faster.
Conclusion –
From the above examples, you might have understood that JSON is a useful tool that can be used to interchange data in a manner that can easily be understood by humans.
It can load information asynchronously so that, your website becomes more responsive and can handle the data stream more easily. Also, JSON is easy and lightweight than XML.
What to Use – Nginx vs Apache?
For a good user experience of your website, you need to ensure that your servers are fast. There are plenty of programs that you can use for this purpose. Nginx and Apache are the most popular ones. This article will explain you the detailed comparison of the two for helping you to select the one that fits your VPS project best!
Nginx
Nginx is a high-performing web server which is lightweight. Its open source nature makes it easy to customize. It is highly popular as Apache as both practically govern the complete market of web servers.
The development of Nginx started in 2002 when the need for increasing the number of simulated requests per server arose.
When it comes to the technical level, Nginx uses a non-existing sub-process architecture. This indicates that when a request is generated, a new process isn’t created in the server processor. This ultimately increases the performance of the server.
Additionally, in recent years, Nginx is the fastest growing web server. You will find that there are 375 million websites running on Nginx server. You will find it available on all your preferred Linux flavors like CentOS 7.
Apache
Apache is highly expert web server which was created in 1995 and today it is the most popular in the world. Being an open source, you can examine, improve and adapt the source code as per your needs. Similar to Nginx, it is available for almost all Linux distributions along with Ubuntu 18.04 and CentOS 7.
Apache basically aims at providing a secure, stable and flexible web server. For example, the multi-process modules are managed by Apache for maintaining the same connection in different ways. Due to this, administrators can apply criteria for each connection which is the biggest benefit.
But, the more the consumption of Apache server occurs, the more it requires resources.
Nginx vs Apache: Can They be Compared?
In short, the answer is yes. No doubt both perform their function properly but they are a bit different. So, it is important for you to know in which areas it is or is not suitable for your server.
1. Nginx vs Apache – Popularity
Being popular is not a technical term, but surely it has an impact on the level of community support the server may have. Both Nginx and Apache are quite popular and so, you can almost say that they are one.
However, Apache gets greater support from the open source community, making it an ideal platform for educational projects and individuals.
In addition, Apache stands as the most popular web server in the world, even though there isn’t much difference between Nginx and Apache.
2. Nginx vs Apache – Security
In term of security, both web servers offer good security policies. The development teams of both the servers, frequently, publish security patches to avoid DDos attacks.
Moreover, you get quite active developments and constant updates.
3. Nginx vs Apache – Performance
In case you have a website then the web server should be faster. If it isn’t, it might lead to server collapses and at worse, a lack of visitors.
When performance comes into the spotlight, the sub-process management of Nginx responds better to customer requests. Additionally, since it is event based, only the server responds with requests, not allowing it to spend memory unnecessarily.
Apart from this, Nginx efficiently consumes computer resources. In simple terms, it requires less RAM to keep running.
One more important thing is that Nginx follows multiple requests in a better way. Hence, when several clients access your server at the same time, Nginx proves superior to Apache.
4. Nginx vs Apache – Flexibility
There are multiple different situations which a sysadmin has to deal with. So, applications must be highly flexible to adapt to what is required.
Being a highly flexible web server, Apache supports over 60 different modules, further extending its functionality.
Also, the customization of connections is supported by Apache via the .htaccess tool, while Nginx does not.
As a result, Apache is more flexible and customizable as compared to Nginx.
What to Use? Nginx vs Apache – Bottom Line
Lastly, whether to use Nginx or Apache completely depends on your needs. In general, Apache is perfect when it comes to customizing connections. Also, using it isn’t a bad idea if you need a lot of documentation. The reason is that Apache offers more community support.
On the other hand, if your web server receives high traffic, you might need to use Nginx because it can handle the traffic in a much better way.
Finally, you can use both on the same server. Remember, this isn’t possible frequently as you think, but is possible for different websites. Websites that require more customization use Apache, while websites that are accessed by more clients, are served in Nginx.
The closure point is that you need to decide what is more important to you and select between them accordingly.
How to Create and Edit a File via FTP?
An FTP client helps to create and edit files for your website. Creating and editing files via FTP is easier way as compared to using the command line. Any FTP client can be used as per your preference, but in this article we are going to use the FTP client ‘Filezilla’.
Steps to Create a File
Follow the below steps to log into your server and create a file.
1. Log into your server with the help of an FTP client.
2. Check if your client has the permission to show hidden files.
3. Ensure that you have logged in the correct directory for creating the file. You will see the directory in the right pane titled “Remote site”. In this example, the directory is /home/example_username/example.com.
4. Right click and select ‘Create new file’.

5. You will prompted to enter the name of the file. In this example, you will find a file named .htaccess. Click the OK button to save.

6. You will find the empty file exists on the server.

Steps to Edit a File
Check the below steps to edit an existing file:
1. Log into your server using an FTP client.
2. Ensure that you’re in the correct directory to create the file. The directory is located in the right pane in a field titled “Remote site”. In this example, the directory is /home/example_username/example.com.
3. Right click on the file and select on ‘View/Edit’.

4. You will be prompted for choosing a text editor. You can select a specific editor that is already installed, but using the default editor for Windows which is Notepad is the easiest option.

5. Notepad will open the file. Add any text essential to the file.

6. After finishing, click on ‘File > Save’.

7. After a few seconds, you will be prompted for the file change. Tick the box and click on ‘Yes’.

Now, the file is updated on your web server.
CentOS vs Ubuntu: 15 Factors that Differentiate Them
Let the battle start!
In this article, we will be checking the key differences between CentOS and Ubuntu in a web hosting environment.
Even if this isn’t a complete comprehensive analysis of each aspect of the several in-depth features of each operating system, this will surely offer a solid summary that will enable to select which system is highly suitable for your requirements. Let’s start!
Ubuntu
In Wikipedia, Ubuntu is defined as below:
“Ubuntu is a free and open-source Linux distribution (that’s) based on Debian. Ubuntu is officially released in three variants: Desktop, Server, and Core: (for the internet of things devices and robots). All the editions can run on a standalone computer, or in Windows. Ubuntu is a popular operating system for cloud computing, with support for OpenStack. Ubuntu is released every six months, with(LTvarientsS) long-term support releases every two years. The latest release is (“Disco Dingo”) version 19.04 , and the most recent long-term support release is(“Bionic Beaver”) 18.04 LTS , which is supported until 2023 under public support and, until 2028 as a paid option.”
CentOS
In Wikipedia, CentOS is defined as below:
“CentOS (from Community Enterprise Operating System) is a Linux distribution that provides a free, community-supported, enterprise-class, computing platform compatible with its upstream source, (RHEL) or Red Hat Enterprise Linux. In January 2014, CentOS announced the official affiliation with Red Hat while staying independent fromRed Hat Enterprise Linux, under a new CentOS governing board. The first CentOS was released in May 2004, (and numbered as CentOS version 2), was forked from Redhat (RHEL) version 2.1AS… (The) building of CentOS 8 commenced as of May 2019.”
Comparison
Features | Ubuntu | CentOS |
---|---|---|
System Core | Based on Debian | Based on Redhat |
Update Cycle | Often | Deliberately Infrequent |
Security | Good (but needs additional configuration) | Strong |
Support Considerations | Excellent documentation and support community | Good documentation. Small but active user community. |
Platform Focal Point | Geared more towards the desktop user | Geared towards the server market and preferred by larger corporations |
Manageability | Moderate | Challenging |
File Structure | Both use the same basic file/folder structure but, system services will differ in location | Both use the same basic file/folder structure but, system services will differ in location |
Package Management | apt-get, aptitude | YUM |
Cloud Interface | OpenStack | OpenStack, OpenNebula, CloudStack |
Virtualization | KVM, Xen | Native KVM Support |
Ease of Use | Moderate | Difficult |
Speed Considerations | Excellent (depends on HW used) | Excellent (depends on HW used) |
Hosting Market Share | 37.8% (7/19) | 17.3% (7/19) |
Default applications | Frequently Updated | Infrequent Updates (only as required) |
Stability | Good | High |
Pros & Cons
Hosting
Today (as of 7/2019), Ubuntu, Debian, and CentOS are the prime operating systems that are utilized in the hosting market. Many might be using the Ubuntu server OS tied to smaller private servers that are running SMB’s type sites/servers. But, the pure volume of servers that use Ubuntu indicate the growing acceptance of Ubuntu as a primary OS in the web hosting sphere.
In case you want to use a control panel to manage your web hosting services, you should closely check CentOS, as it is highly compatible with different management panels that you may require. Web hosting control panels like cPanel, Webmin and DIrectAdmin have always been focused on CentOS and other RedHat based operating systems. It’s a bad luck that Ubuntu does not support cPanel but does have quite a few alternatives, such as Webmin/Virtualmin and VestaCP.
CentOS is also developed to be very stable and secure but due to this, many of the core systems might run older, more mature software versions with security updates that are backported from Redhat as required. CentOS is also the best choice for medium-large sized businesses and, websites that need cPanel. Though the CentOS user base is smaller than Ubuntu, CentOS still comprises of an online community and also provides premium support options if you want.
The Cloud
Ubuntu server supports container virtualizations as well as cloud deployment in a very good manner and this shows its influence in the market as compared to CentOS. Since June 2019, “Canonical announced full enterprise support for Kubernetes 1.15 kubeadm deployments, its Charmed Kubernetes, and MicroK8s; the popular single-node deployment of Kubernetes.” CentOS offers three private cloud choices and a public cloud platform through AWS.
Additionally, a mature platform in this area and excellent documentation is also offered by CentOS. The below chart recognizes the complete usage of cloud-based preferences as of June 2019 via EC2 Statistics compiled from Amazon.
Gaming
You will get the comparisons of different OS offered by Steam on their gaming platforms that indicate that there are highest numbers of users that run Ubuntu on their systems. Currently, more than 30% percent of all Steam users run on Ubuntu, followed by 49% of other different Linux distros. Though gaming on Linux does not completely relate to the hosting industry but, it surely shows how widely Ubuntu is accepted and used across multiple sectors.
Web Hosting
If you are just beginning your hosting journey, it’s recommended to go with Ubuntu just because of its larger community supported user base, the wide collection of tutorials and documentation available and, frequently released updates help you in maintaining the latest software. Ubuntu too has some advantages in this space as well but, there are some situations where you may need to switch to an older software version as updates may cause problems with existing sites. In addition, if you have used an Ubuntu desktop in the past, you will find it easy to learn when starting with an Ubuntu based VPS server.
Since Ubuntu updates are released more often as compared CentOS, it does not significant indicate that CentOS is less stable or secure. Such ongoing modifications can be obtained at a cost even particularly if a newer software version of a core Ubuntu system is updated, it might affect the existing websites that might depend on the older software version which in turn may affect functionality and/or stability. Also when it comes to security, Ubuntu forces the use of sudo at first as the main user and, then disables the root user by default. This restricts the opportunity of running commands that might be harmful to the system.
No doubt, CentOS is a solid, viable choice but, it might provide a difficult learning curve when you are starting out newly with Linux hosting. While running a business, CentOS may be the better choice than Ubuntu because, it’s (arguably) highly secure and stable, due to the reserved nature and the lower frequency of its updates. Moreover, CentOS also offers support for cPanel which Ubuntu doesn’t offer.
Though Centos is stable and secure, but due to this, many services that run on the server are likely to be older versions with backported security fixes applied. Also, if CentOS freezes a version number, it won’t provide further improvements except for security updates and major bug fixes. This is a positive sign in terms of stability and security but, this can be negative for services like PHP or MySQL, or other standard software used by the server and those are getting developed rapidly and might enhance in the next few years. One simple solution to this is to simply add extra software mirrors for resolving this type of issue.
Once you check these options, it truly describes the purpose of the server, the way it is going to be utilized for each OS, the size of your business and, your technical knowledge. For small businesses and newbies to hosting, Ubuntu is the secure choice. This is because it has a big user community base, the maximum amount of resources available online, tutorials and their online forums, including a significant community of open source developers. With this, solutions to the problems can be found as quickly as possible. Lastly, each OS distribution has its pros and cons while selecting the version, ensure it completes all of your business requirements, needs, and demands.
Still having queries about which OS would work best for you? Don’t hesitate to call our support team and learn how you can benefit from these technologies to boost your sales and customer interactions for your business.
Steps to Create a PHP Redirect
You can redirect a URL in several ways. It is beneficial for those looking to redirect requests from their main domain to another directory under that domain. For instance, if you want to direct requests for example.com to example.com/blog, you can do this using an .htaccess file. But, it’s also possible to redirect by using PHP.
In this article, you will learn to create a redirect using PHP.
Does redirecting work with https (SSL certificate)?
The answer is ‘No’. Redirecting is only possible with ‘http’ URLs. In case you install an SSL certificate on ‘example.com’ and visit ‘https://example.com’, you will be redirected to the ‘Site Not Found’ page.
Steps to Create a Simple Redirect in PHP
Create a file with a name index.php. This can be done by using an FTP client such as Filezilla, or by using SSH. Check the below articles for instructions on how to create it (based on if you’re using an FTP client or SSH):
Ensure that the file is in the domain’s directory. This directory is the one that is mentioned while adding the domain to your panel. This can also be confirmed by going to Manage Domains and clicking the Edit button to the right of the domain.
Note: In the above example, the domain is websitehelp.support. Your domain shows instead while checking your settings page.
In this index.php file, include the below line of code:<?php header(“Location: http://www.example.com/blog”); ?>
Don’t forget to change the sample URL to the URL you would like the site to forward.
After this you will get a simple and quick redirection that you can use to easily redirect an HTTP request to any URL.
Connectivity Issue with the Host Server – What Is It?
Connectivity issue is the most common issues of all and might lead to several problems.
However, here it is most commonly stated as: sudden network failure at one of the upstream network providers due to which you can’t connect to your host server.
Multiple Tier 1 telecom providers are used by MilesWeb. This helps in bypassing transit networks which reduces the network path between your website and your visitors.
But, it means that when your ISP or its upstream providers face connectivity issues, you or some of your visitors who pass via the problem providers won’t be able to access your website.
However, all other visitors will be able to visit your website easily.
Steps to See Available Python Modules
To view the available python modules, login to your account via SSH. Then run the below command:python
You will get the following:username@server [~]# python Python 2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 Type “help”, “copyright”, “credits” or “license” for more information.
Then to view the available modules type the below code:help(‘modules’)
This will provide you the list of all currently available modules.
Learn to Install PuTTY on Ubuntu Linux
Introduction
PuTTY, a popular terminal emulator for Windows isn’t just limited to Windows operating system. It is free and open source and also popular among Linux users. It supports several protocols including SSH, Telnet, serial, rlogin, SFTP, SCP, etc. Seasoned sysadmins and hobbyists use it. Generally, it is used by Sysadmins as an SSH and telnet client whereas the Maker community broadly uses it to interface with the serial ports on their hardware. PuTTY also comes with a command line tool named “psftp”. It is the PuTTY SFTP client used to transfer files securely between computers over an SSH connection.
In this article you will learn to install PuTTY on Ubuntu 14.04 and higher.
PuTTY can be installed in Ubuntu Linux by using the terminal i.e. the command line in a easiest way.
Steps to Install PuTTY on Ubuntu Linux
1. Login to your Ubuntu Desktop. In order to open GNOME terminal press Ctrl + Atl + T. If the shortcut doesn’t work, run the Terminal from the Ubuntu Dash.
2. Execute the below command in the terminal:>> sudo apt-get update

With this command, the Ubuntu package list gets updated with latest one. In case you skip this command, Ubuntu might install older version of the softwares rather than the latest version because it only had the older list with older version of softwares. So, before installing new software or intending to upgrade the software versions, you should run this command first. This sudo prefix at the beginning of the command, informs the terminal to execute the command as root as installing and upgrading softwares is a privilege operation and should not be performed by users having limited access. Mention the user password when asked by sudo and hit Enter.
3. Use the below command to install PuTTY:>> sudo apt-get install -y putty

4. Now PuTTY will get installed. Use “putty” as command to run it, or you can run it from the Dash.>> putty

From the screenshot above, you can see that it offers a range of connection type to select from: Telnet, Raw, SSH, Rlogin and Serial. It also comes with command line tools for SFTP (psftp), SCP (pscp), RSA and DSA key generator (puttygen), etc. You can run them from the terminal.
In this way, you can install PuTTY on Ubuntu Linux in these simple steps.
How to Access cPanel?
cPanel is one of the most popular and widely used control panels. It has a user-friendly interface that is easy to understand, even for first-time users.
To Access cPanel
Web hosting providers send an email to their users notifying them that their web hosting service is running.
1. Search and open the email.
2. The email contains information regarding your hosting account, login details, server details, etc. Scroll to the Login Details section of the email where you will find-
- Username – This is the username for your cPanel account.
- Password – This is the password for your cPanel account.
- Control Panel URL– You can directly access your cPanel account by clicking this URL. Usually, this link ends with a 4-digit number like “:2082/” in the screenshot.

Note: We recommend opening the URL link in a new tab/window and bookmark the URL.
3. Enter the login details for the cPanel as given in your email and click the Log in button.

The dashboard of your cPanel account will open.
How To Debug Node.js Applications?
Node.js is a highly robust, asynchronous and event-driven server-side Javascript technology. And, with Chrome Dev Tools, you can find errors in your code.
In this article, we will get to know the steps to debug your Node.js applications with the help of the debug module, the built-in Node debugger and Chrome’s developer tools.
Debugging the Node.js Application:
One of the best ways to detect issues in Node.js applications is the excessive usage of the console.log for debugging.
Check them below:
The debug module
The most popular modules that are required in your project come with a debug module. Using this module, you can enable the third part module, to log into the standard output, stdout.
To check whether a module is using it, double-check the package.json file’s dependency section.
For using the debug module, you need to set the DEBUG environment variable when you are starting your applications. You can even use the character to wildcard names.
The below line will print all the express-related logs to the standard output.
DEBUG=express* node app.js
You will see the output below:
Built-in Node.js Debugger
Node.js includes a fully-featured debugging utility that can be easily accessed through a TCP-based protocol and a built-in debugging client.
To start the built-in debugger, you need to start the application by entering the command given below:
node debug app.js
After you have entered this, you will get to see the output, as given below:
Descriptions of the Node.js Debugger:
c =continue to execute the code
n=execute this line and go to the next line
s= step into this function
o=finish function execution and step out
repl=allows code to be evaluated remotely
You can add breakpoints to the application by inserting the debugger statement into your codebase.
function add (a, b) {
debugger
return a + b
}
var res = add(‘abc’, 3)
The Watchers
You can watch the expressions and variables during the process of debugging. On each of the breakpoints, every expression from the watcher’s list will be evaluated in the present context and displayed immediately before the breakpoints source code listing.
To use the watchers, you need to define them for expressions you need to watch. To do so, you need to do it in the below way:
watch (‘expression’)
Now, to get a list of active watchers, type watchers, to unwatch an expression:
unwatch (‘expression’)
The Chrome Debugger
When you debug complex applications, visuals can help. It would be good to use the familiar UI of the Chrome DevTools for debugging the Node.js applications.
The best part is, the Chrome Debug protocol has been ported into the Node.js module and can be ideally used for debugging the Node.js applications. To do so, you need to first install the node-inspector:
npm install -g node-inspector
You can start debugging your applications by doing it in a below way:
node-debug index.js –debug-brk
It will extend the Chrome Developer tools, and you can start to debug your Node.js applications with it.
Conclusion
In this article, we have seen how to debug a remote application using Chrome DevTools. In the DevTools, you can see the variable changes and track bugs easily without printing to the console with the help of the watch variables and breakpoints.