-
How to Move your Magento Store to a new URL
Posted on June 20th, 2009 2 commentsSince writing this post on installing Magento, I discovered a lot of unique features of this amazing open source ecommerce platform. With that said, there’s still so much I need to learn about that I decided that I’d rather get a simpler site up for my home page URL, and move my Magento install to the ‘store’ directory on my server and create a subdomain for it (store.example.com).
Moving your Magento store to a new URL is actually incredibly simple, but I did run into one confusing step that I’ll warn you about in a moment.
Now, like the typical male stereotype, I don’t ask for directions. I’m the type of person that assumes everything will be easy, simple, and straightforward until I discover otherwise, hit a road block, or can’t figure it out on my own. I’ve been burned enough times over the years that I’ve learned one simple thing that can save hours, if not days or even a lifetime of anguish. Backup often.
- I start out by synching and creating an entire backup of my Magento install. I did this using Dreamweaver’s synchronize feature and phpMyAdmin to export the current database. I dropped the .sql.gz from phpMyAdmin into the root directory of my local working copy and the created a zip of the whole thing with WinRar.
- Next, I created a subdomain in CPanel, called store, and added a new cname record at my DNS provider.
- Third, I updated Dreamweaver’s profile for the site, by adding /store to the remote FTP path field. I clicked Test and it resolved ok.
- Next, in Dreamweaver, I clicked the top folder of the site in the Files panel and typed Ctrl-F. I searched the entire Magento installation directory for my original domain name. I figured with this technique I’d discover anywhere Magento’s web-based installer had written its config files to or any path information. This took a little while based on the rather large number of files required to run Magento.
- Oddly, I found something in the downloader/pearlib/php directory, changed it, and synchronized. I wasn’t changing my database username or password, so there was no need to edit etc/local.xml.
- Next, I logged into the database using phpMyAdmin. I clicked on the main database name in the left panel, then the Search tab on the right. I entered just the part of the domain without the extension, in MySQL wild-card fashion, like so: ‘%example%’ (for example.com, no quotes). I selected every table, and clicked Go.
- phpMyAdmin found two rows in the core_config_data table, and a few others in the cms content and log tables. I clicked on core_config_data table’s Browse link, and updated two rows with my new URL, http://store.example.com.
- After lunch, my TTL on the cname addition to DNS was propogated, so I gave it a test at http://store.example.com. It half worked. I was getting my site content (the php/html was working), but no CSS, just a blank white Times New Roman site with tell-tale blue links.
- Here’s where the hidden gotcha is, that I told you I’d warn you about above. I hope this saves you some time if you’re reading this post wondering why your Magento store has can’t find the CSS after moving it. Delete the contents of the /var directory. I did this using
> cd public_html/store/var > rm -rf cache > rm -rf session
from SSH.
I wasted an hour trying to figure out where else Magento could be set to look for the path to CSS files before having the idea that Magento may be making a cache somewhere. As a PHP Fusebox developer, and having used the Smarty template engine, I’d seen a web app create temp files before. It’s not too uncommon for web applications to create some kind of parsed files to help aid performance. Sure enough, Magento creates parsed files in the /var directory, which must be deleted (and rebuilt after applying the new settings).
- Browse the site. Did it work? It worked for me.
Thanks to Damián Culotta for his post on the Magento Forums on this same subject.
-
AVI to ASF Video Conversion
Posted on June 17th, 2009 No commentsOne of the websites I redesigned last year has quite a bit of video content stored in ASF format. I was a Mac guy turned Flash & PHP guy, turned Linux guy, so I know very little (nothing) about Windows Media formats. The client sent me a new DVD, so I figured I try to match the existing file format as closely as possible. I started by converting the .VOB to .AVI using HandBrake. I needed to edit out a 3 minute segment from an hour long video and perform some corrections using AfterEffects. The source footage turned out to be over 7GB.
Now I need to figure out how to conver the uncompressed AVI to I can’t imagine finding a better post on this topic than this forum thread at videohelp.com: Convert AVI to ASF.
One of the recommended tools in the above post is called MediaCoder. The poster gives a link to download the program, along with settings to use. It seemed straightforward enough, so I decided to give it a try.
As it turns out, VideoHelp is a stupendously helfpul resource when it comes to the dizzying array of video conversion issues, formats and software to use to convert video. Another post said to re-compress your .AVI using VirtualDubMod, so I tried that, too.
Well, after trying both VirtualDubMod and MediaCoder, I got really frustrated. MediaCoder has to be one of the most annoying softwares ever created. When you install the program and run it, it opens their website with a button you have to click to open the program’s main window. What a joke. Half of the menus in the program are designed to display website pages which show ads to download AVS Video Converter. The whole “digital video conversion” shareware arena is a complete scam-fest nightmare. There’s no less than a dozen tools in the $40 to $80 range that claim to be the easiest, best, fastest, greatest everything-to-everything converter. I really don’t understand why there has to be 27 gazillion video file formats.
Anyway, I installed and ran AVS too. Upon launch it opens the registration page with a $39 one-year license or a $59 unlimited license. I tried it in demo mode, and it did work great, but it created a watermark in the middle of my video. Rats. Not even one free encode from these guys. In all fairness, AVS does seem to be the simplest, quickest tool for the most common video conversion formats, but I just didn’t feel like coughing up $40+.
I read on the FFMpeg site (a server-based tool for command-line media conversion on Linux) that ASF is generally to be avoided, and a post on another site recommended to use WMV using the Windows Media Encoder is free from Microsoft. I decided to switch to Windows Media. It is free and worked fine. And as it turned out, I wasted a lot of time trying to figure out settings for ASF files to work in MediaCoder. I never did get it to encode anything correctly – lol. Uninstall.
Assuming you have Windows Genuine, and I know you all do, all you have to do is encode to WMV using Windows Media Encoder and when the file’s done, change the file extension from .WMV to .ASF. Duh! That makes sense… not. But it works, and I’m tired, so I don’t care.
-
Installing Magento E-Commerce on CentOS
Posted on May 21st, 2009 2 commentsThis guide assumes you have a dedicated server or VPS running Cent OS, optionally with WHM and CPanel and have root access via SSH. We’ll be using WHM/CPanel to configure our install.
If you’re running on DreamHost, this is a more specific tutorial. (Though I recommend Atjeu.)
Important note: This may be obvious, but I wouldn’t recommend doing this during an important, high-traffic time or on a production server. Make sure you have a backup of all sites hosted on your box before doing this! If you break something — don’t blame me!
Okay, get ready to install Magento, the ECommerce Platform for Growth!
Before you begin
(a) Check to make sure you Web server has PHP 5.x, MySQL 5.x and PEAR.
If you aren’t sure what versions of Apache, PHP and MySQL you have on your server, it’s a good thing to know and easy to find out. Just make a PHP file, e.g. info.php, put the following code inside it and upload it to your web server into the public_html directory of the account under which you intend to install magento:
<?php phpinfo(); ?>
Browse to this phpinfo file you just uploaded, e.g. http://yoursite.com/info.php, and look at the software versions of PHP and such.
Most modern WHM/CPanel hosting setups already have these items ready to go. In my case, I wanted to install Magento on a custom-configured server, and I had PHP 5.x and MySQL 5.x but I had to install PEAR.
(b) Install PEAR (if you already have PEAR installed on your server, this would be a good time to update PEAR.)
I checked on this page at PEAR, and even though I was running CentOS, the most appropriate example for me to install PEAR was the Mac OS X example. Typing
#> curl http://pear.php.net/go-pear | php
In a command prompt via SSH Worked perfectly for me.
At the screen where it shows you the suggested file layout…
I entered 1, and used /pear as my $prefix.
After the installation completed, I typed pear help and my output looked very similar to this:
(c) Update your web server software.
If you need to upgrade any of your web server software (recommended before proceeding!) login to your server via SSH and run /scripts/easyapache as described here.
Installing Magento
(1) Download the Magento installer
I skipped the registration by clicking the No thanks link, but I recommend signing up for access to the Magento Community.
The easiest and fastest way is to use the Downloader. The Downloader install is a small PHP application that you download and run in your browser. The Magento Downloader requires you have created a database, uploaded the sample data, and permissions of 0777.
Keep this window open and proceed to step 2.
(2) Download the Sample Data.
The Sample Data is required for the installer to work correctly. You’ll need this at step 5.
(3) Uncompress the installer archives.
You should now have two folders, one containing the Magento Downloader installer, and the other containing the Magento Sample Database.
(4) Create your online store database.
The easiest way to do this is by logging into CPanel for the account. By default, this is at http://yoursite.com/cpanel
- i. Create the database. If your CPanel account username is ‘foo’ and you type ‘magento’ into this box, by default your website database name will be ‘foo_magento’.
- ii. Create a database user. If your CPanel account username is ’foo’ and you type ‘storusr’ into this box, your DB username will be ‘foo_storusr’. (The password does NOT get pre-pended with the account name.)
- iii. Give the db user ALL privileges on the db. You can tighten up the security later, but for the installer to work, it needs to be able to do everything.(5) Install the sample database.
Find the Magento SQL file that generates the Sample store database. In my case, this file was found in the ‘magento-sample-data-1.2.0′ folder, named ‘magento_sample_data_for_1.2.0.sql’.
To do this, click to the phpMyAdmin interface from CPanel, click to the database name on the left column (nothing in it yet) and then to the Import tab over to the right. Click browse. Locate the SQL file, select it, then click GO.
After several moments and approximately 1,400 SQL statements later, you should have about 233 tables in your database.
(6) Set up a folder with the proper permissions where you want to install Magento.
In my case, I chose the root level of the site, but it is probably advantageous to use a folder or subdomain, ‘shop’, for example. Next, access the filemanager, select the ‘shop’ folder you created, and click ‘Change Permissions’, giving the folder 0777 or all permissions. Again, this is just so the installer can do its thing. The permissions can be set back to their defaults after the installer is done.
(7) Using an FTP program, upload the contents of the Downloader to the ‘shop’ folder.
When that’s done, you can finally run the Magento Downloader Installer web app.
(8 ) Start the Magento Downloader install
This is as simple as going to http://yoursite.com/shop/downloader in your browser and following the prompts as shown in the series of images below.
In step 1, the Magento Downloader connects to the MagentoECommerce website to download the latest install files.
Step 2 requires you to agree to the licensing terms.
Step 3 requests that you select your default localization, or language settings.
In step 4, you tell Magento how to connect to the database you created in part 4 above.
Step 5 is where you set up your Magento store admin username and password.
And at last…
You’re All Set!
Get ready to experience Open-Source eCommerce Evolved.
Before you continue to your store, please make a note of your encryption key (Magento uses it to encrypt passwords, credit cards and more).
(9) Check to make sure the front end works.
You should see the demo store. Click around and check it out.
(10) Login to the backend and check to see that works.
Write down the password you used for admin!Where to go next
After poking around the Magento Admin you’ll see there’s a lot of things to learn. Most of the features are very self-explanatory, such as categories, subcategories and products, but other features, such as groups, permissions, roles, and most importantly, how to design and set up your store to look different from the demo, will require spending some time reading the Magento Design Guide and the Magento User Guide.Good Luck! You’ve made a great choice for your online store. -
Google Chrome Aw Snap Error Page
Posted on May 19th, 2009 No comments
The strangest thing happened to me today. If you use Google Chrome, maybe you’ve seen this before, but for me it was a first.I had to take a screen shot. How Mac System 6 circa 1988 is that?!
No matter what page I navigated to, I had no luck. Chrome was completely broken. And unlike many of the posts about this problem, I’m not using Symmantec Endpoint software, and adding –no-sandbox to the startup script in the properties dialog had no effect.
In the end, I had to create a new user profile, and restart my computer before Chrome started working again.
-
HandBrake: How to convert VOB to AVI, MP4, M4V
Posted on May 15th, 2009 3 commentsA client recently sent me a DVD with some clips they wanted for their Website. It had been a while since I converted DVD video for the web, and before I’d been using AVS Video Converter, which is a really simple $49 shareware app that works great and supports a ton of video file formats.
For this project, though, I happened to be on my laptop and didn’t feel like spending any money, so I figured I’d see what free open-source video conversion tools were out there.
Well, I just discovered the best free video converter for Mac OS X, Windows and Linux and I must say, it is truly impressive. It is called HandBrake. HandBrake is a GPL-Licensed, multiplatform, multithreaded video transcoder. I tested version 0.9.3 on Windows XP.
HandBrake converts video from VOB and nearly every other source file format to a handful of modern codecs, including AVI, MP4, M4V, MKV, and OGM. It reads DVDs and outputs digital video files you can playback in Windows Media Player, DiVX Player or QuickTime Movie Player with just a few clicks. You can set up multiple video files to convert in a queue and process a batch of video clips without babysitting your box.
It has built-in presets for QuickTime H.264, iPod, iPhone, iPod Touch and Apple TV, both legacy and newer formats. It has high profile conversion presets for animation, constant quality bit rate, film and television. It also has presets for gaming consoles, PSP, PS3 and Xbox 360.
You can fine-tune any preset with the advanced settings – and there’s a ton of them on 6 different tabs from the main interface.
You can crop the source and resize. You can detelecine, decomb, deinterlace, denoise and deblock. You can change the aspect ratio and go from non-square to square pixels and vice-versa. You can do video and audio together or separately. You can select fom multiple audio tracks and use AC3 or MP3 audio.
All the settings you define for a video conversion job can be named and saved for later, and what’s more, you can see the command line parameters you’re actually setting up by generating the output to the query editor. You can then use the generated query via the command line interface to the tool to use in .bat files, AppleScript, or even from a PHP or Python application via CLI.
Overall, this software is truly an awesome piece of work and it seems like the perfect freeware for all your video conversion needs.
-
How to Synchronize Folders on Windows
Posted on May 13th, 2009 No commentsGood buddy of mine, KJ, the IT Guru where I work just told me about this Free Folder Synchronizer from Microsoft. You can download SyncToy 2.0 from Microsoft.com.
Be sure to check out the help file, which shows how to schedule sync jobs.
Works perfectly, it’s fast and it’s free!
-
Dreamweaver CS4 Subversion Integration
Posted on May 7th, 2009 No commentsI’ve been developing websites and online applications for over 10 years, but I’ve only been using Subversion for about 3 years within my web development projects. Although it may seem like an added inconvenience, especially for small websites, from my experience, making the commitment to learn to use a source code repository and version control system as a part of your normal development routine can be one of the smartest decisions you’ll ever make. Even if you have the best anti-virus software, a good back-up software, and back up your hard drive frequently, having your actual code and websites backed up and versioned, particularly on a different system than your workstation, can be a huge benefit for several reasons.
First, you can look back over time and see exactly what you did at a glance. Second, if your project scales quickly, or you run out of time to finish on deadline and need to hire some programming help, having your work in a repository makes it a thousand times easier for multiple programmers to work on the same code without collisions — accidentally overwriting each other’s work. Third, if catastrophe does strike, you can be back up and running much more quickly.
I use Dreamweaver as my main IDE. On Windows, I’ve been using Tortoise, the graphical interface to Subversion repositories, along with Araxis Merge for comparing source code. On Mac OS X I use Dreamweaver, Terminal, svn-X, and the SCPlugin.
So I have a fair amount of Subversion experience on both Mac and Windows. I was excited to learn about Dreamweaver CS4 having built in Subversion integration, because I figured I’d be able to save a step or two having Subversion repository support included natively within Dreaweaver CS4.
So I set about setting up a repository and entered the information into Dreaweaver’s Site Manager dialog box. It was as simple as placing the right information in the Subversion server settings dialog box.
I checked out the head, made a few changes and started poking around. Well, to my disappointment, I have to say nice try, Adobe, but not worth the time. What a bummer.
This article on Adobe’s website proclaims that the Subversion features of Dreamweaver CS4
will have a proufound impact on developers?
Hardly! The feature is crippled. You’re much better off using Tortoise.
You can’t do svn log. You can’t do diff (without Araxis merge or another diff merge tool outside of Dreamweaver.) You can’t do so many things… as compared with Terminal or even Tortoise, it was a big let down.
Dreaweaver CS4 does keep track of new, modified and deleted files with ease. You don’t even need to explicitly tell Dreamweaver to add files to the repository — all files are added by default (in many cases, that can work against you). I couldn’t find a way to put in any svn:ignore properties, so having to click on and not commit _notes folders with dwsync.xml data is a giant waste of time and a deal breaker for me. I guess it doesn’t hurt having _notes/dwsync.xml in every folder in my repository, but it’s just unfortuate that some of the basic features are left out.
Oh well, thankfully I never uninstalled Tortoise.
Which brings up one final annoyance — a Dreamweaver working copy is not modifiable by Tortoise and if you checked out with Tortoise, you can’t commit with Dreaweaver.













