How to enable Cloudflare with Railgun

A tutorial that will guide you about how to enable CloudFlare with Railgun for your website.

Cloudflare is a CDN that allows to enhance your website performance, speed and latency with the help of their distributed network across the globe!

Cloudflare offers a premium feature called as Railgun which helps improving the website load times, especially for dynamic websites such as WordPress devloped websites, Drupal, Joomla etc.

Railgun ensures that the connection between your origin server and the Cloudflare network is as fast as possible. It is a premium plugin from Cloudflare which is available as a paid feature. However, we at WebHostUK, being an exclusive Cloudflare partner, offer Railgun for free for websites hosted on our server.

Below tutorial will explain you how to enable Cloudflare with Railgun on our servers.


  • Once your order is processed and your account is enabled, you will gain cpanel access to your account, where Cloudflare tool is available under “Software” section as visible in below screenshot:

  • Click on Cloudflare and it will then redirect you to Cloudflare setup wizard

  • You can use any of your existing Cloudflare account or create a new one. If you already have an account with Cloudflare, then please make sure that the domain (for which you are intending to add Railgun) is not existing in your Cloudflare account. If it is so, kindly delete it from your Cloudflare.com portal login.

  • To integrate Cloudflare, you have two options:

i. Partial setup also known as CNAME setup of website with Cloudflare : In this setup, your domain will use our nameservers and the CNAME of “www” prefix of your domain will be resolving to Cloudflare alias domain name.

Pro’s of CNAME Cloudflare setup : DNS zones are configured on our server which means, you do not need to do any manual DNS changes for your domain or its MX records or subdomains. These DNS records are automatically configured in DNS zones on our servers.

Con’s of CNAME Cloudflare setup : Since only “www” prefix is configured with Cloudflare alias hostname, Cloudflare with Railgun for the respective website will only work if domain is accessed with www prefix. If the website is not accessed with www prefix, Railgun will not work. So you will have to force redirect your website to its www prefix using rules in .htaccess


ii. CloudFlare DNS Managed setup or full setup : In Cloudflare DNS managed setup, your domain will use Cloudflare nameservers which means all host records including “A”, “MX”, “NS”, “SPF”, “DKIM” etc are all hosted on Cloudflare servers. Cloudflare will control DNS for your domain and we no longer have any DNS control for your websites or its subdomains.

Pro’s of Cloudflare DNS managed setup: Cloudflare with Railgun will work for domain with or without “www” prefix. This eliminates the need of any such redirect of website from non-www url to www url

Con’s of Cloudflare DNS managed setup: Since Cloudflare will manage your DNS, you will need to manually add MX, SPF or DKIM records in Cloudflare DNS portal. Whenever you create any subdomain, its entry will also need to be manually added in Cloudflare DNS portal.


  • Once you have enabled Cloudflare for your domain using any of “cname or cloudflare dns managed setup” as explained above, you will now need to request for enabling Railgun for your domain. In order to request enabling “Railgun” for your domain, you will need to submit a request at : https://www.webhostuk.co.uk/railgun-request.php

Your submitted request will raise a support ticket under your account, and our 24/7 support team will then enable Railgun for your requested domain and update you via your support ticket.

How to check if Cloudflare with Railgun is working for your website?

To check if cloudflare with Railgun is working properly for your website, you need to take help of an extension plugin which is available for Google Chrome Browsesr : https://chrome.google.com/webstore/detail/claire/fgbpcgddpmjmamlibbaobboigaijnmkl

Cloudflare if sucessfully enabled for your website and when accessed in Chrome, will show “red” dot as seen in below image

How to order UK reseller hosting with free WHMCS and Private Nameservers

Our tutorial that will help you to start your own web hosting business with our UK reseller hosting plan.

Reseller Hosting Guide to help you order UK reseller web hosting from our website https://www.webhostuk.co.uk/reseller-hosting.html

WebHostUK offers white-labelled reseller hosting with free Private Nameservers, free WHMCS billing system (on selected plans), free ENOM reseller account and much more, with one of the best 24/7 support available via live chat and ticket helpdesk!

