← Home Archive Replies About Books Also on Micro.blog
  • Steps to move a Wordpress website from a local server to a production server

    Steps to move a Wordpress website from a local server to a production server

    Move files to the hosting environment- use git/beanstalkapp and not ftp

    Create db — most likely from within mysql in cPanel

    Create user to manage db — also from within mysql in cPanel

    assign user to db with all rights

    Change url in the db to match the new site

    Upload the modified db using phpMyAdmin

    Change wp-config.php to match the details of db and user just created

    Check .htaccess to see if the base url is correct — /projectName or /site works only in the local environment and / is the base url for a production site if the site is hosted in the root web directory (eg. public_html)

    Check url using a proxy site like anonymouse.org if the hosting shift has just happenned

    To create a staging site on the same server if it is a new hosting environment the db needs to have the url of the staging site

    Incase of dedicated hosting — use ipaddress of the hosting server as the url in the db

    Incase of shared hosting — use the following url in the db http://xxx.xxx.xxx.xxx/~abcd where xxx.xxx.xxx.xxx is the ip address of the hosting environment and abcd is the username of the hosting account.

    → 9:13 PM, Dec 12
  • Tools we use — Part I (Web apps)

    Tools we use — Part I (Web apps)

    In this post I’d like to share some of the web apps we use at astech.

    Git Repos

    Beanstalkapp — love the deploy feature — no more FTP just push to beanstalk and see it transferred to the server in an instant — that’s the reason they get my money instead of github.

    Bitbucket — free unlimited repos for teams of 5.

    Optimize images

    Smush.it — For PNGs and JPEGmini for JPEGs

    SpriteCow — to create CSS sprite sheets

    Pingdom to test page load times.

    Time Tracking

    clockingit.com — an excellent free app to track projects — but it seems flaky these days.

    toggl.com — also free for a team of 5

    Google apps for chat/docs/mail

    Business Development

    Rapportive — shows profiles of clients as well as social updates

    Linkedin

    Blogging

    Posterous

    → 6:34 PM, Oct 15
  • Speeding up magento : A case study

    Speeding up magento : A case study

    Magento is an amazing platform for developing ecommerce websites. In India these days ecommerce websites are popping up like mushrooms after the rains. Since Magento already has most of the features that you’ll ever need in your ecommerce website plus then some it makes a lot of sense to develop using this as a platform.

    There is a great marketplace for magento themes and plugins available at http://www.magentocommerce.com/magento-connect/ which makes developing stores on magento a pretty straightforward affair.

    But … There is always a but. Magento isn’t known for being fast. Atleast not out of the box.

    This is the problem that Zoroy.com came to us with. They came to us with a website that sold premium chocolates online but the pageload speeds were terrible. We used pingdom to test speeds and they were close to 8seconds for the homepage.

    Magento cannot be run on a shared hosting environment. You need atleast a VPS to run it and zoroy already had one. We installed Alternate PHP Caching to improve caching. This radically improves the speed of any magento installation. If nothing else install APC on your webserver — increase the cache size according to the specs mentioned here..http://blog.nexcess.net/2011/03/25/optimizing-apc-cache-settings-for-magento/

    We also improved the theme by using sprites in css instead of calling images one by one. Tool recommendation: spritecow.com

    We optimized all the product images using smushit.com and jpegmini.com. These sites compress images using lossless compression methods which means images look the same — they’re just smaller.

    Apache headers for browser based cache expiration go a long way towards making the site feel faster on the inside pages. All the reusable assets can be cached for a longer time using htaccess rules. We have a standard set of rules that we use in all our projects. This is it

    <IfModule mod_expires.c>

    ExpiresActive On

    ExpiresDefault “access plus 31556926 seconds”

    ExpiresByType image/x-icon “access plus 31556926 seconds”

    ExpiresByType image/jpeg “access plus 31556926 seconds”

    ExpiresByType image/png “access plus 31556926 seconds”

    ExpiresByType image/gif “access plus 31556926 seconds”

    ExpiresByType application/x-shockwave-flash “access plus 31556926 seconds”

    ExpiresByType text/css “access plus 31556926 seconds”

    ExpiresByType text/javascript “access plus 31556926 seconds”

    ExpiresByType application/x-javascript “access plus 31556926 seconds”

    ExpiresByType text/html “access plus 31556926 seconds”

    ExpiresByType application/xhtml+xml “access plus 31556926 seconds”

    </IfModule>

    <IfModule mod_headers.c>

    # YEAR

    <FilesMatch “.(ico|gif|jpg|jpeg|png|flv|pdf)$”>

    Header set Cache-Control “max-age=29030400”

    </FilesMatch>

    # WEEK

    <FilesMatch “.(js|css|swf)$”>

    Header set Cache-Control “max-age=604800”

    </FilesMatch>

    # 45 MIN

    <FilesMatch “.(html|htm|txt)$”>

    Header set Cache-Control “max-age=2700”

    </FilesMatch>

    </IfModule>

    # Turn on Expires and set default expires to 3 days

    ExpiresActive On

    ExpiresDefault A259200

    # Set up caching on media files for 1 month

    <FilesMatch “.(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$”>

    ExpiresDefault A2419200

    Header append Cache-Control “public”

    </FilesMatch>

    # Set up 2 Hour caching on commonly updated files

    <FilesMatch “.(xml|txt|html|js|css)$”>

    ExpiresDefault A7200

    Header append Cache-Control “private, must-revalidate”

    </FilesMatch>

    # Force no caching for dynamic files

    <FilesMatch “.(php|cgi|pl|htm)$”>

    ExpiresDefault A0

    Header set Cache-Control “no-store, no-cache, must-revalidate, max-age=0”

    Header set Pragma “no-cache”

    </FilesMatch>

    Magento includes a feature with which you can merge the the css and js files together. But this is pretty basic. Fooman speedster’s the plugin to use in this case. http://www.magentocommerce.com/magento-connect/fooman-speedster.html . It minifies, merges and compresses the js files with almost no effort at all — unless you hit a bug — then in that case there is some effort :)

    Finally we used cloudflare.com to give zoroy the cdn advantage without the associated cdn pricetag. Cloudflare.com also does a lot of things to “supercharge” your website.

    We used suggestions from Google’s page speed insights https://developers.google.com/speed/pagespeed/insights and Pingdom’s full page speed test http://tools.pingdom.com/fpt/ extensively and we would suggest that you do too for the next time you’re optimizing any website.

    The final result was that we brought the terrible page load speed down to 1.51 seconds from 10 seconds. The no. of requests on the page was reduced from 108 to 83.

    → 7:09 PM, Jun 11
  • APC on media temple dv 3.5

    APC on media temple dv 3.5

    Its quite sad that forums.mediatemple.net is not indexed by google.

    The initial steps to install APC are mentioned on a lot of blogs. But none of them mentioned the 500 errors and the error log saying nothing more than “premature end of script headers”.

    I finally found the solution on forums.mediatemple.net (from this link posted there) which basically says that you have to enable APC for each site individually and work with modifying the apc.shm_size to stop fragmentation from happenning which causes the 500 errors.

    → 10:37 PM, Mar 2
  • Contact Form 7 won’t send emails to the same domain

    Contact Form 7 won’t send emails to the same domain

    We have multiple blogs with wordpress backends and we love the simplicity in using contact form 7.

    Recently we found that some of our blogs (especially the new ones) would not send out an email to the same domain that the email is hosted on. Eg. a contact form on domain.com would not send out an email to [email protected] but would send out the email to an address to any other domain (like [email protected])

    To solve this issue you need to go to you cPanel > Mail > MX Entry and change the email routing option to “Remote Mail Exchanger”

    Bluehost MX Exchanger screen
    → 5:08 PM, Feb 24
  • RSS
  • JSON Feed
  • Micro.blog