How to Reboot Dedicated Server login to WHM

The recommended option is Graceful Reboot. This way the reboot will be queued, and when all services are stopped the server will be restarted. Occasionally, rebooting server can be useful for installations or configuration changes. However, it is not recommended that to performed server reboot frequently as this can cause more harm than good.

But in some crucial situations, reboot  can be perform for dedicated or VPS server with the following easy steps in WHM.

Login to , to perform Graceful Server Reboot.

Server reboot

Search for Server Reboot option

Reboot Server through WHM

Choose the option “Graceful Server Reboot

Reboot Server through WHM

Click on “Proceed” to initiate the reboot process.

Now, you have initiated the rebooting process for your VPS  / dedicated server and it will start working normally after reboot is completed. If you are still facing any issue, you can contact support team for more help.

Posted in Web Hosting | Tagged , | Comments Off on How to Reboot Dedicated Server login to WHM

How to Create a Subdomain

Create a Subdomain

To create a Subdomain, you need to Login to cPanel, click on Subdomain under Domains section. 

Enter the desired prefix in the Subdomain text box.

Select the desired main domain from the menu.

Create Subdomain

Enter the home directory for the subdomain in the Document Root text box.

Click Create.

Note: home directory for the subdomain contains the files that pertain to the subdomain.

Posted in Web Hosting | Tagged , | Comments Off on How to Create a Subdomain

How to Create an Add-on Domain in cPanel

What is Addon domain.

The Addon domains allow you to control multiple domains from your single account. An addon domain links as a new domain name to a sub directory of your account’s public_html (document root) directory, and then stores its files in that sub directory. This means that you can host additional domains in your account.

You can give an addon domain email addresses, forwarders, and more the same way as a primary (main) domain on the account.

Create an addon domain.

To create an addon domain, perform the following steps:

Login to cPanel, under DOMAINS section, click on Addon Domains

Enter the new addon domain’s name in the New Domain Name text box.

Create Addon Domain

Enter the directory that you wish to contain the addon domain’s files in the document root text box.

Note:- When you enter the domain name, cPanel automatically populates the Subdomain or FTP Username text box. To create multiple addon domains with the same username and different extensions (such as addon.com and addon.net), manually enter a unique username in the Subdomain or FTP Username text box.

Create Addon Domain

Click on Password Generator, select I have copied this password in a safe place, Click on Use Password. 

And Click on Add Domain.

Now that your addon domain name has been added to your cPanel you can go to that folder and upload your web site files. Once the propagation takes place your web site files and emails for your addon domain name will be live on the internet.

Posted in Web Hosting | Tagged , , | Comments Off on How to Create an Add-on Domain in cPanel

How to Modify Hosts File on server

Minor changes to your hosts file allows us to override the DNS for a domain, on that your local machine and is useful while you want to test your site without the temporary / test link, prior to going live site with SSL; verify that an alias site works, prior to DNS changes; and for other DNS-related reasons.

Changed to hosts file causes your local machine only to look directly at the IP address specified.  You will have to add two entries to hosts file that contain the IP address that you want the site to resolve to and the address.

The hosts file is a plain text file, and is usually named hosts. A hosts file will have one or more lines referencing your local computer (localhost) and will resemble this:-

127.0.0.1 localhost

Adding the following two lines,  for example, point www.testhosts.com and testhosts.com  (change the IP )

  • 192.168.124.125 www.testhosts.com
  • 192.168.124.125  testhosts.com

The article provide instructions for locating and editing the hosts file on the operating systems listed below:-

  • Windows 10, Windows 8.1, Windows 7, and Windows Vista
  • Windows NT, Windows 2000, and Windows XP
  • Linux

After you enter information and save the file, your system begins resolving to the specified IP address. After testing is finished, remove these entries.

Windows 10 and 8.1

Open the command prompt as administrator.

Search ‘cmd’ on Windows 10 or 8.1 and right click on the Command Prompt and select ‘Run as administrator’.

Edit hosts

On the opened command prompt, type ‘cd drivers‘ ENTER then ‘cd etc‘ ENTER as shown below. This is to go to the location where the host file is located.

Edit Hosts

Make sure you are in the correct folder path, it should be C:\Windows\System32\Drivers\etc. Type ‘notepad hosts’ to open the hosts file in notepad.

Edit Hosts

We assume that you know the content of the file. Type the IP address of the domain/host name you want to give, then name. You can see the examples in same file.

Edit Hosts

Once you have modified the file with appropriate settings, click Save from File menu. That’s it, we have successfully modified the hosts file in Windows 10/8.1 now.

