×


Category: Server Management Service


Boost performance of Websites using Cloudflare - Tips to implement it

This article covers how to improve the performance of Websites using Cloudflare. Website speed has a huge impact on user experience, SEO, and conversion rates. Improving website performance is essential for drawing traffic to a website and keeping site visitors engaged. 

Along with the caching and CDN, Cloudflare helps protect your site against brute-force attacks and threats against your website.

Cloudflare has the advantage of serving million of websites and so can identify malicious bots and users more easily than any operating system firewall.


CDNs boost the speed of websites by caching content in multiple locations around the world. CDN caching servers are typically located closer to end users than the host, or origin server. Requests for content go to a CDN server instead of all the way to the hosting server, which may be thousands of miles and across multiple autonomous networks from the user. Using a CDN can result in a massive decrease in page load times.


How to get started on optimizing website performance with Cloudfare CDN (content delivery network)?

1. Optimize images

Images comprise a large percentage of Internet traffic, and they often take the longest to load on a website since image files tend to be larger in size than HTML and CSS files. Luckily, image load time can be reduced via image optimization. Optimizing images typically involves reducing the resolution, compressing the files, and reducing their dimensions, and many image optimizers and image compressors are available for free online.

2. Minify CSS and JavaScript files

Minifying code means removing anything that a computer doesn't need in order to understand and carry out the code, including code comments, whitespace, and unnecessary semicolons. This makes CSS and JavaScript files slightly smaller so that they load faster in the browser and take up less bandwidth.

3. Reduce the number of HTTP requests if possible

Most webpages will require browsers to make multiple HTTP requests for various assets on the page, including images, scripts, and CSS files. In fact many webpages will require dozens of these requests. Each request results in a round trip to and from the server hosting the resource, which can add to the overall load time for a webpage. 

4. Use browser HTTP caching

The browser cache is a temporary storage location where browsers save copies of static files so that they can load recently visited webpages much more quickly, instead of needing to request the same content over and over. Developers can instruct browsers to cache elements of a webpage that will not change often. Instructions for browser caching go in the headers of HTTP responses from the hosting server.

5. Minimize the inclusion of external scripts

Any scripted webpage elements that are loaded from somewhere else, such as external commenting systems, CTA buttons, or lead-generation popups, need to be loaded each time a page loads.

6. Don't use redirects, if possible

A redirect is when visitors to one webpage get forwarded to a different page instead. Redirects add a few fractions of a second, or sometimes even whole seconds, to page load time


Event Data getting Stale in Nagios - Resolve it Now

This article covers methods to fix Event Data getting Stale in Nagios. Basically, you will see the causes for event data getting stale in Nagios. There is a known bug relating to event data in versions 2009R1.4B-2011R1.1.

This bug has been patched and will be available in releases later than the versions posted above, but if you're experiencing this error, and/or the nagios service is taking an excessively long time to start, you may have a corrupted mysql table that needs repair.


To fix this Nagios error:

1. Stop the following services:

$ service nagios stop
$ service ndo2db stop
$ service mysqld stop

2. Run the repair script for mysql tables:

/usr/local/nagiosxi/scripts/repairmysql.sh nagios

3. Unzip and copy the the following dbmaint file to /usr/local/nagiosxi/cron/. This will overwrite the previous version.

$ cd /tmp
$ wget http://assets.nagios.com/downloads/nagiosxi/patches/dbmaint.zip
$ unzip dbmaint.zip
$ chmod +x dbmaint.php
$ cp dbmaint.php /usr/local/nagiosxi/cron


Delete Repository And GPG Key On Ubuntu Systems

This article covers steps to delete the repository and GPG Key On Ubuntu. All packages are signed with a pair of keys consisting of a private key and a public key, by the package maintainer.

A user's private key is kept secret and the public key may be given to anyone the user wants to communicate.

Whenever you add a new repository to your system, you must also add a repository key so that the APT Package Manager trusts the newly added repository.

Once you've added the repository keys, you can make sure you get the packages from the correct source.


To remove Repository keys:

You can remove the repository key if it is no longer needed or if the repository has already been removed from the system.

It can be deleted by entering the full key with quotes as follows (which has a hex value of 40 characters):

$ sudo apt-key del "D320 D0C3 0B02 E64C 5B2B B274 3766 2239 8999 3A70"
OK