How to order reseller hosting with free WHMCS and private nameserves?

Our guide will help you start your own web hosting business in less than 10 minutes.

Reseller Hosting Setup Guide will help you with:
1) Choose and order a domain name for your web hosting business
2) Select your reseller hosting plan with us
3) Setup white-labelled private nameservers to represent your web hosting brand
4) Login to reseller WHM and setup your Web Hosting packages
5) Create your first customer under your reseller account.

If you need any more assistance while ordering our reseller hosting plans, please feel free to visit our website at https://www.webhostuk.co.uk and initiate a live chat with one of our 24/7 support engineer!

Install and Configure Django on a Linux Shared Hosting

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

  • Ridiculously fast – Django was designed to help developers take applications from concept to completion as quickly as possible.
  • Fully loaded – Django includes dozens of extras you can use to handle common Web development tasks. Django takes care of user authentication, content administration, site maps, RSS feeds, and many more tasks — right out of the box.
  • Reassuringly secure – Django takes security seriously and helps developers avoid many common security mistakes, such as SQL injection, cross-site scripting, cross-site request forgery and clickjacking. Its user authentication system provides a secure way to manage user accounts and passwords.
  • Exceedingly scalable – Some of the busiest sites on the planet use Django’s ability to quickly and flexibly scale to meet the heaviest traffic demands.
  • Incredibly versatile – Companies, organizations and governments have used Django to build all sorts of things — from content management systems to social networks to scientific computing platforms.

You will have a functioning Django site on your account that:

  • Loads a static homepage for the domain.
  • Loads the Django administration interface.
  • Uses a SQLite database.

Create A Python Application In cPanel

The Setup Python App feature allows you to deploy Python applications on your cPanel while running the Apache web server.

You can check the functionality by visiting the cPanel, Setup Python App.

Install and Configure Django

On the next page, you will be able to Create Application and check existing Web applications.

Install and Configure Django

After clicking Create Application you will be presented with the app creation menu:

If you wish to create a new Python application, you must specify the Python version, fill in the Application root, and the Application URL. Then click Create.

Optionally, you can also set up Application startup fileApplication Entry point and Passenger log file.

As soon as the environment is set, you can upload your application files to the application root directory.

When the application is created, you will be able to see the next page:

At the very start, you have the command necessary to enter your virtual environment. This is useful when you need to manually execute some commands either via SSH or with the terminal menu in cPanel.

To be able to do this, you need to enable Shell access as in this guide.

How to Configure the Django project

1) Login to cPanel.

2) You can see the option Terminal under the “ADVANCED” menu. Click the option to open the terminal.

3) If you are accessing the terminal for the first time, a screen will appear with a warning message. Please click on the button proceed.

4) This interface provides command line access to your account on the server. You can now manage the account using CLI

5) Use the command you noted in the above step to activate the virtual environment. For example:

# source /home/username/virtualenv/myapp/3.6/bin/activate

You need to replace username with your cPanel username

The command prompt now starts with (myapp:3.6) to indicate that you are working in the myapp virtual environment with Python 3.6. All of the following commands in this article assume that you are working in the Python virtual environment.

6) Type the below command to install Django:

# cd ~pip

# install django==2.1.8

You can verify the version of Django installed, with the following command:

# django-admin --version

7) Type the below command for creating a Django project:

# django-admin startproject myapp ~/myapp

8) To create directories for the static project files, type the following commands:

# mkdir -p ~/myapp/templates/static_pages 
# mkdir ~/myapp/static_files 
# mkdir ~/myapp/static_media

a. Find the ALLOWED_HOSTS line and then modify it as below. Replace example.com with your own domain name:

ALLOWED_HOSTS = [‘example.com’]

b. Find the TEMPLATES block, and then modify it as below:

TEMPLATES = [
{
‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,
‘DIRS’: [os.path.join(BASE_DIR,’templates’)],
‘APP_DIRS’: True,
‘OPTIONS’: {
‘context_processors’: [
‘django.template.context_processors.debug’,
‘django.template.context_processors.request’,
‘django.contrib.auth.context_processors.auth’,
‘django.contrib.messages.context_processors.messages’,
],
},
},
]