Method II

If you are not good in using command prompt, then this method will be handy in editing the hosts file in GU interface.

Open the location of hosts file, it’s under C:\Windows\System32\Drivers\etc. Once you have located the file right click on it and open with notepad.

Edit Hosts

Make the necessary changes to the file.

Edit Hosts

And click Save on the File menu.

Windows 7 and Windows Vista

Click Start  Start button , click All Programs, click Accessories, right-click Notepad, and then click Run as administrator.

 User Account Control permission If you are prompted for an administrator password or for a confirmation, type the password, or click Allow or Yes.

Open the Hosts file,  make the necessary changes, and then click Save on the Edit menu. If using Windows 7, you will need to click Save on the File menu.

Windows NT, Windows 2000, and Windows XP

Open the file located at C:\Windows\System32\Drivers\etc\hosts

Click Start, click All Programs, click Accessories, right-click Notepad,

Make the necessary changes to the file.

And click Save on the File menu.

Linux 

Open the Terminal Window.
Open the hosts file in a text editor (you can use any text editor)

vi /etc/hosts

Enter domain user password.
Make the necessary changes to the file.
Save the file.

Posted in Web Hosting | Tagged , , , , , , , | Comments Off on How to Modify Hosts File on server

How to Change Hostname For cPanel & WHM version 56

In computer networking, your hostname is used as a label by which to identify your physical server.

To change the server’s hostname, you should  use one of the following methods:

Enter your hostname in the Setup Networking section of WHM’s Initial Setup Wizard interface.

Login to WHM Change Host name interface

(Home >> Networking Setup >> Change Hostname).

Call WHM API 1’s sethostname function.

Run the /usr/local/cpanel/bin/set_hostname utility as the root user.

Hostname Should meet the below requirements:

A fully qualified domain name

Registered with a registrar.

 Follows the instructions in the Instructions section.

Perform the below details to change your Host name

  1. Enter your hostname into the New Hostname text box.
  2. Click Change. A popup window will appear that prompts you to add an A entry.
  3. Click Add An A Entry for your hostname.
  4. Review the information about your server and, if it is correct, click Add Entry.

System will automatically configure the hostname and Also add the correct A entry for hostname.

Note:-

  • Don’t use socially-unacceptable hostname, as hostname will appear in mail headers.
  • Only use lowercase, Latin-script letters in hostnames.
Posted in Web Hosting | Tagged , , | Comments Off on How to Change Hostname For cPanel & WHM version 56

AutoConfig and Autodiscover

AutoConfig and Autodiscover

About AutoConfig and Autodiscover

By default, cPanel automatically creates AutoConfig and Autodiscover DNS records for your domain.

AutoConfig (AutoConfigure) and Autodiscover services quickly and easily configure a user’s mail client to receive their cPanel email.

AutoConfig and Autodiscover are web services that are used by a growing number of applications and which help in configuring your mobile devices and desktop clients.

Autodiscover is used by Outlook and all mobile devices including iPhone, iPod, iPad and Android devices while Autoconfig is used by Thunderbird. All communication is configured to be secured through SSL by default.

How to enable AutoConfig and Autodiscover, perform the following steps:

Login to WHM,  navigate to Home >> Server Configuration >> Tweak Settings >> Domains.

Find the Proxy sub-domains setting and select On.

Find the Thunderbird and Outlook AutoConfig and Autodiscover support (enables proxy sub-domain and SRV record creation) setting and select On.

Save it.

Use AutoConfig and Autodiscover

Enter your email address and password into your mail client, and the appropriate service will handle the rest.

Posted in Web Hosting | Comments Off on AutoConfig and Autodiscover

How to Enable MySQL Slow Query Log

Enable MySQL Slow Query Log

Enable MySQL Slow Query Log

Getting MySQL queries right is very important for the performance of Web application. similarly, getting indexes on the right columns in the right tables make difference between queries that take fractions of a second and queries that can take upwards of 10 seconds.

SSH server and create the MySQL log directory and slow log file:

mkdir /var/log/mysql
touch /var/log/mysql/server1-slow.log
chown mysql.mysql -R /var/log/mysql

Log in to the MySQL CLI via

mysql

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 633645
Server version: 5.5.49-cll MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

Set the log-file location for the Slow Query log.

mysql> SET GLOBAL slow_query_log_file = ‘/var/log/mysql/server1-slow.log’;

Determine what makes a query “slow”, by setting the limit (in seconds) after which a query is logged to the slow query log. I’ve setup logs every query that exceeds 10 seconds in duration.

