Page 1 of 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... LastLast
Results 1 to 15 of 225
Like Tree50Likes

How-To Set up your CDN

This is a discussion on How-To Set up your CDN within the Member Articles forums, part of the Focus on Members category; vBSEO 3.6 offers built in integration for using a CDN service, such as MaxCDN (see the 3.6 release announcement for ...

  1. #1
    vBSEO Staff Array Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    675 times
    Blog Entries
    2

    How-To Set up your CDN

    vBSEO 3.6 offers built in integration for using a CDN service, such as MaxCDN (see the 3.6 release announcement for more details on how to obtain your Free account!).

    Setting up the service requires a few more steps than just entering settings in the vBSEO CP.

    There are 2 ways to so this. Most will use their own domain name. However, there are many advantages to using a 2nd domain name but it requires a few more steps (and possible root server access to your accounts).

    Using the Same Domain as your vB/vBSEO Board

    Most customers will likely use this method, as it is simpler to set up.

    vBSEO Offers 2 methods for calling the CDN. Head on over to /vbseocp.php#cdn_opt on your site and you will see the basic set up options:

    • one sub-domain
      single-cdn-pullzone.png
    • multiple sub-domains
      multiple-cdn-pullzone.png

    Using the Multiple sub-domain is the better choice, as it allows for more urls to pull for the WaterFall Effect parallelization across host names. In other words, instead of 4 files per time per domain that a browser normally loads, a user's browser will now load 20 at once (4 files from each cdn host name + the core domain). The end results is much faster page download speeds. And of course, that is before you take into account the global distribution of the CDN service itself. With multiple peers/servers in many places, the CDN will load large static files for users further away from your physical server faster. This also keeps that load off your main server, thus lowering your hardware requirements.

    You should only use a single subdomain if you have a physical limitation on subdomains form your host (ie, only 1 subdomain is free with the account, etc)

    As you can see in the above screen shots, I added example URLs that you should use for your paths. You can use ANY subdomain you wish here, provided it doesn't actually exist. (we'll create it soon). 'static' 'cdn' 'img' 'script' and so forth are all generic terms that you can use to your liking with meaning. These will appear in your source code, and the shorter the better so you may wish to use 'a' 'b' and 'x' for your subdomains. These urls will show close to 100 times in source code per page load on an average forum, so every letter you add ads about 100 bytes to the page size. This is nit-picking, but it's something to be aware of from the start.

    Note that all settings require a trailing slash. And if you are installed in a folder, you should append said folder, ie http://images.domain.com/forums/.


    Now, open up a new tab/window and head over to your CDN account https://login.maxcdn.com/account and log in.

    First, you need to make a Pull zone.
    Click on Manage Zones from the top nav
    Click on Create Pull Zone in the top left quadrant.

    pull-zone-maxcdn-control-panel_1299904276410.png


    Fill in the settings:
    Pull Zone Name: "website: Forum CDN" works. Anything you want to call this CDN area. You will LABEL the account at the bottom.
    Origin Server Url: This is your main website url of your forum. http://www.mydomain.com/ (include any path /folder/, ie http://www.mydomain.com/forums/) Advanced users may wish to set up an origin subdomain to control caching/etc at the server-level, and you may wish to use http://cdn-source.mydomain.com for example here. Most users should simply enter the main .com
    Custom CDN Domain: This is your 'first' cdn subdomain. You can create more (if using multiple) later in the settings. Enter something like "static.mydomain.com" or anything else that you want your 'main' subdomain to be. No http://.
    Label: This is the name of this zone. "Mywebsite CDN" is a good label.
    Compression: Check this to enable gZip.

    Click on Create and the zone will now provision. This may take a minuet or so.

    While this runs, head over to your server/hosting account control panel in a new tab/window. You now want to make the CDN subdomain CNAME records.
    Each host has different set ups for this.
    In cPanel, it is called Simple DNS Zone Editor.

    Once you find this, go back to your MaxCDN portal, as it should be completed now. You should see a message similar to:

    Pull Zone has been successfully created. Manage Pull Zone
    Please create a CNAME record for static.mydomain.com to xxxxx.acountname.netdna-cdn.com
    Click on the Manage Pull Zone link in this message.

    Click the Settings tab.

    Under Custom Domains, click on edit.

    Click the plus sign to add a new row.

    Here we will add in all of our subdomains (images, avatars, static, etc as defined in the multiple subdomain image)

    Repeat clicking the plus sign until all your subdomains are created.

    setup-cnames.png

    Click update when done. It will process.


    Each we will now CNAME back MaxCDN to what is given to you in the blue bar at the bottom.

    Head back over to your host CP DNS area and enter in the CNAMES

    For the name, you need to enter each subdomain with a trailing dot, ie,
    Code:
    images.mydomain.com.
    And the cname should be your url offered in the blue box from the settings pane.
    Note, this doesn't always copy/paste over without a space so you may need to back-space it out before you save the CNAME.
    It should look something like this:
    Code:
    cdnname.accountname.netdna-cdn.com
    When you are done, you should have a list like this (account names edited, as this is from one of my live sites)
    cpanel-x_1299906485589.png


    It may take a few for DNS to propagate out, but almost always it works immediately.

    To test, load a simple graphic, such as
    Code:
    http://www.domain.com/images/misc/navbit-home.png
    from the breadcrumbs in vb4. Call it using your new cdn.
    Code:
    http://images.domain.com/images/misc/navbit-home.png
    If this loads, your CDN is operational!
    If it doesn't, you may need to wait for DNS to propagate. Check back in a little while.
    Double check all of your steps, paths, and cnames as well. You may wish to wait a bit longer as well to make up for any global traffic as well, as it can still take up to 24 hours for these to go into effect elsewhere, even though it looks ok for you.


    If you are using a non-www to www or similar htaccess redirect, you need to ALLOW these subdomains access.
    See: [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects and scroll to the 'Making Exceptions' header. You will need to add an exception for each subdomain that you CNAME.

    Don't worry about duplicate content. As your site will now load from these subdomains, they are robots.txt'ed out at the CDN level. Additionally, the CDN includes a header on all requests that identify it as a CDN which bots/etc are capable of reading.

    If you are operational, it's time to put your site live. Go back to the vbseoCP tab and save your CDN settings.

    This will convert your vB board to call images, scripts, etc from the CDN url instead of your main .com.

    Test your site completely to make sure everything works. If you lose style immediately, you did something wrong and you should disable the vbsseoCP option for the CDN immediately (uncheck the checkboxes next to each replacement).

    Finally, you want to set up the advanced settings on the CDN.
    I recommend the following set up:

    advanced-settings.png

    Each setting requires its own 'update' click per setting, so make sure you go line by line.

    That's all. You are now serving all your static content from the CDN.


    Being on the same domain name, however, all cookies will still be attached to every static item. For the ultimate in performance and speed, using a secondary domain name is the way to go.


    Using a Secondary Domain Name
    This method requires a little more work and likely root access to httpd.conf.

    This is for advanced users only. I will be FAR more brief and assume you know your way around your server.

    This set up uses almost the same 'core' settings as above, with the exception that you will use cnd.someotherdomain.com instead of your forum domain, and you need to point that account at the same file set of your main domain and edit this domains DNS instead of the core account.

    I used one of my parked domains. You likely have one when you bought the .net .org .biz or .info of your domain to protect competition and it's doing nothing. You may even wish to purchase a new domain just for this purpose, like mysitestatic.com /etc.

    Whatever domain you chose, you need to set up it's own account on your server. It must be un-parked and have it's own account.

    But, instead of letting it run its default /home/sitename/public_html/ for its path, you want to change this to your main website's path, ie /home/maindomain/public_html/
    This can't be done from cPanel to the best of my knowledge of it and needs to be changed via ssh'ing into your server and editing the httpd.conf file, and then running the distiller tool to save the settings back to easyApache (may not be necessary on non-cpanel systems).
    It may also be necessary to restart apache service so it takes effect.

    You of course need to create the CNAME entries on THIS domain name to MaxCDN.
    And you also need to adjust the vbseoCP settings to use this domain name as well.

    This saves all the cookie load as there are NO vb/analytics/etc cookies attached to each of the static files from this domain.




    Limitations:

    Attachments in private forums will not work. If you have any staff or other non-guest viewable forums that use attachments, you should not use the attachment option on the CDN.
    This is an area we are looking to improve for a future vBSEO release to get around the vb permissions to serve a CDN url or not.

    There may also be some other misc static items that are not picked up by the replacement rules that do not conform to standard markup or are hidden within other elements and thus are missed by our replacement engine. Please keep in mind that this is the first iteration of this product and it will only get better and faster with every version of vBSEO to come.
    Last edited by Brian Cummiskey; 03-12-2011 at 03:24 PM.
    Brian Cummiskey / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  2. #2
    Junior Member Array
    Real Name
    Checkmate
    Join Date
    Mar 2011
    Posts
    6
    Liked
    6 times
    Hey Brian,

    Previously I read somewhere that we need to let the client to load the new domain that host static files without being redirected by the rewrite, thus a custom .htaccess was necessary:

    (For non www site)
    #small sample, but you need to add ALL your cnames here)
    # test against core domain + all cdn cname variations.
    RewriteCond %{HTTP_HOST} !(^domain\.com$|^cdn\.domain\.biz|^static.domain.b iz$|^att.domain.biz$)
    RewriteRule (.*) http://domain.com/$1 [R=301,L]
    Do we need that anymore?

  3. #3
    Member Array
    Real Name
    Abhik Biswas
    Join Date
    Jun 2008
    Location
    Kolkata
    Posts
    98
    Liked
    8 times
    Which folders shall I point my subdomains?
    Please let me know if my current settings are correct.

    jscss.domain.com -> /home/user/public_html/forum/clientscript
    images.domain.com -> /home/user/public_html/forum/images
    avatars.domain.com -> /home/user/public_html/forum/customavatars

  4. #4
    Junior Member Array
    Real Name
    Paul
    Join Date
    Jan 2007
    Posts
    11
    Liked
    0 times
    Is it better to implement maxcdn via vbseo, or via replacement variables http://wiki.netdna.com/Implementation/vBulletin Or no difference?

  5. #5
    Junior Member Array
    Real Name
    Alex Allain
    Join Date
    Mar 2009
    Posts
    1
    Liked
    4 times
    The instructions suggest that if the DNS redirection works for you, that it will work for everyone, but that's not accurate. While DNS propagation is generally pretty fast, changes to DNS settings do not propagate everywhere at the same time. This might mean that while your CDN-enabled forum looks awesome to you, it might look quite broken for a user with another ISP or in another country. For example, I added CNAME records for my own site about an hour ago, but not all geographic locations are detecting the change yet so I have held off on turning on CDN integration.

    If you want to get a broader view of the propagation of your DNS settings, you can use a tool like What's My DNS? Global DNS Propagation Checker to see if your settings have globally propagated.

    That said, thanks for the detailed writeup--I am very excited to try this out, as you can tell

  6. #6
    vBSEO Staff Array Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    675 times
    Blog Entries
    2
    Quote Originally Posted by Checkmate View Post
    Hey Brian,

    Previously I read somewhere that we need to let the client to load the new domain that host static files without being redirected by the rewrite, thus a custom .htaccess was necessary:

    (For non www site)


    Do we need that anymore?
    Thank you, I forgot this part. Yes, it is needed.

    I had previously adding the 'exceptions' rules to our standard www vs non-www article.
    [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects
    Quote Originally Posted by ipnet View Post
    Which folders shall I point my subdomains?
    Please let me know if my current settings are correct.

    jscss.domain.com -> /home/user/public_html/forum/clientscript
    images.domain.com -> /home/user/public_html/forum/images
    avatars.domain.com -> /home/user/public_html/forum/customavatars
    You shouldn't make any subdomains. You should make CNAMES point to the CDN url. Please-re-read those steps above.


    Quote Originally Posted by alex.allain View Post
    The instructions suggest that if the DNS redirection works for you, that it will work for everyone, but that's not accurate. While DNS propagation is generally pretty fast, changes to DNS settings do not propagate everywhere at the same time. This might mean that while your CDN-enabled forum looks awesome to you, it might look quite broken for a user with another ISP or in another country. For example, I added CNAME records for my own site about an hour ago, but not all geographic locations are detecting the change yet so I have held off on turning on CDN integration.

    If you want to get a broader view of the propagation of your DNS settings, you can use a tool like What's My DNS? Global DNS Propagation Checker to see if your settings have globally propagated.
    That is a good point to take into consideration.

    Ultimately, it depends on your TTL settings and how fast that can get around the world. I know my buddy in alaska took an extra day when i did it my forum.

    That said, thanks for the detailed writeup--I am very excited to try this out, as you can tell
    Enjoy
    Brian Cummiskey / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  7. #7
    Member Array
    Real Name
    Trana
    Join Date
    Jan 2006
    Posts
    77
    Liked
    0 times
    I set this up and see the hits in the CDN, but it seems that the images are no longer coming from the CDN.

    Right after we enabled this, we saw images coming from cdn.ourdomain.com, now we see all images in YSlow coming from www.ourdomain.com.

    Is this normal behavior? We were expecting to see everything coming from the CDN domain. Also, YSlow does not detect that it is coming from the CDN.

    Thanks!

  8. #8
    Member Array
    Real Name
    Abhik Biswas
    Join Date
    Jun 2008
    Location
    Kolkata
    Posts
    98
    Liked
    8 times
    I did everything correctly and my images/CSS/JS/Avatars are coming from CDN subdomains.

    Code:
    http://images.dreamstrikes.com/images/misc/navbit-home.png
    http://static.dreamstrikes.com/clientscript/vbulletin_css/style00025l/forumhome-rollup.css
    http://static.dreamstrikes.com/clientscript/vbulletin-core.js
    http://avatars.dreamstrikes.com/customavatars/avatar204229_1.gif
    Also, when I access the CNAME from browser, it's loading my forums. So, I guess the settings are okay and the DNS has been propagated too.

    But, when I enable CDN domains from my vBSEO Settings, the CSS is messed up. Also, no images and avatars are coming from CDN Domain.

    What could be the issue? What am I doing wrong?

  9. #9
    Senior Member Array ceho's Avatar
    Real Name
    Christian
    Join Date
    Dec 2008
    Location
    Germany
    Posts
    159
    Liked
    13 times
    Hi,

    I am on a managed server by a German company called Strato. It looks like I cannot CNAME my subdomains, at least there is no function to do so. Am I screwed now? Everything went fine, account and pull zones are installed and correct, advanced settings as well, only the CNAME part is missing. If I use the temporary URL and add it in the vBSEO CP it's working (and yes, it IS increasing loading times already like this ). But that's not the way I want it to work and how it should work. So am I really screwed if I cannot CNAME the subdomains? Any ideas what I can do? Ah, of course I tried to contact the company, but no email support on the weekend....

    Thanks for any kind of help!

  10. #10
    Member Array
    Real Name
    Abhik Biswas
    Join Date
    Jun 2008
    Location
    Kolkata
    Posts
    98
    Liked
    8 times
    Thanks Mert,
    This is what I have done.

    1. Created a new pull zone at MaxCDN with the following details


    2. Then Manage Pull Zone > Settings, I added three more custom subdomains. static, images and avatars (Without any trailing slash or dot).

    3. Went to cPanel > Simple DNS Zone Editor. There I added CNAME to the last three custom subdomains.

    Name: my custom subdomain with a trailing dot
    CNAME: dreamstrikes.XXXXXXXX.netdna-cdn.com



    Now, when I add those to my vBSEO CP, nothing is loading.

    Please help..

  11. #11
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    cdn.dreamstrikes.com is not pointing to your cdn at all which means you didn't correctly defined your cName
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  12. #12
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    Quote Originally Posted by ceho View Post
    Hi,

    I am on a managed server by a German company called Strato. It looks like I cannot CNAME my subdomains, at least there is no function to do so. Am I screwed now? Everything went fine, account and pull zones are installed and correct, advanced settings as well, only the CNAME part is missing. If I use the temporary URL and add it in the vBSEO CP it's working (and yes, it IS increasing loading times already like this ). But that's not the way I want it to work and how it should work. So am I really screwed if I cannot CNAME the subdomains? Any ideas what I can do? Ah, of course I tried to contact the company, but no email support on the weekend....

    Thanks for any kind of help!
    No you are not screwed at all. You can still use supplied urls from MaxCDN. cName is just an optional step.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  13. #13
    Member Array
    Real Name
    Abhik Biswas
    Join Date
    Jun 2008
    Location
    Kolkata
    Posts
    98
    Liked
    8 times
    Quote Originally Posted by Mert Gökçeimam View Post
    cdn.dreamstrikes.com is not pointing to your cdn at all which means you didn't correctly defined your cName
    Please check now..
    Shouldn't it be pointing to my forum?

  14. #14
    Senior Member Array ceho's Avatar
    Real Name
    Christian
    Join Date
    Dec 2008
    Location
    Germany
    Posts
    159
    Liked
    13 times
    No you are not screwed at all. You can still use supplied urls from MaxCDN. cName is just an optional step
    OK, that's good news. So should I enter different pull zones to get different URL's for images, avatars etc.? Or just use one for all?

  15. #15
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    Quote Originally Posted by ceho View Post
    OK, that's good news. So should I enter different pull zones to get different URL's for images, avatars etc.? Or just use one for all?
    Both can work , i personally choose multiple pull zones on my own CDN account however we use single pull zone on vBSEO.com


    Quote Originally Posted by ipnet View Post
    Please check now..
    Shouldn't it be pointing to my forum?
    It is still not pointing out. You should contact your host and request assistance regarding cName configuration.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

Page 1 of 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •