Reset Magento Directory Permission
September 16th, 2009 | Author: Sunny
When install new extension to Magento using Magento Connect, it will ask you to set the directory permission to writable to server user. In order to do it, at command line, type in:
find . -type d -exec chmod 777 {} \;
Once finish the installation, you should reset the permission:
find . -type d -exec chmod 755 {} \;
I assume you know Unix “chmod” to change permission. The number 777, each digit is the permission for Owner, Group, and World. 7 means Writable, Readable, and Executable. You should think it in binary: 7 is “111″ in binary mode, and it means all permission is on. 1 is on, 0 is off. so, 755 means that All permission for owner, but only readable and executable to group and world because 5 is “101″.
Mac OSX: Add Hosts to Local hosts file
September 14th, 2009 | Author: Sunny
I was in the hospital for awhile, so I have not had a chance to update my blog.
Yesterday I installed OpenSuse to my VM on my Mac Pro because I wanted to play with Magento, so I installed Apache, PHP, and mySQL with all necessary modules. Everything is going well, and Magento(1.1.3) finally installed successfully with it’s sample data today(it was a bitch until I changed the hostname to localhost.com!) . However, I set my VM hostname as localhost.com, and I would like to access it from my OSX Safari. And of course, my DNS records localhost.com as something else on the internet, but not pointing to my VM’s IP address.
So what should I do? I have to change the “hosts” file on my Mac. It is located at “/private/etc/hosts“. In order to edit it, you have to grant yourself as root privilege, but by default “root” account is disabled in OSX. Therefore, you will use command “sudo“. For example, I use vi for editing, I will type “sudo vi /private/etc/hosts” in my terminal windows, and it will prompt me to enter a password(which it should be your admin password on OSX). Once you get authorized, you should be able to edit the hosts file.
To enter a new hostname in hosts file, in a new line at the end, type in IP address, then Tab, and the hostname. Once saved, Mac OSX should resolve the hostname to that IP address.