×


Blog


Add Compute Host to oVirt Virtualization - How to do it

This article covers oVirt Virtualization and how to add Compute Host to oVirt Virtualization. oVirt is a free and open-source distributed virtualization solution that can be used to manage your entire infrastructure.

oVirt allows you to manage virtual machines, compute, storage and networking resources from the web-based interface. It uses KVM hypervisor and built upon several other community projects, including libvirt, Gluster, PatternFly, and Ansible.


To Add Compute Host to oVirt:

1. Validate oVirt Engine installation by logging into the console.

2. Navigate to Compute > Hosts > New and fill all required information.

3. Modify other settings in the left panel as you see fit and click "OK" button to provision the node.

4. The Status should change to Installing and will finish in few minutes.


To Configure Host Networking:

1. If you want to add additional networks – extra bridges with VLANs e.t.c, this can be done once the host is added.

2. First create a Logical Network on Network > New. Give Virtual Network correct details. For VLAN ID check "Enable VLAN tagging".

3. With the Host added and active you can configure its networking under Network Interfaces > Setup Host Networks.

4. Assign the Logical network to an interface.

5. Drag Virtual Network for mapping to host interface.

6. Configure IP addressing if required.

7. Once saved and successful it should turn green.

8. You can then proceed to create virtual machines using oVirt Management interface.


Icons images and javascript files missing from frontend in Magento - Fix it now

This article covers methods to resolve Magento error related to with icons, images, and javascript files missing from frontend. Basically, icons, images, and javascript files might not appear if we use the wrong Magento update command to upgrade the version.


If you are in production mode, and are running setup:upgrade and you don't want regenerate static content because there is no need to, then you can use the following:

php bin/magento setup:upgrade --keep-generated

--keep-generated is an optional argument that does not update static view files. 

It should be used only in production mode. 

It should not be used in developer mode.


Solutions for the issue where stylesheets and images do not load after installing Magento ?

The following are possible solutions depending on the software you use and the cause of the problem:

If you are using the Apache web server, verify your server rewrites setting and your Magento server's base URL and try again. If you set up the Apache AllowOverride directive incorrectly, the static files are not served from the correct location.

If you are using the nginx web server, be sure to configure a virtual host file. The nginx virtual host file must meet the following criteria:

The include directive must point to the sample nginx configuration file in your Magento installation directory. For example:

include /var/www/html/magento2/nginx.conf.sample;

The server_name directive must match the base URL you specified when installing Magento. For example:

server_name ip_address;

If the Magento application is in production mode, try deploying static view files using the command magento setup:static-content:deploy.


WordPress 405 Method Not Allowed Error - Fix it now

This article covers different methods to troubleshoot 405 Method Not Allowed Error on WordPress.

The 405 Method Not Allowed WordPress error occurs when the web server is configured in a way that does not allow you to perform a specific action for a particular URL. 

It's an HTTP response status code that indicates that the request method is known by the server but is not supported by the target resource.


To Fix 405 Method Not Allowed Errors:

1. Comb through your website's code to find bugs.

If there's a mistake in your website's code, your web server might not be able to correctly answer requests from a content delivery network. Comb through your code to find bugs or copy your code into a development machine. 


2. Sift through your server-side logs.

There are two types of server-side logs -- applications logs and server logs. Application logs recount your website's entire history, like the web pages requested by visitors and which servers it connected to.


3. Check your server configuration files.

The last way to find out what's causing your 405 Method Not Allowed Error is by taking a look at your web server's configuration files.


PHP Handlers for your Server - Which is suitable

This article covers the pros and cons of different PHP Handlers. Basically, selecting the proper PHP handler plays a major role in the server's stability and performance. 

Apache does not natively support PHP scripts without a special module. The module that tells Apache how to handle PHP scripts is referred to as a PHP handler. 

Without a properly configured module, Apache will just send you the PHP file as a download since it doesn't know what else to do.


How does each PHP handler work and what are the pros and cons :

1. DSO/Apache Module