mysql> SET GLOBAL long_query_time = 10;

Now enable the Slow Query log.

mysql> SET GLOBAL slow_query_log = ‘ON’;
mysql> FLUSH LOGS;

You can also make all queries that do not use indexes be logged to the same Slow Query log.

mysql> SET GLOBAL log_queries_not_using_indexes = ‘YES’;

If you want to make these changes persistent, modify the my.cnf and add these lines to the [mysqld] part of the config.

[mysqld]

slow_query_log = /var/log/mysql/server1-slow.log
long_query_time = 10
log_queries_not_using_indexes = YES

Note: This will also work for MariaDB or Percona’s version of MySQL.

To check its setup correctly, request the running parameters from MySQL.

mysql> SHOW GLOBAL VARIABLES LIKE ‘log_queries_not_using_indexes’;

mysql> SHOW GLOBAL VARIABLES LIKE ‘log_queries_not_using_indexes’;
+——————————-+——-+
| Variable_name | Value |
+——————————-+——-+
| log_queries_not_using_indexes | ON |
+——————————-+——-+
1 row in set (0.00 sec)

mysql> SHOW GLOBAL VARIABLES LIKE ‘slow\_%’;

mysql> show global variables like ‘%slow%’;
+———————+———————————+
| Variable_name | Value |
+———————+———————————+
| log_slow_queries | ON |
| slow_launch_time | 2 |
| slow_query_log | ON |
| slow_query_log_file | /var/log/mysql/server1-slow.log |
+———————+———————————+
4 rows in set (0.00 sec)

mysql> SHOW GLOBAL VARIABLES LIKE ‘long_query_time’;

mysql> SHOW GLOBAL VARIABLES LIKE ‘long_query_time’;
+—————–+———–+
| Variable_name | Value |
+—————–+———–+
| long_query_time | 10.000000 |
+—————–+———–+
1 row in set (0.00 sec)

Don’t forget to disable it or enable logrotate to prevent the logs files from growing too large.

Use the following at the CLI, to disable the logging, but leave the rest of the requested configs intact.

mysql> SET GLOBAL slow_query_log = ‘OFF’;
mysql> FLUSH LOGS;

To disable it permanently in the my.cnf file, set the slow_query_log to 0.

[mysqld]

slow_query_log = 0
long_query_time = 10
log_queries_not_using_indexes = YES

Posted in Web Hosting | Tagged , | Comments Off on How to Enable MySQL Slow Query Log

Install WordPress, Nginx, PHP FPM and MariaDB on Ubuntu

Install WordPress, Nginx, PHP FPM and MariaDB on Ubuntu

Install WordPress, Nginx, PHP FPM and MariaDB on Ubuntu

You need install and configure Nginx first.

sudo apt-get update
sudo apt-get install nginx

Add below to /etc/nginx/sites-enabled/yourdomain.conf, replacing webhosting.com with yourdomain.conf

server {
listen *:80;
server_name webhosting.com www.webhosting.com;

# Define default caching of 24h
expires 86400s;
add_header Pragma public;
add_header Cache-Control “max-age=86400, public, must-revalidate, proxy-revalidate”;

# deliver a static 404
error_page 404 /404.html;
location /404.html {
internal;
}

# Deliver 404 instead of 403 “Forbidden”
error_page 403 = 404;

# Do not allow access to files giving away your WordPress version
location ~ /(\.|wp-config.php|readme.html|licence.txt) {
return 404;
}

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

# Don’t log robots.txt requests
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

# Rewrite for versioned CSS+JS via filemtime
location ~* ^.+\.(css|js)$ {
rewrite ^(.+)\.(\d+)\.(css|js)$ $1.$3 last;
expires 31536000s;
access_log off;
log_not_found off;
add_header Pragma public;
add_header Cache-Control “max-age=31536000, public”;
}

# Aggressive caching for static files
# If you alter static files often, please use
# add_header Cache-Control “max-age=31536000, public, must-revalidate, proxy-revalidate”;
#location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|
#gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|
#mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|
#ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|
#wri|xla|xls|xlsx|xlt|xlw|zip)$ {
# expires 31536000s;
# access_log off;
# log_not_found off;
#add_header Pragma public;
#add_header Cache-Control “max-age=31536000, public”;
#}
error_log /var/log/nginx/webhosting.com-error.log;
access_log /var/log/nginx/webhosting.com-access.log;

root /home/wordpress-user/webhosting.com;
location / {
index index.php index.html index.htm;
}

# get friendly url links working
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}

