cPanel web hosting

Featured

cPanel Webhosting.

cPanel is most user friendly panel in web hosting. Most of the shared hosting provider , reseller, dedicated & cloud server use this panel to manage client’s site or their own site. Most important feature of cPanel is it provide lots of features like. Create email accounts, setting filters, forwarders, FTP accounts , Password protect folders etc…

For hosting provider it is very important to manage and monitor activities going on their server especially on shared server. Main advantage of shared hosting server is you can host lots of sites and oversell resources.

What is overselling. Suppose you have server with 16 CPUs, 300 GB disk, 10 TB (10240 GB) bandwidth and 32 GB RAM. Such server will cost provide around $200 per month. Here hosting provider will provide client basic plan like: 10 GB , and 100 GB bandwidth for $2. He would able to host such 500 Clients on his cPanel server because most of the client ie. 90% will not use even 10 GB bandwidth and 1 GB disk space while hosting a site. Also most of sites will have very low traffic in such case they will not be using even 1% of server’s total resources.

In this way shared hosting server would able to make $1000 per server costing him $200 including cPanel license.

I will write few more post about Web hosting business. Feel free to raise any question either technical or non-technical in comment or contact us form. I would glad to assist free of cost.

Install memcache on cpanel

How to install memcached on cpanel server.

1: Login to WHM > Software > Easyapache 4 > “Currently Installed Packages” > Customize > Apache module > search using memcache > install this if it is not.

2: Login to server via ssh as root user and execute following command.

yum install memcached.x86_64 -y

3: Then WHM > Software > Module Installers > PHP Pecl, search for memcache this will list both memcache and memcached, install both.

4: Restart service apache.

5: Now start memcached by executing command

memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody

6: Verify if it is working by executing command :  systemctl start memcached

7: Enable memcached so whenever server will reboot service will get start automatically.

systemctl enable memcached

8: Check memcached status using command.

systemctl status memcached

Output should be like:

* memcached.service – Memcached
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2018-11-05 18:38:46 -05; 7s ago
Main PID: 47657 (memcached)
CGroup: /system.slice/memcached.service
`-47657 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024

Nov 05 18:38:46 server.listitjamaica.com systemd[1]: Started Memcached.
Nov 05 18:38:46 server.listitjamaica.com systemd[1]: Starting Memcached…

Now you shall able to use memcached  in your applications.

 

Deleting files using find

We will learn how to delete files using command find from given folder.

Suppose you want to delete .png files from /home/directory.

Use following command

find /home/directory/ \( -name "*.png" \) -type f -exec rm {} +

This will delete file with extension .png from /home/directory and sub directories of /home/directory like *.png files from /home/directory/directory2/ as well .

But suppose if you need to delete .png files only from directory /home/directory and not from sub directories then use following command.

find /home/directory/ -maxdepth 1  \( -name "*.png" \) -type f -exec rm {} +

Install MongoDB on Ubuntu 18.04

How Install MongoDB on Ubuntu 18.04..

What is MongoDB ?

MongoDB is a free and open-source NoSQL document database which uses JSON-like documents with schemata. It means fields can vary from document to document and data structure can be changed over time.

In this tutorial we will learn how to install MongoDB, manage MongoDB service, and enable remote access.

First we will update package list so we will have more recent repository version listing.

Command to update package list on Ubuntu 18.04 is

apt update

Now install MongoDB using command

apt install mongodb -y

This command will install latest version of mongodb on your server along with management tools required for mongodb server.

Let’s check status of mongodb service installed using command

systemctl status mongodb

If you see active running then it is up and running.

We will execute further command to connect mongodb server

mongo --eval 'db.runCommand({ connectionStatus: 1 })'

Above command will provide version of mongodb server as output.

Output should be like:

MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.3
{
        "authInfo" : {
                "authenticatedUsers" : [ ],
                "authenticatedUserRoles" : [ ]
        },
        "ok" : 1
}

Here ok: 1 means service mongodb is ready to use.

Below are command to start, stop, restart.

systemctl start mongodb

systemctl stop mongodb

systemctl restart mongodb

By default it is enabled for onboot start. Command to disable/enable ie. to disable automatic start on server boot is

systemctl disable mongodb

To enable automatic start of mongodb server on server boot is

systemctl enable mongodb

Port used by mongodb server is 27017. You need to open this port in firewall if you want to allow access to this server from remote server.

Once you open port you will need to define IP of remote server in mongodb configuration.

vi /etc/mongodb.conf

find line starting with word bind_ip and then add all remote server IPs and separate them by comma for example to allow IPs 10.0.0.1 and 10.0.0.2.

Change line
bind_ip = 127.0.0.1
To
bind_ip = 127.0.0.1, 10.0.0.1, 10.0.0.2

Save file and restart mongodb service.

systemctl restart mongodb.