Thread Rating:
  • 5 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] [Tutorial]Use Google App Engine as CDN for MyBB
#1
This is my first tutorial for MyBB 1.8. MyBB is a free forum software which is best in forum software categories that's why i am using google app engine as a free cdn. In Mybb 1.8 integrating a CDN is very easy. Just go to ACP->Configuration->Server and Optimization Options and enable Use a CDN? , then in URL to use for static files simply put your cdn address.

before implementing this tutorial keep in mind google give 1 GB Outgoing Bandwidth. so this tutorial for small website

In This Tutorial i am use Google App Engine as a CDN.

Check The Tutorial Below
Note:if you dont want to download and upload your forum file manually skip step 1.7 and direct go to step 2.3.

1.1) Go to appengine.google.com and sign-in using your Google Account.

1.2) Click the “Create an Application” button. Since this is your first time, Google will send a verification code via SMS to your mobile phone number. Type the code and you’re all set to create apps with Google App Engine.

1.3) Pick an Application Identifier and it becomes the sub-domain* of your MyBB CDN. Give your app a title (say techelexforumcdn1), set the Authentication Option as “Open to all users”, agree to the terms and create the application.

[Image: app-engine-application.png]

1.4) OK, now that we have reserved the APP ID, it’s time to create and upload the MyBB CDN application to Google App Engine. Go to python.org, download the 2.7 Installer and install Python. If you are on Mac, Python 2.7 is already installed on your computer.

1.5) Go to code.google.com, download the Google App Engine SDK for Python and follow the wizard to install the SDK on your computer. When the installation wizard has finished, click the “Run Launcher” button to open the App Engine Program.

1.6) Choose Edit -> Preferences inside the Google App Engine Launcher program from the desktop and set the correct values see screenshot belowfor the Python Path, App Engine SDK and the Text Editor (set this is as WordPad or write.exe and not notepad++.exe)

[Image: app-engine-sdk-preferences.png]

1.7) Download this MyBB CDN Zip File and extract it to your desktop. The zip file contains a couple of folders, YAML and files that you can view inside WordPad.

1.8) Go to your webhost using control panel or use any FTP program. Download following folders in MyBB CDN folder which is extract in previous step.check below screen shot.
a)cache
b)images
c)jscripts

[Image: mybb-cdn-upload-file.png]

1.9) Click File – > Add Existing Application under the Google App Launcher program and browse to the folder that contain the index.yaml and other files that you extracted in Step 7. Once the project is added to App Engine, select the project and click Edit to replace “techelexforumcdn1” with your App ID. Save and close the file.
[Image: configuration-file.png]

2.0) Click Deploy, enter you Google account credentials and, within a minute or two, your MyBB CDN will be deployed and become ready for use. The URL (or web address) of your new MyBB CDN will be your_app_id.appspot.com (replace your_app_id with your App Engine Identifier).

[Image: app-engine-deployed.png]

* The sub-domain or the App ID will uniquely identify your App Engine application. For this example, we’ll use techelexforumcdn1 as the Application Identifier though you are free to choose any other unique name.

2.1) Now go ACP->Configuration->Server and Optimization Options and enable Use a CDN? , then in URL to use for static files simply put your cdn address like https://techelexcdn1.appspot.com or http://techelexcdn1.appspot.com

[Image: mybb-use-cdn.png]

2.2) Open your Forum and left click on anywhere then click on View Page Source and check script and css link. now its loading with your cdn url.

check one image from my cdn.
https://techelexforumcdn.appspot.com/images/star_rating.png
Or
http://techelexforumcdn.appspot.com/images/star_rating.png



2.3)Download this SymPullCDN Zip File and extract it to your desktop. The zip file contains a couple of folders, YAML and files that you can view inside WordPad.You will have to modify two files: main.py and app.yaml.

2.4) Open main.py in your favorite text editor and find this line:
Origin = âhttp://replace*me/â and change it to the domain name you would like to use as your like
Origin = http://community.mybb.com/

2.5) open app.yaml and find the following line:
Application: *replace*me*
replace it with identifier which is choose in step 3

2.6)Now Follow step 1.9 to 2.2.

https://techelexforumcdn1.appspot.com/images/star_rating.png
Or
http://techelexforumcdn.appspot1.com/images/star_rating.png

If you've enjoyed the guide, please show your appreciated by repping me. Big Grin

If you have any questions Huh , feel free to ask!
Reply
#2
Great tutorial, thanks for sharing. Big Grin
[Image: MO3HXYH.jpg]
Reply
#3
I just registered to thank you  Smile

Nice tutorial .. i followed your steps very carefully but i got some errors tho. For anyone have the same issues, here is how i fixed them.

1- First error is "TypeError: do_open()"

Fixed it by changing some lines in "urllib2.py" founded in "C:\Python27\lib\urllib2.py"

search for:

def https_open(self, req):
    return self.do_open(httplib.HTTPSConnection, req,
        context=self._context) 

Change to:

def https_open(self, req):
   return self.do_open(httplib.HTTPSConnection, req)

Source: https://groups.google.com/forum/#!topic/...6o_-XHNpoI

2- Second error is "authorittion faild"

Fixed it by setting "Access for less secure apps" to off from this link https://www.google.com/settings/security/lesssecureapps

Used:
"python-2.7.9"
"GoogleAppEngine-1.9.17"


Thank you again!
Reply
#4
Thanks for this tutorial. This really helps!


EDIT: I have a question. I had a user upload an avatar, but it didn't upload to the CDN (obv), so I was wondering if you knew of a way to get this to work? Or maybe even a way to change the link manually just for avatars?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)