c. Locate the STATIC_URL line, and then add the below lines beneath it:

MEDIA_URL = ‘/media/’
MEDIA_ROOT = os.path.join(BASE_DIR, “static_media”)

STATIC_URL = ‘/static/’
STATIC_ROOT = os.path.join(BASE_DIR, ‘static_files’)

9) Open the ~/myapp/myapp/urls.py file using the text editor. Delete the existing text and copy the below text into the file:

from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url
from django.views.generic.base import TemplateView

urlpatterns = [
path(‘admin/’, admin.site.urls),
url(r’^$’, TemplateView.as_view(template_name=’static_pages/index.html’), name=’home’),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

10) Open the ~/myapp/passenger_wsgi.py file and do the following changes. Replace username with your own account username:

import myapp.wsgi
SCRIPT_NAME = '/home/username/myapp'

class PassengerPathInfoFix(object):
    """
    Sets PATH_INFO from REQUEST_URI because Passenger doesn't provide it.
    """
    def __init__(self, app):
        self.app = app

    def __call__(self, environ, start_response):
        from urllib.parse import unquote
        environ['SCRIPT_NAME'] = SCRIPT_NAME

        request_uri = unquote(environ['REQUEST_URI'])
        script_name = unquote(environ.get('SCRIPT_NAME', ''))
        offset = request_uri.startswith(script_name) and len(environ['SCRIPT_NAME']) or 0
        environ['PATH_INFO'] = request_uri[offset:].split('?', 1)[0]
        return self.app(environ, start_response)

application = myapp.wsgi.application
application = PassengerPathInfoFix(application)

11) Use a text editor to create a basic index.html file in the ~/myapp/templates/static_pages directory.

The file can be as simple as a text file that says Hello world.

12) Type the following command:

# python ~/myapp/manage.py migrate

13) Create and set up the superuser account:

  • For this, type the below command:

# python ~/myapp/manage.py createsuperuser

  • Type the administrator username at the Username prompt and then press Enter.
  • Type the administrator e-mail address at the Email address prompt and then press Enter.
  • Type the administrator password at the Password prompt and then press Enter.

14) To collect the static files, type the below commands:

# python ~/myapp/manage.py collectstatic

In case you are asked for overwriting existing files, type yes and then press Enter.

15) Restart the Python application in cPanel:

  • Log in to cPanel.
  • Click Setup Python App in the SOFTWARE section of the cPanel home screen.
  • Locate the correct application under the Existing applications and then click Restart.

16) Test the Django site:

  • Go to http://www.example.com, where example.com represents your domain name. The index.html file should load.
  • Go to http://www.example.com/admin, where example.com represents your domain name. The Django administration login page should be displayed. Use the superuser credentials that you created earlier to log in.

If there a problem for the website to appear in your browser, run the passenger_wsgi.py file manually. For this, type the below command:

# python ~/myapp/passenger_wsgi.py

When you run this file, you should get any text output to the console. In case there are any errors, check the syntax in the configuration files.

That’s all! Now, you can easily install and configure Django on a Linux shared hosting account.

Setup Python App

The Setup Python App feature allows you to deploy Python applications on your cPanel while running the Apache web server.

You can check the functionality by visiting the cPanel, Setup Python App.

Install and Configure Django

On the next page, you will be able to Create Application and check existing Web applications.

Install and Configure Django

After clicking Create Application you will be presented with the app creation menu:

If you wish to create a new Python application, you must specify the Python version, fill in the Application root, and the Application URL. Then click Create.

Optionally, you can also set up Application startup fileApplication Entry point and Passenger log file.

As soon as the environment is set, you can upload your application files to the application root directory.

When the application is created, you will be able to see the next page:

At the very start, you have the command necessary to enter your virtual environment. This is useful when you need to manually execute some commands either via SSH or with the terminal menu in cPanel.

