Magento file system ownership and permissions

In this section we are going to discuss on how we can set magento file system ownership and permissions:

  • Why do we set file system permissions
  • Magento File system ownership and permissions

Why do we set file system permissions

Being living in a internet age exploits are a real concern, in-order to prevent malicious exploits we need to take advantage of the file system by setting Magento file system ownership and permissions in a particular way. For more information, see Overview of ownership and permissions.

These are the things needs to keep in mind:

The Magento file system owner:
They must have the full control of all directories and files
This user must be kept as a different user not the web server user and the web server must have the write access to:

  • var
  • app/etc
  • pub

Other than this folders and files web server user must own the files created by Magento Admin or other web-based utilities

So the recommended permissions is as follows:

  • All folders must have permission 770.
    770 permissions give read/write/execute only to the owner and group and no permissions to others
  • All files have  must have permission 660.
    660 permissions give read/write/ only to the owner and group and no permissions to others

File system permissions and ownership

The steps taken to set the permissions and ownership is as follows:

1. Change to the Magento installation directory:

cd /path/to/magento/root

Examples:
Ubuntu: /var/www/magento2
CentOS: /var/www/html/magento2

2. Set ownership:

chown -R : web server user.

Typical examples:CentOS: chown -R :apache .
Ubuntu: chown -R :www-data .

3. Set permissions:

sudo find . -type d -exec chmod 770 {} \; && sudo find . -type f -exec chmod 660 {} \; && sudo chmod u+x bin/magento

Hope this section helps to know about the magento file system ownership and permissions

New JavaScript Malware Issue in Magento. Make sure your site is secure.

Magento Commerce has received reports of a JavaScript malware exploit that forwards credit card information from checkout pages to an external site. No new attack vector has been identified. It appears most impacted sites have not implemented the February 2015 Shoplift patch, or the patch was implemented after the site was already compromised.

Information on how to identify and remove the malicious code is available on the Magento Security Center at http://magento.com/security/news/new-javascript-malware-issue

Get windows 10 for free

We can get a full version of Windows 10, not a trial for free, Only thing you need to a faster internet connection
to do 3GB download. You have one year to upgrade Windows 10 from the release date.

The offer is valid only for qualified Windows 7 and Windows 8.1 devices, and they exclude some editions like Windows 7 Enterprise, Windows 8/8.1 Enterprise, and Windows RT/RT 8.1

Their lawyers made us say this:

Windows 10 Upgrade Offer is valid for qualified Windows 7 and Windows 8.1 devices, including devices you already own. Some hardware/software requirements apply and feature availability may vary by device and market. The availability of Windows 10 upgrade for Windows Phone 8.1 devices may vary by OEM, mobile operator or carrier. Devices must be connected to the internet and have Windows Update enabled. Windows 7 SP1 and Windows 8.1 Update required. Some editions are excluded: Windows 7 Enterprise, Windows 8/8.1 Enterprise, and Windows RT/RT 8.1. Active Software Assurance customers in volume licensing have the benefit to upgrade to Windows 10 enterprise offerings outside of this offer. To check for compatibility and other important installation information, visit your device manufacturer’s website and the Windows 10 Specifications page.

Here is how we can Get Windows 10 for free

We have to reserve our free upgrade to get it, For that we have to use the Get Windows 10 App which is found at the right side of the taskbar as a small Windows. If you don’t have that please see this link Windows 10 Help for more information. When you have completed your reservation it will download Windows 10 when available.

Open Get Windows 10 App and enter the email to get the confirmation of the reservation and you can cancel the reservation at any time, if you don’t like it.

This will gives you the notification when Windows 10 upgrade is ready for you

 

 

Get customer by custom attribute in Magento

We can get customer by custom attribute in magento with a single line of code as shown below, Just pass the attribute name and the desired value

<?php
$customer=Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('username', 'yourusernamehere')->load();
?>

In the above code username is the desired custom attribute
and yourusernamehere is the value of the custom attribute

in $customer the customers matching the criteria will get as an array

hope this helps you to get customer by custom attribute in magento