Community

Forums » SEPHP Help and Tips

Cloudfront CDN

    • 27 posts
    July 26, 2017 10:46 PM EDT

    Anybody has an idea on how to implement cloudfront CDN?

    I have created the distribution on Amazon and linked it to a bucket...but when I insert the given url into the Static File Base URL box, the site gets broken.

    Apparently I have to also upload the CSS files to Amazon too?

    But if I were to upload to amazon, which file? Only CSS?

    There isnt enough documentation as to the exact steps to take to achieve this.

    But I think someone must have implemented this before

    If so what did you do?

    Thanks!

  • July 26, 2017 11:15 PM EDT

    I'm only guessing at this. You could try just copying every file you have from social engine to the cdn, then just entering the full path to the installation. I wonder if it could just find the file from that point on or if the file has to have a custom folder structure.

    It's better than nothing.

    • 27 posts
    July 27, 2017 5:28 AM EDT

    That sounds reasonable Elshara...thanks.

    It feels strange though that I cant find anyone who has done it before...

    I would really love to know how they did it!

    • 2607 posts
    • 27 posts
    July 27, 2017 6:13 AM EDT

    Hey Donna thanks!

    You will not believe how many times I have read that page...over and over again!

    I guess the issue is, that I do not know what I should expect from it.

    It works as advertised but again, I was searching the source code and still see "/externals/font-awesome/css/font-awesome.min.css?c=79

    pointing to my local files.

    Following the tutorial, I can get images auto-stored onto S3, which is a neat feature and I am able to make cloudfront sit  in front of the S3.

    Right now, other statics like CSS and JS are just sitting there, locally.

    As Elshara suggested I will try to upload the entire application directory to see if that works.

    Just wished there is a simpler solution.

    Thanks to everyone!

    • 2607 posts
    July 27, 2017 6:16 AM EDT

    I don't use cloudfront so I can't say for sure. I use cloudflare though. On cazaratech, my site is zipping fast so I can't see any performance issues. Wish I could help more.

    • 27 posts
    July 27, 2017 6:18 AM EDT

    Finally!

    Please do tell, how did you implement that?

     

    • 2607 posts
    July 27, 2017 6:38 AM EDT

    Cloudflare? http://kb.scripttechs.com/learn-how-to-set-up-cloudflare-for-your-website/  I have this tutorial at my site. It's a basic tutorial. If you host with cazaratech, they set up cloudflare if needed. It's not the same as cloudfront.

    • 27 posts
    July 27, 2017 6:40 AM EDT

    Thats cool.

    Thanks Donna.

    • 2607 posts
    July 27, 2017 6:44 AM EDT

    You're welcome!

  • September 9, 2017 4:19 AM EDT

    Cloudflare is awesome! It loads cached files of the server when it is down.

    • 159 posts
    November 3, 2018 5:05 PM EDT

    Did you experience any downtown during the dns nameserver change?  Thinking of using cloudflare - just researching it now.  It is unrelated to a storage service like amazon though? 

    • 2607 posts
    November 4, 2018 3:30 AM EST

    Cloudflare is not for storage. It's made by the same folks that made project honeypot, another fave of mine. Both are great tools for filtering spam IPs. You can even filter specific countries if you don't serve those countries.

    • 159 posts
    November 4, 2018 7:44 AM EST

    Thanks @Donna Cloudflare isn't for storage.  I was looking at what I should consider next.  With new members signing up daily I want to plan storage options. I can only see Amazon as the only option so far.  Looks a bit complicated to set-up with some issues reported. I wasn't able to find a expert service provider in the Marketplace for setting up the Amazon storage.


    This post was edited by Miami Shade at November 4, 2018 9:34 AM EST
  • gs
    • 820 posts
    • 159 posts
    November 4, 2018 2:51 PM EST

    Thank you @gs

    smile

    • 159 posts
    November 4, 2018 7:41 PM EST

    Oh - Is there any way it speeds up the loading of the site

  • November 5, 2018 1:50 AM EST

    That depends on how fast your server is at retrieving the files. I think Cloudflare servers are going to respond the same as Cloudfront servers in terms of performance. It's all in how you use them, and what you store on them which makes the difference. Ideally the best configuration to have, is all the static files and cache be stored on a CDN. And then all the Dynamic pages be served via something like Redis. Put that behind a Nginx to Apache reverse proxy with varnish and yeah you have a fast server setup.

    • 2607 posts
    November 5, 2018 4:40 AM EST

    BryZar also has storage servers and other options if that's what you want. We use the same setup as Cazaratech since the owner is partners with me on it. For speeding up the load, we use nginx by proxy. We can set up AWS if you want that. There are lots of options. There are many hosts that do this. I just use BryZar for my sites though. I'm sure other clients have other hosting recommendations too.

    Cloudflare can help speed the loading of the site as it caches the site pages. But you need to be careful in how you set it up. Test it well. 

    Elshara has some good tips in his post.


    This post was edited by Donna at November 5, 2018 5:16 AM EST
    • 159 posts
    November 5, 2018 7:22 AM EST

    Thank you @Elshara Silverheart & @Donna for that information, a good start in helping my understanding in moving forward. laughing

    • 2607 posts
    November 5, 2018 7:41 AM EST

    Good luck! Still on cell data so my answers could be a bit rushed. 

    • 159 posts
    November 11, 2018 6:14 PM EST

    Well I got my cloudflare set up and working good.  Just looking for recommendations from experienced users of a few settings. For speed do most of you enable all 3 of the following?

    Enable Auto Minify 

    Javascript
    CSS
    HTML

    • 145 posts
    November 12, 2018 10:21 PM EST
    Elshara Silverheart said:

    That depends on how fast your server is at retrieving the files. I think Cloudflare servers are going to respond the same as Cloudfront servers in terms of performance. It's all in how you use them, and what you store on them which makes the difference. Ideally the best configuration to have, is all the static files and cache be stored on a CDN. And then all the Dynamic pages be served via something like Redis. Put that behind a Nginx to Apache reverse proxy with varnish and yeah you have a fast server setup.

     

     

    Elshara , would love to know how to implement this for our SE website

    Looks like you know your stuff :))

    -CDN

    -Redis

    -NGINX

    Is this something you could help us setup for a fee?

    Thanks

     

     

     

  • November 12, 2018 11:01 PM EST

    As much as I'd love to, and, as someone who would rather be honest than take on a project I'm not all that familiar with, I would try my best. But refer you at this current point in time to a host like TMD which does this sort of thing for free at no extra charge. I wouldn't charge for this service as I think it's an integral part of making the web faster, if I knew what your specs were and such, I'd give it a go.

    How I've mine set up, is through Cpanel. Engintron plus Redis plus Apache with Cloudflare. All of them free. Although I know a lot about what I need to work correctly on my server, I would have you know that in the past, this is a configuration I've asked a managed hosting provider to install for me. I could point you to a few online tutorials if you manage your own hosting and know how to login to your site using SSH.

    For the purposes of an example Linux OS configuration, I'll use Cent OS. Cloud Linux works as well in the same regard. Debian and Ubuntu work differently. The same is true for Windows OS.

    Here's Engintron Installation Guide. This is to have Nginx reverse proxy for Apache to automatically cache static files. Leaving dynamic files free to be queried by a database caching server. More on this in a minute.

    https://github.com/engintron/engintron

    This assumes you already have Cpanel WHM installed. You'll need to login to WHM to use Engintron. It is possible to manually install Nginx and manually configure settings, but this way it's all automated.

    Now install redis.

    https://www.rosehosting.com/blog/install-redis-and-redis-php-on-cpanel/

    Note: Cent OS 7 X64 and EasyApache4 are included with latest versions of Cpanel. this particular tutorial includes Cent OS 6 and Easy Apache 3 options, which no longer apply. You can skip those.

    Now install Cloudflare plugin.

    https://manage.accuwebhosting.com/knowledgebase/2456/How-to-install-CloudFlare-cPanel-plugin-in-WHM.html

    Just replace the values requested in quotes.

    All of this is free. If you don't have Cpanel WHM, it is a paid product, and it works to automate web hosting. In my experience I've never once needed Amazon anything as this has been all the set up I've needed to do on the back end.

    One more thing, setup Redis in Social Engine.

    https://yoursite.com/admin/core/settings/performance

    Click on Redis. You may need to enter your port to listen on. Refer to the redis installation tutorial to find that. If you have a server firewall, you may need to forward the port to accept outside connections if it isn't done so already.

    Like I said, I know the basics. But doing this from scratch is a lot more involved. Although there's other tutorials for that, I'll part with the one you'll need most. Installing Cpanel on Sent OS and Cloud Linux just in case you don't have it. Cpanel will only install on these two operating systems that I'm aware of.

    Try this tutorial. It's older, but it gives you all the prerequisets you'll need.

    https://hostpresto.com/community/tutorials/how-to-install-cpanel-whm-centos-7/

    Of course, I wouldn't be a very good tutorial provider if I didn't include a secondary resource to verify my information. This one is newer, it has ads in it to a host I've tried and wouldn't recommend, so scroll down to the installation part. It's similar, but provides extra steps. Personally, I'd go with the first one. But here's another one. Both of these tutorials aren't the official cpanel tutorial itself. That's because the documentation sucks on their official website for it. Having said that, without any further ado, my final link for the evening.

    https://medium.freecodecamp.org/how-to-install-cpanel-whm-on-a-digital-ocean-vps-8146eb83f70a

    Enjoy. If you need help, I'm here.

  • November 12, 2018 11:12 PM EST

    I will add one more link. Social engine supports FFMPEG. Here's how to make that happen.

    https://clients.hostsailor.com/knowledgebase.php?action=displayarticle&id=127

    Of course, there's other tutorials. If you find a better one, share it.

    Once FFMPEG is installed, just go here and type in /usr/bin/ffmpeg in the path structure.

    https://yoursite.com/admin/video/settings

    Now go to global settings in videos plugin and you can now let members upload their own videos and music. All the music files are also saved via Cache and cdn, as well as images, videos, and other website files like js, css, php, html etc.

    This configuration will use Cloudflare for the CDN to serve all the files. Engintron to cache the dynamic queries to the database. Redis to cache the database entries. And apache to process .htaccess files so you have seo friendly URLs. I'll leave site map generation and RSS ping feeds to other tutorials but they two help with search engine indexing and so on.

    Now that I let the cat out of the bag, Radcodes RSS feeds plugin plus wordpress plus pingomatic plugin for wordpress automatically pings search engines with new content. While Seo Sitemaps plugin from Social Engine Add Ons gets your default RSS feeds, turns them into site maps and makes them present in a nice way for search engines. Now you can have a fast well ranking website. Install Word Press on a directory in the same domain as your SE site like yoursite.com/posts so it all pings correctly. That's optional but hey, $1000.00 secret for under $200.00. Bonus tutorials in this case, not sold separately.


    This post was edited by Elshara Silverheart at November 12, 2018 11:20 PM EST