ESXI: Move VM between hosts

Here is a “how-to” to move VMs between ESXi hosts without vCenter and completely for FREE:

Here is the scenario:

We have two ESXi hosts: “esxi-old” and “esxi-new” like below:

We want our VMs (here webserver, devFactory and database) to be copied (or you may call it moved/migrated) to the “esxi-new” host.

 

Follow these steps carefully without skipping any:

A: On esxi-old host

  1. Create a new user on ESXi host (I recommend for user name: ovfuser) follow this tutorial from buildvirtual.net
    • WARNING: Use only alphanumeric characters in the password, else you will get an error! [REF #1]
    • Assign the admin role for this ovfuser
    • Remember to remove this user once all vm copy/migration are done.
  2. Turn off VMs you wish to copy
  3. Edit the settings of each VM, to make sure the CD/DVD Drive is set to client device like “Fig.3”
esxi_iso_asapi_ovftool_operation_canceled_by_user_cause
Fig.3: Set the CD/DVD Drive’s Device Type to “Client Device”

B: On esxi-new host

  1. Create a new user on ESXi host (I recommend for user name: ovfuser) follow this tutorial from buildvirtual.net
    • WARNING: Use only alphanumeric characters in the password, else you will get an error! [REF #1]
    • Assign the admin role for this ovfuser
    • Remember to remove this user once all vm copy/migration are done.
  2. Create a new VM, I’ll call it “AdminEye” using debian as operation system (you can follow the tutorial from enovision.net
  3. On the “AdminEye” machine, install VMWare tools (follow this tutorial from lgallardo.com NOTE to specify the correct file version when running commands)
  4. Your AdminEye machine needs internet access, (follow this post to allow internet access from AdminEye, specially if your server provider forces MAC Address verification per IP (tutorial  you should adapt to your host)
  5. Install OVFTOOL from VMWare:
  6. Get the IP addresses of your ESXi hosts, or their DNS names
  7. Adapt the following command and execute it on the AdminEye machine:

    ovftool -ds=datastore1 vi://ovfuser@192.168.100.1/devFactory vi://ovfuser@10.10.10.1/
    
  8. Wait until the copy is finished…
  9. BONUS: You can launch a new terminal and execute another parallel copy (remember step 7 above?)

[REF]:

  • http://blog.itsnotfound.com/2013/05/esxi-copying-a-vm-between-two-hosts/
  • http://andrewaphilp.wordpress.com/2013/09/13/using-ovftool-to-copy-between-hosts-without-vcenter-server/
  • http://fosshelp.blogspot.fr/2013/10/how-to-install-ovftool.html
  • http://www.virtuallyghetto.com/2012/06/how-to-copy-vms-directly-between-esxi.html
  • http://blog.itsnotfound.com/2013/05/esxi-copying-a-vm-between-two-hosts/

How to Get a High-Quality Cheap Domain

High-Quality Cheap DomainAny time people hear of a creating a website of their own, they think of it as the most expensive undertaking. However, cheap domains exist too, that go for as low as one dollar.

Getting someone to design you a website or even give you an address that suits the needs of your business is paramount. Some may be offering very unsatisfactorily services at abnormal prices. You need something affordable and at the same time something that is able to deliver the desired results. As much as you would want to have a domain at the lowest cost available, there are a number of factors to consider while going for a cheaper option.

Domain cost determinants

The main characteristics of a domain name are simplicity, uniqueness, and being one that can be easily remembered. With that in mind, the price then depends upon a number of factors. They include but are not limited to the length of the name, how many words there are and how easy the words can be spelt. Short names have a higher price tag as compared to longer ones. This is because they have the advantage of being used more easily since they lack complications. In addition, the performance of the domain is greatly enhanced with increased traffic.

How to purchase an available domain name

To begin with, research well on the offers available on the Internet before you settle on one. This will expose to varieties of cheap domain names to choose from. The prices and how easy it is to use a particular domain may vary among the companies. Start by typing a name that you feel will suit your business. The search field may notify you of the possibility of the name you chose belonging to somebody else. If this happens, you can select another name after which you will be required by the company you are registering with to pay a certain amount. This fee will cater for the purchase, the annually renewal fee and the setup fee.

After you have bought your domain, always remember to pay the renewal money lest the company resells it. This might be very tragic and especially if you had created a large pool of visitors; it might shock them and eventually you will lose them.

They are uncountable sites, which sell cheap domain names; it all depends on what you need and how much you are willing to search through them. Attractive deals are all over the market. Excellent customer services are offered and you are also assured of maximum security of your information. Sometimes, business managers think that the more expensive the domain is, the higher the performance. This can be disputed though, with the increasing sale records of some cheap versions, which have been very reliable.

You do not have to use so a lot of money to purchase a domain name, if you have a better parallel option, which will cost you less. In some companies, it will go for as low as $0.99.  Some even give you free registration, once you enroll with them. Then, nothing should prevent you from giving your business adequate publicity and reaping the benefits that come with it. Do not hesitate, use the little money that you have and uplift your company to the international arena.

[Solved] Joomla 3.0 admin radio switch buttons do not display their state

If you are using Joomla 3.0 with the ISIS administrator template, and have installed some modules and themes like JA T3 Framework or GANTRY Framework, you might notice that radio switch buttons in your administration panel do not show their state.

Here is a screenshot of how settings “Hide / Show” buttons might show:

Joomla Settings Switch buttons no state

This can be fixed easily:

Edit the file:

 JOOMLA_ROOT/administrator/templates/isis/js/template.js 

Change the line (around 35) from:

 $(".btn-group input[checked=checked]").each(function() 

to

 $(".btn-group input:checked").each(function() 

Here is what you will have once you reload your admin page:

Joomla ISIS template radio switch working correctly

The issue resides in the method the function checks if a radio button is checked or not. This update is needed in Joomla ISIS template so that the “:checked” selector is used.

Alternative PHP Cache, APC, on GoDaddy Hosting

As I said earlier, Godaddy is implementing APC ( a great cache functionality) on its shared hosting plans. In a recent contact I had with them, it looks like the launch day is tomorrow.
Godaddy.comTill now, Godaddy disabled (by default) this extension for clients using actually Zend and Ioncube; good choice; as these 3 extensions represent an incompatibility risk.

If you want to benefit from the “awaited” great performance boosts with APC, you need to disable Zend and Ioncube extension and enable APC.

Enable APC on Godaddy.com Hosting

Here is how to do it:

Open your working php.ini/php5.ini file (it might be in a subfolder or on your root folder)

If you have Zend or Ioncube extensions enabled, and you are sure your sites will work without them, disable these extensions by putting a semicolon (;) in front of each line about them.

If you see “apc.enabled=0” somewhere, comment this line with a semicolon (;) too.

Godaddy Optimized php(5).ini

Here is a nice PHP5.INI (for Godaddy Linux hosting plans using FastCGI PHP 5.3)

Save it as php5.ini and place it in the public root of your server (/html folder). Careful to backup your current php5.ini.

cgi.fix_pathinfo = 1
cgi.check_shebang_line = 0
;register_argc_argv = false
default_charset= "UTF-8"

; Enable GZIP compression at the default level
zlib.output_compression = On
zlib.output_compression_level = 6

; Disable PHP magic quotes
;magic_quotes_gpc = Off
;magic_quotes_runtime = Off
;magic_quotes_sybase = Off

register_globals = off
allow_url_fopen = on

max_upload_filesize = 6M
upload_max_filesize=6M
memory_limit=48M
max_execution_time=30

expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

date.timezone="Europe/Paris"

allow_call_time_pass_reference = on

; Load PDO MySQL extension
extension=pdo.so
extension=pdo_mysql.so

;APC
extension="apc.so"
apc.enabled=1
apc.shm_segments=1
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.enable_cli=1

; Only uncomment zend optimizer lines if your application requires Zend Optimizer support
[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
;zend_extension=/usr/local/Zend/lib/Optimizer-3.3.3/ZendExtensionManager.so
;ZEND GUARD (because we use PHP 5.3)
;zend_extension=/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so
;zend_extension_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3/ZendExtensionManager_TS.so
; -- Be very careful to not to disable a function which might be needed!
; -- Uncomment the following lines to increase the security of your PHP site.
;disable_functions = "highlight_file,ini_alter,ini_restore,openlog,passthru,
; phpinfo, exec, system, dl, fsockopen, set_time_limit,
; popen, proc_open, proc_nice,shell_exec,show_source,symlink"

Now you have APC enabled by default!

Check if APC is installed on your Godaddy account

You can check it by opening a php file containing phpinfo() function.

Here is an example:

Save the code below in a file named: phpinfo.php

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

Now you can put this file next to your websites files (careful not to overwrite existing files) and browse to this file with your web browser. Search in the page for “APC”, you will know now…

Keep in mind that these settings apply if you have your hosting with any of Godaddy Resellers, like “DomainsPricedRight.com”

 

Optimize your CS-Cart store

Speed up CS-Cart

Faster websites get better SEO scores and get better indexes in search engines, a Google employee once said “Website should be fast”, your visitors will agree, trust me.

 

CS-Cart more salesFaster and optimized eCommerce websites do sell +40% more than slower ones, just because they are faster. You “will” agree once you see the money come 😉  trust me.

 

In the continuity of my “Website optimization” posts, this time we will see how to optimize CS-Cart, but hints and methods written here are useful for all other platforms, just you will need to adapt, easily.

E-Commerce Optimization

I assume you already know about the ROCK SOLID eCommerce software “CS-Cart”, if not, you are missing BIG!

odience.net|works sponsored this post and asked me to optimize their online marketplace which is based on CS-Cart.

The outcome? A faster CS-Cart store which loads in less than 5 seconds and gets a performance grade of 94/100 and on some pages 99/100 (check for yourself at Pingdom), this literally “ROCKS”.

UPDATE: Based on my work 😉 , odience.net|works made a package that CS-Cart users can use to speed-up their stores. Will be available soon!

Now we will see in this post, how you can optimize your site load times and speed.

A little bit more than “few” technical knowledge is required if you want to read on, but you never know, maybe you will learn on the way 😉

I will expose different steps and aspects of optimization which are also applicable with other websites as we saw in my previous posts.

 

Time Matters

From an optimization point of view, even 0.1 second in load time matters so let’s get started.

 

Optimize Cache, Server side:

CS-Cart integrates a built-in cache, but that needs lots of modifications to be “robust” and “reliable”.

Here are some issues with CS-Cart’s cache:

  • It “kind of” compresses the JavaScript files but doesn’t combine them! So you find your self serving multiple files which is BAD for load time.
  • It does not cache external JS files you include with the {script} tag. OK, this might be “over doing” but it might be interesting as for serving “hosted” Google Analytics JS on CS-Cart…
  • It “combines” the CSS files but does not compress them, so you will be sending the user a quite BIG file; and that is BAD for page speed too.
  • It does not compress nor clean the HTML output, and again, BAD for speed.
  • It does not serve files with the right expires header so no one know when to refresh the content! How a browser is supposed to know what and when to cache?

Well, what to do, is to optimize this caching to the maximum and make the page generation faster and faster.

So for example the same time CS-Cart “combines” CSS files, let’s tell it to “compress” the output CSS file. When it compresses JavaScript files “independently” let’s ask for a combined and compressed output file, in the mean while, cache external JS files to limit multi-domain requests for the user.

Backup AlertThese steps are quite complex, and need core modification, so you must be careful when updating/upgrading your CS-Cart installation to keep a backup of your MODs.

SMARTY

smarty logoIf you don’t know it already, CS-Cart runs Smarty for its template engine. Smarty is basically great from an ease of use point of view, but unfortunately, Smarty v2 is not optimized for speed. Well, Smarty did great on its Smarty v3 on speed optimization, and included multiple cache handlers like eAccelerator, APC and others.

APC

Alternative PHP Cache LogoI have to mention that APC caching improves A LOT your site performance, but, Smarty v2 does not contain an APC cache handler, so I made an APC cache handler for Smarty v2, and thus for CS-Cart 3, which makes your content load directly from “RAM” instead of Hard Drive. This means “very fast”.

CS-Cart Core Optimizers

You can download these “Optimizers” from my Downloads page  odience Market, instructions included.

 

Optimize Cache, Client side:

To tell the browser which files to cache and which ones to not, your server must send correct “Expires headers”.

Unfortunately CS-Cart does not set theme correctly. This causes your client’s browser NOT to cache and ask for every page element at each request. Seriously, you DO NOT WANT THIS, because, wait for it…. BAD for speed!

You will need to edit your HTACCESS file(s) to send correct “cache” headers to the user directly from your server.

CS-Cart Optimized HTACCESS

You can download a sample of the “CS-Cart Optimized HTACCESS” from my Downloads page and for the full version, check odience Market, instructions included.

 

Combine JavaScript files:

Merge JS and CSS files

As I wrote before, CS-Cart just “compresses” JavaScript files and it does NOT combine the files. You need to combine the compressed JavaScript files to use less bandwidth and send the file FASTER to the user, because JavaScript files are “VERY DANGEROUS” for page speed.

A JavaScript file  literally blocks all other elements from loading until itself gets fully loaded, so you want it to be “alone” and to finish loading, wait for it …. …. …. FAST!

CS-Cart JS Optimizer

Get the “JavaScript Combine&Compress Smarty output filter”; that I wrote; from odience Market, instructions included.

 

Compress CSS files:

Compress content

There are lots of great Open Source projects (ex. Minify) which allow great CSS optimization, combination and compression. I don’t know why CS-Cart does not integrate one such library?

Well, all that said, you need to compress CSS files, and more precisely, Minify them to let users receive just what they need to “style”, nothing more nothing less.

Use less files, Use more SPRITES:

CSS Sprites example

CS-Cart uses a lot of small icons for its base skin.

If your current skin is using more than 20 different icons (not product images, just icons, ex. account icon, cart icon, live help icon, menu drop down arrows,…) you should think about combining them into a single file to decrease the number of requests a visitor’s browser makes to your server. This combination reduces significantly your page load time and speeds up your CS-Cart store. So, go ahead  and combine your small icons into one or two bigger image sprites to reduce file requests as these requests are BAD for speed.

There are some free tools which help you automate and simplify sprites generation:

CS-Cart Sprites based Basic skin

Still not finished, but I am working on creating a sprites based “Basic” skin for CS-Cart, help is much appreciated.

 

Use a CDN for your static contents:

CDN77.com Europe Pops

CDN, CDN, CDN! (It stands for Content Delivery Network if your are new :D)

If you got the $$$ to run with the big guys, go with AKAMAI, Amazon and other big Content Delivery Networks.

But! You can set your FREE CDN too! just serve your static content from a different sub-domain (or domain), for exemple:

Serve images from

https://staticimg.yourdomain.com/images/

while serving your mains website from

https://www.yourdomain.com/

This allows “parallel” downloads which will increase significantly page speed.

Well, serving JavaScript and CSS files from a CDN is something to think twice about, because CS-Cart generates your CSS and JS files every time you refresh the cache so if you are on a CDN, that would happen slower than you expect.

To make CS-Cart “CDN-compatible” you will need to make few changes to your skin’s files. If you focus on moving only your images to the CDN, it would be quite easy, though you should also think about the Addons and their images.

Basically, by overriding the $images_dir SMARTY variable at the right moment, you can tell CS-Cart to go get the images from a CDN, though some minor modifications should be done on core smarty plugin files to let CSS files compile correctly.

Another great idea to setup a CDN for CS-Cart is to mount your CDN space as a partition (mount point) on your server and symlink your static directories (images, css, js, cache) to the mount point, this reduces all synchronisation lags, and saves you from changing core files.

CDN CS-CartBut, a better idea, is to use a “Mirror CDN” like CDN77.com!

 

I already tested CDN77.com and the service is great. They offer a 14 days free trial, which lets you know if you are ready for CDN.

I really recommend them because of the number of pops (servers worldwide) and their affordable price ($4.90 /100GB of data, THIS IS VERY LOW!). So, if you need a CDN, sign up for CDN77.com and make your CS-Cart s

ite faster!

Let me explain on how to use a mirror CDN for your CS-Cart ecommerce software:

  1. Open an account on CDN77.com
  2. Create a new CDN
  3. If you need SSL (I recommend it if you have a secure store)
  4. Choose Free SSL (shared)
  5. or choose a custom SSL (ex.: “https://cdn1.gibni.com/” for 39$/month)
  6. Let 4 minutes pass by, for the CDN to be setup of course!
  7. Modify your CS-Cart store to serve images (you can do it even for CSS and JS, but not really needed, as you would have less than 5 JS and CSS files; it’s up to you!)
  8. Enjoy your Free CDN! (Yes, as simple as that, weird huh?)

 

Use a cookie-less domain for static components:

CS-Cart Cookie

Sites setting cookies will send/set the cookie file (0.8 – 1.5 KB) for each requested component (even for static images and css/js files).

These static contents do not require a cookie file, so by using a subdomain, or another domain (like a CDN), you will be able to get this point fixed and make your static components “cookie-less”, i.e. about 1K size reduction per element, so again, read the previous section about CDN to setup one for your images (at least).

 

Optimize your server with HTACCESS and PHP.INI tweaks:

Php.ini and Htaccess optimization for CS-Cart

To oil the gears of your server, you might need to have a look at your .htaccess and php.ini (php5.ini) files.

 

Some stuff you could do:

  • Set Expires headers based on file types,
  • Tell the browser to cache CSS and JS files,
  • Unset ETags,
  • Set Gzip/Deflate compression for your HTML/PHP files,
  • Secure access to your server and store,
  • Secure file requests and prevent file request attacks
  • Make sure downloadable files are downloadable! weird, huh?!
  • Add the “missing” trailing slash in your URLs,
  • Rewrite requests to WWW,
  • Force secure connections through HTTPS
  • Install a Virtualized Software Firewall through HTACCESS to protect yourself from hackers
  • Protect  your server and store from unauthorized queries and requests
  • Speed up the server with the PageSpeed Apache module
  • and so on…

Specially with PHP.INI (PHP5.INI) you could:

  • Set a default FROM address directly on the server to get your emails “delivered”
  • Increase execution times and upload file sizes to optimize performance and ease file uploads
  • Activate ZEND extensions to boost your server
  • and so on…

CS-Cart optimized PHP.INI & HTACCESS

Check the optimized PHP5.INI file (created and tested on Godaddy.com’s Shared hosting) and a tweaked (basic) HTACCESS for CS-Cart at my Downloads page.

 

Conclusions

There is a lot to do for a better web, by optimizing your websites and e-shops, you use less bandwidth and energy. Apart from making better sales and getting better SEO scores, you make a greener world. Do not hesitate about optimization.

APC caching for CS-Cart 3 and Smarty 2

Today I got and email from Godaddy saying that Godaddy.com is implementing APC cache from 1st October 2012. APC cache helps your pages load a lot faster, but it is not always easy to implement it into your software. Smarty, the template engine, implements the APC cache from its version 3, but the older versions of Smarty, are a bit trickier to master.

Finding a good way of implementing APC cache to your Smarty 2 is a challenge, but don’t worry, I am here :D.

Here is a method to implement APC cache to your CS-Cart eCommerce software, which is using Smarty 2 as its templating engine:

You need to:

  1. Create a SMARTY cache handler for handling APC cache. Be careful that your APC cache handler must be compatible with SMARTY 2, as of CS-Cart 3 is concerned.Here is the APC cache handler code for Smarty 2:

    Save this code as “cache.apc.php” and place it in your Smarty’s “plugins_dir” folder. (for CS-Cart, save it in:

    <CS-Cart ROOT>/core/smarty_plugins/

    Download APC Cache handler for Smarty 2, useful for CS-Cart 3 from my Downloads page

  2. Modify the CS-Cart core files to initialize APC caching (careful with this step as it requires core modifications)For instructions about the CS-Cart modifications, please contact me.
  3. Enjoy faster loading CS-Cart store!

 

Set cookie domain for CS-Cart

If your are using CS-Cart eCommerce software, you might need to configure CS-Cart to set its cookies to a specific domain or subdomain.
To do this, you need to modify a bit the “CORE” of CS-Cart.

  1. Edit the file :
<CS-CART_ROOT>/core/fn.common.php
  1. Around lines 2035 to 2044, you will find the fn_set_cookie() function,
  2. Modify the last line of this function from:
 return setcookie($var, $value, $expiry, $current_path);


to

 $current_domain = (defined('HTTPS')) ? Registry::get('config.https_path') : Registry::get('config.http_path');
 if ($current_domain != ''){
    return setcookie($var, $value, $expiry, $current_path, $current_domain);
 }else{
    return setcookie($var, $value, $expiry, $current_path);
 }

Happy creating!

GoDaddy Down

Godaddy.comWell, there are lots of news about GoDaddy.com being down, now more than 4 hours, but the question is: How Godaddy.com will compensate the losses?!

People hosting their websites on Godaddy.com servers, and its resellers, lost lots of money in this outage.

“Over 50 local Myrtle Beach hotels that use GoDaddy services through Fuel Interactive could be impacted by as much as $30,000 an hour, collectively, for each hour the sites are down.” says Wmbfnews. (1)

On the other hand, Disa Johnson says that Godaddy didn’t resolve the issue by themselves. It was the hacker who “had a heart” and let go!!!! (2)

How can making troubles for others be called “having a heart”??

Just search about this outage on Google News and Twitter (@Godaddy) and you will see that millions of websites were affected…

1- http://www.wmbfnews.com/story/19505927/hack-of-godaddy-sites-impacts-myrtle-beach-area-businesses
2 – http://airdisa.tumblr.com/post/31297877089/godaddy-dns-tangodown

Optimize JA T3 Framework on your Joomla website

After a long long time, I’m back again 😀

I’m give you a little trick to speed up your Joomla website and optimize its loading time.

If you are using the JoomlArt.com’s JA T3 Framework, which is really great, you might experience slow joomla website and long wainting times until something shows up!

Pages being slow are a pain for the visitors and might make them go away from your website.

I found out that if you enable the CSS and JS optimise options from your template’s settings page, the requests made to the optimised CSS and JS files are redirected multiple times which causes serious performance issues and slows down your pages! Strange huh??

 

That is because of a bug in the JAT3 base system plugin. Here is the fix:

Open the file:

<JOOMLA_ROOT>/plugins/system/jat3/head.php

Replace the “buildURL” function (from line 814 until 835) with the following:

 

    function buildURL($url)
    {
        if (JPluginHelper::isEnabled('system', 'languagefilter')) {
            $lang_codes = JLanguageHelper::getLanguages('lang_code');
            $default_lang = JComponentHelper::getParams('com_languages')->get('site', 'en-GB');
            $default_sef = $lang_codes[$default_lang]->sef;
            $app = JFactory::getApplication();
            $router = $app->getRouter();
            if ($router->getMode() == JROUTER_MODE_SEF) {
                if ($app->getCfg('sef_rewrite')) {
                    $url = JURI::base(true) . "/" .$default_sef. "/?$url";
                } else {
                    $url = JURI::base(true) . "/index.php" . "/" .$default_lang. "/?$url";
                }
            } else {
                $url = JURI::base(true) . "/index.php?lang=$default_sef&$url";
            }
        } else {
            $url = JURI::base(true) . "/index.php?$url";
        }
        return $url;
    }