Alternatively, you can delete a key by entering only the last 8 characters:

$ sudo apt-key del 89993A70
OK

Once you have removed the repository key, run the apt command to refresh the repository index:

$ sudo apt update

You can verify that the above GPG key has been removed by running the following command:

$ sudo apt-key list


Guest unable to reach host using macvtap interface - Fix it Now

This article covers how to fix the issue with guests unable to reach the host using macvtap interface.

This issue happens when A guest virtual machine can communicate with other guests, but cannot connect to the host machine after being configured to use a macvtap (also known as type='direct') network interface.


To resolve this error (guests unable to reach the host using macvtap interface), simply create an isolated network with libvirt:

1. Add and save the following XML in the /tmp/isolated.xml file. If the 192.168.254.0/24 network is already in use elsewhere on your network, you can choose a different network.

<network>

  <name>isolated</name>

  <ip address='192.168.254.1' netmask='255.255.255.0'>

    <dhcp>

      <range start='192.168.254.2' end='192.168.254.254' />

    </dhcp>

  </ip>

</network>

2. Create the network with this command: virsh net-define /tmp/isolated.xml

3. Set the network to autostart with the virsh net-autostart isolated command.

4. Start the network with the virsh net-start isolated command.

5. Using virsh edit name_of_guest, edit the configuration of each guest that uses macvtap for its network connection and add a new <interface> in the <devices> section similar to the following (note the <model type='virtio'/> line is optional to include):

<interface type='network'>

  <source network='isolated'/>

  <model type='virtio'/>

</interface>

6. Shut down, then restart each of these guests.

Since this new network is isolated to only the host and guests, all other communication from the guests will use the macvtap interface.


Listen on Privileged Ports with Nagios Log Servers - How to set it up

This article covers how to configure Nagios Log Servers to listen on privileged ports. Now Nagios Log Server Administrators who would like configure Nagios Log Server to listen on ports below 1024 which are privileged in Linux. This can be useful if you have legacy devices that can only send on specific ports (e.g. syslog on port 514).

Ports below 1024 are privileged on Linux and only allow the root user to listen on them. 

This can be implemented via two solutions:

1. Run Logstash as root

2. Use setcap


To use Use setcap for Listening On Privileged Ports:

Here, you can use the logstash running as the nagios user but this method may be less secure in some environments as it will allow any Java process to listen on privileged ports.

i. The logstash init configuration file requires three lines to be added to the end of it, open the file with the following command:

On Debian | Ubuntu:

$ vi /etc/default/logstash

or

$ sudo /etc/default/logstash

2. Then, Add the following three lines to the end of the file:

echo $(dirname $(find /usr/lib -name libjli.so)) | awk '{print $1}'> /etc/ld.so.conf.d/java.conf

eval "$(which ldconfig)"

setcap 'cap_net_bind_service=+ep' $(readlink -f $(which java))

3. Save the file and close vi.

4. Restart Logstash Service

The logstash service needs to be restarted for these changes to apply:

$ sudo systemctl restart lagstash.service


AWS Instance loses network connectivity - Fix this issue now

This article covers method to fix AWS Instance loses network connectivity error.

Basically, AWS Instance loses network connectivity if the instance has the wrong time set.


To fix Amazon EC2 Windows instance network connectivity issue:

You can create a temporary elastic network interface, and attach the network interface to the Amazon EC2 Windows instance. Then, you can  temporarily connect to the instance and fix the issue.

1. Open the Amazon EC2 console, and then choose Instances from the navigation pane.

2. Select your instance. From the Description tab, note the Subnet ID.

3. Create a new network interface in the same subnet as the instance.

Important: Be sure to select a security group that allows incoming Remote Desktop Protocol (RDP) traffic from your IP address.

4. Attach the new network interface to the instance.

Note: The network interface might take a few minutes to come online. If you connect to the instance using RDP, associate an Elastic IP address with the network interface.

5. Using the new network interface, connect to the instance using RDP.

6. Change the network connection settings in Windows to use DHCP. Or, specify the correct private IP address settings. For instructions, see Configuring a secondary private IPv4 address for your Windows instance.

7. Detach the temporary network interface.

Note: If you've associated an Elastic IP address with the network interface, and no longer need the Elastic IP address, release the Elastic IP address.