MySQL – Change data directory (base)

banner-moving

MySQL is a widely used and fast SQL database server. It is a client/server implementation that consists of a server daemon (mysqld) and many different client programs/libraries.

Mysql data directory is important part where all the mysql databases storage location.By default MySQL data default directory located in /var/lib/mysql.If you are running out of space in /var partition you need to move this to some other location.

Note:- This is only for advanced users and before moving default directory make a backup of your mysal databases.

Continue reading

Unix – display a logfile in real time on screen

logfile

Q. I’d like to see my php or apache web server log files in real time. How do I see log file in real time including all incoming logs?

A. You need to use tail command which output the last part of files in real time including all incoming logs to a file.

tail -f file-name command

here are some examples

Continue reading

Unix – Setup HTTPS virtual hosts

ssl

SSL is an essential part of creating a secure Apache site. SSL certificates allow you encrypt all the traffic sent to and from your Apache web site to prevent others from viewing all of the traffic. It uses public key cryptography to establish a secure connection. This means that anything encrypted with a public key (the SSL certificate) can only be decrypted with the private key (stored only on the server) and vice versa.

Continue reading

CentOS – Install Nginx And PHP-FPM using yum

centos6

In this article, I’m going to show you how to install Nginx with PHP-FPM via yum on CentOS (actually, steps are similar on another operating sytems). Before starting to install Nginx and PHP-FPM, you must uninstall all previous Apache and PHP related RPMs installed on your system or you’ll have to disable Apache or httpd on your system. Login as root and type the following command

Continue reading

Mac OSX – clean duplicate entries in ‘open with’ menu

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\
-domain system -domain user

All you have to do is copy and paste this into Terminal and run it… (note: it takes a little bit of time for it to run so be patient)

Relaunch Finder (control+option+click on Finder icon in the Dock)…

Ta-da! The duplicate or old items are now gone!

Compiling latest version of PHP on Mac OS X

upgrade-banner

Mac OSX has a lot of Unix utilities, they’re very useful. You can start using many of your favorite Unix/Linux application out-of-the-box. But when it come to PHP, it’s not as good as PHP on Linux, What you have is an outdated version and you don’t have new features and performance of latest PHP .In this article, i’ll show you how to upgrade php on your Mac to latest version.

Continue reading

Magento – Optimize your webshop

extreme-speed-banner

Recently, i have many works that focus on Magento optimzation, that explains why i have many optimization related articles stay close to each other :D.

Today i’ll introduce you another techniques belong to Magento itself, it means you can do it with only source code and admin dashboard. there’re two sections, first one is about configuration, and second one is about frontend. i hope you will enjoy it.

Continue reading

Magento – Get product attribute’s select option id/label/value

magento-checklist_mini
If you have a select dropdown for any product attribute, to get the value from label or vice versa is always needed in order to display or get value for further processing, etc. Every now and then you will require this values while working on product attributes. There are many ways you can achieve it but the best, in terms of performance and simplicity is what I will tell you here. Get product attribute’s value from label, label from value easily in Magento.
Suppose, you have an product attribute called “color” in Magento. You have the label (e.g. Red), and you want to find it’s value. The below code will help you get the value for it.

Continue reading

Magento EE – Punch Hole in Full Page Cache

hole

Magento is slow, it’s a truth . because of its slowness, Magento have some cache mechanisms to make your site faster, so your customers will be happy. Many people choose to use all of caching options available. according to their opinions, the best cache solution for Magento is Full Page Cache (FPC), and it’s one feature from Magento Enterprise.

implementing FPC means you will have all your page content cached. it’s good for speed, but what will happen when you have several block that need to be updated after each request, or may be you want a shorter cache life for it ? The following tutorial will show you how to punch some holes in your FPC pages so you can solve above problems.

Continue reading