# pass all PHP files through php-fpm
location ~ \.php$ {

try_files $uri =404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/wordpress-user/webhosting.com$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}

# deny all apache .htaccess or .htpasswd files
location ~ /\.ht
{
deny all;
}
# Deny access to hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}

Now you need to reset the Nginx service.

sudo service nginx restart

Now we need to install PHP, PHP-FPM, PHP-GN and PHP MySQL drivers. PHP-GD is for image cropping and rotating to work.

sudo  apt get install php5-fpm php5 php5-mysql php5-gd

Next configure PHP-FPM to serve your website.

cp /etc/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/yourdomain.conf

Add user,  Modify the following parameters in /etc/php5/fpm/pool.d/yourdomain.conf

useradd -s /sbin/nologin usern@me
vim /etc/php5/fpm/pool.d/yoursite.conf

; Add a pool name to identify your site’.
[wordpress]

;Modify the port for PHP-FPM to listen on
listen = 127.0.0.1:9001

;Add the user we created earlier
user = usern@me
group = usern@me

You should restart PHP-FPM

sudo service php-fpm restart

Installing MariaDB adding it’s repository

sudo apt-get install software-properties-common
sudo apt-key adv –recv-keys –keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository ‘deb [arch=amd64,i386] http://mirror.fibergrid.in/mariadbrepo/10.1/ubuntu trusty main’
sudo apt-get update
sudo apt-get install mariadb-server

Set a root password database server. Once set login and create a wordpress user and database.

mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER wordpress-user@localhost IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON wordpress.* TO wordpress-user@localhost;
FLUSH PRIVILEGES;
exit

You are set to download and Install WordPress now.

cd /tmp
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
sudo mv wordpress /home/usern@me/
sudo chown -R usern@me:usern@me /home/usern@me/wordpress

Done, you should be able to browse WordPress site on yourdoamin.com (Replace yourdomain.com with your domain name.)

Source and Referencing : https://github.com/Leo-G/

Posted in Web Hosting | Tagged , , , | Comments Off on Install WordPress, Nginx, PHP FPM and MariaDB on Ubuntu

Difference Between IMAP and POP3

email-Server

email-Server

Difference between IMAP and POP3 and for how long they store mails on the mail server.

IMAP (Internet Message Access Protocol)

Using IMAP, mail server permanently stores the messages. This means that you can access them through any computer as long as you have the correct login details.

Also, unless you use a mail client that synchronizes folders and caches messages, IMAP requires a constant connection while you read email.

This method is more convenient than POP3, it generally requires more dedicated disk space than POP3 because users tend not to delete old email.

However, if  you monitor disk usage and delete old messages when necessary, IMAP is still viable on a mail server with limited resources.

Users and web host generally prefer IMAP due to its convenience. Carefully consider system’s available resources before you choose a courier.

POP (Post Office Protocol)

Using  POP3,  mail server deletes messages when you download them. That means that you can only access messages from the computer that you used to download them.

POP3 don’t require constant connection while you read email.

This system conserves your mail server’s disk resources, it limits how your users can access their email.

Posted in Email | Tagged , , , , , | Comments Off on Difference Between IMAP and POP3

How to Restrict Access WordPress Site

How to Restrict Access WordPress Site

If you need to redirect restricted access for your site to visitors who are logged in or accessing the site from a set of specified IP addresses

I do not often recommend to use of plugins,the Restricted Site Access plugin can be very helpful in limiting access to your WordPress site.

How to Install Restricted Site Access Plugin on your WordPress site:

Login to WordPress Dashboard via http://wordpresssite.com/wp-admin.php or http://wordpresssite.com/wp-login.php (replace wordpresssite.com with your actual domain name).

Click On Plugins >>  Add New.

Search “Restricted Site Access” and click Search Plugins.

Click Install Now >> OK

Activate the plugin through the ‘Plugins’ menu in WordPress

Configure the plugin

Go to Plugins >> Installed Plugins.

Search for Restricted Site Access plugin and click Settings.

In the Site Visibility section, click Restrict site access to visitors who are logged in or allowed by IP address.

In the Handle Restricted Visitors section, click on the action of your choice.

In the Unrestricted IP Addresses section, add any IP addresses that are allowed to have unrestricted access to your WordPress site. This should include your developers and/or website designers.

Click Add My Current IP Address. This will ensure that you to have unrestricted access to your site.

Click Save Changes.

 

Posted in Web Hosting, Wordpress Web Hosting | Tagged , , | Comments Off on How to Restrict Access WordPress Site