This is also referred to as mod_php. This module allows Apache itself to directly parse and display PHP files. PHP scripts parsed by mod_php run as the same user that Apache itself does (rather than the user account that hosts the PHP files.


Pros

i. One of the fastest handlers available.

ii. Works with mod_ruid2 or mpm_itk modules.


Cons

i. Only works with a single version of PHP on cPanel servers (you'll need to use other handers for other versions of PHP if you offer them).

ii. Scripts run as the Apache user rather than the owner of the domain or subdomain. For example, on a cPanel server, if the script creates a file or directory, that file will be owned by the user "nobody" which can cause problems when the account owner goes to backup or remove them.


2. CGI

Stands for Common Gateway Interface. Using this handler, the system will run PHP scripts as the user that owns the domain or subdomain.


Pros

Scripts run as the domain or subdomain user, not as the Apache user.


Cons

i. One of the slowest handers.

ii. Doesn't work well with PHP opcode caching.

iii. Cannot put PHP configuration changes in an .htaccess file.


3. FCGI/FastCGI

FastCGI is a variation of the CGI protocol that provides a number of benefits over the older CGI handler. Using this module, the system will run PHP scripts as the user that owns the domain or subdomain. There are some differences between mod_fastcgi and mod_fcgid, but none that are relevant to the scope of this article.


Pros

i. Scripts run as the domain or subdomain user, not as the Apache user.

ii. Very fast handler.

iii. Works with PHP opcode caching.


Cons

i. This handler uses more memory than most of the others.

ii. Cannot put PHP configuration changes in an .htaccess file.


4. PHP-FPM

FPM stands for FastCGI Process Manager. It is an improved way of implementing FastCGI processing of PHP.  Using this handler, the system will run PHP scripts as the user that owns the domain or subdomain. Each FPM pool can have independent settings.


Pros

i. Scripts run as the domain or subdomain user, not as the Apache user.

ii. One of the fastest PHP handlers.

iii. Works with PHP opcode caching.

iv. Allows for some additional level of flexibility per pool.


Cons

i. This handler can use more memory than any other handler listed here, but that depends on the number of sites using PHP-FPM and the configuration of the FPM pool.

ii. Can be somewhat more complicated to manage.

iii. Cannot put PHP configuration changes in an .htaccess file and some directives can only be changed on a global level.


5. suPHP

This handler was specifically designed to serve PHP scripts as the owner of the domain or subdomain that is executing the PHP script. On cPanel servers, it is also configured to disallow execution of files with unsafe permissions. cPanel their copy of suPHP with the latest security fixes.


Pros

i. Scripts run as the domain or subdomain user, not as the Apache user.

ii. cPanel configures suPHP so that it blocks accessing or executing any files or directories with permissions higher than 755 for security.


Cons

i. Slowest PHP handler in most cases.

ii. PHP Opcode caching has no performance improvement and only wastes memory.

iii. Cannot put PHP configuration changes in an .htaccess file.


6. LSAPI

This handler implements the LiteSpeed Web Server (LSWS) SAPI. This handler requires CloudLiunx or LSWS for the maximum benefits. Using this handler, the system will run PHP scripts as the user that owns the domain or subdomain.


Pros

i. Designed to perform as well or better than PHP-FPM under certain circumstance.

ii. Less memory use than most other handlers.

iii. Scripts run as the domain or subdomain user, not as the Apache user.

iv. No special configuration required.

v. Can read PHP values out of a .htaccess file.


Cons

i. You don't get full benefits without purchasing a third-party commercial product.

ii. Not compatible with mod_ruid2 or mpm_itk (but it shouldn't need them).


Show dropped packets per interface on Linux - Methods to check it

This article covers how to Show dropped packets per interface on Linux. 

There can be various reasons for packet loss. It can be that the network transport is unreliable and packet loss is natural, the network link could be congested, applications cannot handle the offered load.

Sometimes there are too many packets, they are saved to a buffer, but they are saved faster than processed, so eventually the buffer runs out of space, so the kernel drops all further packets until there is some free space in the buffer.


You will learn the different Linux commands to see packet loss on Linux per-interface, including excellent tools such as dropwatch. 

We can also use Linux profiling with performance counters utility called perf.


To display show dropped packets per interface on Linux using the netstat:

The netstat command is mostly obsolete. Replacement for netstat is ss and ip command. 

However, netstat still available on older Linux distros, which are in productions. 

Hence, I will start with netstat but if possible, use the ip/ss tools. 

The command in Linux is:

$ netstat -i

$ netstat --interfaces


To display summary statistics for each protocol, run:

$ netstat -s

$ netstat --statistics


To show dropped packets statistics per network interface on Linux using the ip:

Let us see how to see link device stats using the ip command. 

The syntax is:

$ ip -s link

$ ip -s link show {interface}

$ ip -s link show eth0


SELinux users on CentOS 7 – Actions and Deciphering error messages

This article covers more information about SELinux users on CentOS 7.


Deciphering SELinux Error Messages

We looked at one SELinux error message. We were then using the grep command to sift through /var/log/messages file. Fortunately SELinux comes with a few tools to make life a bit easier than that. These tools are not installed by default and require installing a few packages, which you should have installed in the first part of this tutorial.

The first command is ausearch. We can make use of this command if the auditd daemon is running. In the following code snippet we are trying to look at all the error messages related to the httpd daemon. Make sure you are in your root account:

ausearch -m avc -c httpd

In our system a number of entries were listed, but we will concentrate on the last one:

----
time->Thu Aug 21 16:42:17 2014
...
type=AVC msg=audit(1408603337.115:914): avc:  denied  { getattr } for  pid=10204 comm="httpd" path="/www/html/index.html" dev="dm-0" ino=8445484 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:default_t:s0 tclass=file

Even experienced system administrators can get confused by messages like this unless they know what they are looking for. To understand it, let’s take apart each of the fields:

type=AVC and avc: AVC stands for Access Vector Cache. SELinux caches access control decisions for resource and processes. This cache is known as the Access Vector Cache (AVC). That's why SELinux access denial messages are also known as “AVC denials”. These two fields of information are saying the entry is coming from an AVC log and it’s an AVC event.


denied { getattr }: The permission that was attempted and the result it got. In this case the get attribute operation was denied.

pid=10204. This is the process id of the process that attempted the access.

comm: The process id by itself doesn’t mean much. The comm attribute shows the process command. In this case it’s httpd. Immediately we know the error is coming from the web server.

path: The location of the resource that was accessed. In this case it’s a file under /www/html/index.html.

dev and ino: The device where the target resource resides and its inode address.

scontext: The security context of the process. We can see the source is running under the httpd_t domain.

tcontext: The security context of the target resource. In this case the file type is default_t.

tclass: The class of the target resource. In this case it’s a file.