To be able to do this, you need to enable Shell access as in this guide.

You can change options like Python version, Application root, Application URL, Application startup file, Application Entry point and Passenger log file here.
After changing such options, please make sure to click the Save button on the upper right.

The Python versions available are 2.7 and 3.3, 3.4, 3.5, 3.6 and 3.7.

PLEASE NOTE: Python version switch can take up to 5 minutes.

The Application startup file is to specify the Python WSGI application entry point. It must be specified as a filename.
Application Entry point is there to set up a WSGI callable object for the previously specified startup file.

With the help of the Configuration files field you can install various modules through Pip. Under the Add another file… field you can enter the name of the given module and click Add.

If you click Delete, the corresponding module entry will disappear. If you click Edit, you can change the module in question.

Once you have added the module, you can click Run Pip Install and install the module in question from the drop-down.

You can also execute pip install commands directly under the virtual environment via SSH.

Also, you can execute python script commands from the web interface (e.g. you can install packages from specific repositories or control web applications by means of django-admin).

You can additionally set up Environment variables:

Click Add Variable and you will be able to set up Name and Value of the variable in question. After you have entered the correct data, click Done to create the variable.

NOTE: Changes will not be applied to the application environment until the Update button is clicked. All changes can be reverted by clicking the Reset button.

You also have the options to Stop App and Restart the application.

To delete the application, click Destroy. The application folder itself will remain unmoved.

Dealing with WSGI application issues

In some cases, apps may not run properly when the main application variable is called app. This is because WSGI software that we use to run Python on our servers requires the main application variable to be called application.

We will use the Flask application as an example here to make the application work:

1. Install Flask and all the other modules required for the app. It can be done in many ways:

  • Install modules manually one by one over SSH

This can be done using the standard Run Pip Install button described in this guide, or via SSH using pip install module command.

  • Install all the modules at a time with a requirements.txt file.

It can be done with the following type of command via SSH:pip install -r requirements.txt

  • Install all the modules with a setup.py file via SSH, if it is created for the application,. The usage of this option depends on the app in question.

2. Remove the default passenger_wsgi.py file under the application root folder.
3. Find the main script of the application in the application root folder. Search for the following line to find it:
from app import app
(it can be from src import app or from app import application, however from app import app is the most common way to write it). The main script is usually called app.py, main.py, index.py, or init.py.
4. Rename this script to passenger_wsgi.py or set it in the Application startup file field within the Python App interface in cPanel.
5. Right below the import line (from app import app), insert this line:
application = app

The described actions should help fix an application that was not written with WSGI software in mind.

What is Entry Process Limit – Shared Hosting

An Entry Process is the number of PHP scripts you can run at a time. Our Shared Hosting and WordPress hosting plans have limitation of entry process at a time.

Number of visitors on website – An Entry Process should not be confused with the number of visitors you can have on your website as it takes just fractions of a second to complete. 

For Eg. if we have restrict 25 entry processes that doesn’t mean that only 25 people can visit your website at a time. It’s because there is very rare possibility of 25 people browsing your website at the same fraction of a second.

When a visitor browses any web page of your website, the web server would start serving the request. While this request is being served, it will use one entry process.

Once this request has been served, the web server would no longer use an entry process and the entry process count would get decreased by 1.

Please note that cron jobs, shell scripts and other commands also use entry process for the duration of the time they are running.

Why such restrictions – Entry process limitations to ensure that no single user consumes all server resources and to prevent DDoS attacks against the web server.

Entry process will limit the number of concurrent connections to web server, thus preventing our server against malicious traffic.

When you use all allotted entry processes (25), new visitors would experience a 508 error.

Install PmWiki using Softaculous

PmWiki - Wikipedia

1. Log in to cPanel Account.

2. Search for Softaculous Apps Installer , click on it the Softaculous installer page appears.

3. In the Search text box, type pmwiki and then press Enter.

4. Click Install.

5. In the Choose Protocol list box, select the protocol.

If you website have a SSL certificate installed , select https:// or https://www. If not have SSL installed , select http:// or http://www.

6. In the Choose Domain list box, select the domain for installation.

7. In the In Directory text box, type the directory where you want to install the application. If you want your domain name to go directly to the application leave it blank.

8. In the Wiki Name text box, type the name of the wiki.

9. In the Admin Password text box, type the administrator password which you wish to set. Make sure that you have enter a strong password.

10. Click the + (plus) icon to expand Advanced Options.

11. If you do not want email notifications when application updates are available, select the Disable Update Notifications check box. We strongly recommends that you receive email notifications when updates are available.

12. To automatically update the application when updates are available, select the Upgrade to any latest version available (Major as well as Minor) option.

13. In the Backup Location list box, select a backup location.

14. In the Automated backups , select whether or not Softaculous makes periodicbackups.

15. To receive site configuration information after the installation is complete, type an email address in the Email installation details to text box.

16. Click Install. When installation is complete, Softaculous provides information about the application configuration.

How to Establish FTP Connection

1. While connecting to your hosting account, you will need FTP login details. 

2. Your main/default FTP account login details are the same as your cPanel username and password.

3. You will need the following details to connect to your account via FTP :

  • FTP Hostname – Use the hosting server name. 
  • FTP Username – Default FTP username is same as your cPanel username.
  • FTP Password – Use your cPanel password.
  • FTP port – Default FTP port is 21.

4. Further, you can also create new FTP users in cPanel >> FTP Accounts.

5. Fill the user and password which you want to sent and click on “Create FTP Account”.

How TO Install wkhtmltopdf on Centos 6

Install fonts, then icu, then the CentOS 6 RPM for wkhtmltopdf, then x11-server and urw-fonts!  

# yum install -y xorg-x11-fonts-75dpi
# yum install -y xorg-x11-fonts-Type1

# yum install icu

# wget  https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm
# rpm -Uvh wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm

# cd ~website

# yum install xorg-x11-server-Xvfb.x86_64
# yum install urw-fonts

export DISPLAY=:0
export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb

# xvfb-run wkhtmltopdf http://www.google.com.ph google.pdf

What is cPanel

What is CPanel
What is CPanel

cPanel on Linux Server is a web based control panel tool which helps to manage web hosting account through a web interface instead of a console. With cPanel we are able to accomplish our tasks faster and even non-professionals can easily manage websites via cPanel.

Mail

To create email accounts, forwarders, and autoresponders as well as account and user-level filtering to manage email.

Fight spam with BoxTrapper, Apache SpamAssassin, and email authentication.

Then, use mailing lists to broadcast your message.

Allow email account suspension and password verification.

Domains

Yo can setup subdomains, addon domains, domains Alias (parked ), and redirects.

Identify your site with Simple DNS Zone Editor and Advanced DNS Zone Editor.

Databases

Store large amounts of data and limit access using MySQL  databases.

Files

Edit and back up files and folders while monitoring your website’s disk space usage.

Security

Configure password-protected directories, IP address denials, SSL/TLS, and GnuPG key settings to restrict access. Protect your site with HotLink Protection, Leech Protect, and ModSecurity.

Apps Galore

Take advantage of third-party software for blogs, eCommerce, bulletin boards, guest books and more to build a robust, dynamic site.

Logs

Know your audience and track your website’s performance using Webalizer and AWStats.

Crons

Allows you to run a certain command at times set by the job. For example, you could set a cron job to delete temporary files every week so that your disk space is not being used up by those files.

cPanel empower you and offer the ability to administer every facet of their website using simple, point-and-click software.

How to  start?

Shared web hosting is one of the most affordable and economical options to host your website. If you would like to use cPanel to manage your Website, Our Linux cPanel web hosting We offers Professional Web Hosting with a wide range of plans to choose from Linux cPanel hosting, designed to deliver extremely fast web hosting for your website, ensuring reliability, security and quality at the most affordable price.

Backup with cPanel expert support team round the clock and free  one-click installation scripts for all popular application software’s such as WordPress, Joomla, Drupal, Magento, b2evolution etc, Free website file and database transfer.