Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
Prev Previous Post   Next Post Next
  #1  
Old 10-22-2006, 04:01 AM
Viper007Bond's Avatar
Viper007Bond Viper007Bond is offline
 
Join Date: Oct 2006
Location: Portland, OR, USA
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Best way to host attachments remotely?

[edit] Nevermind, I think I'll just use the vB Image Hosting mod instead. [/edit]

I'm running vBulletin on a tri-server setup -- one webserver and one database server in one colo and a hosted box elsewhere for static stuff like images and such. I need to conserve as much bandwidth as possible on the webserver and instead use the low power, but huge bandwidth static box.

I'm currently using phpBB and hosting the avatars remotely. I do this by running a cron that syncs the avatars folder on the static box with the one on the webserver and then redirecting to the static box via a .htaccess file. Works quite well (except for the couple minutes after a user uploads an avatar and before the cron has had a chance to sync their image over, but that's handled by a pretty "coming soon" image). See it in action here.

Anyway, now that we're switching to vB, I'd like to do something like that for the attachment system. I've told vB to store the attachments as files on the webserver rather than in the database, but of course attachment.php still reads the file and then outputs the file contents in order to mask the URL/path of the attachment file.

I have come up with two ideas for serving the attachments off of the static box. Both start with creating a sync of the attachments folder on the static box (very easy to do). Then...
  • Modify attachment.php to do redirect to the file on the static box after recording the download.

    The drawback of this is that it requires core file editing and the user can see the actual URL to the file. Not a big deal though as we can enable hotlinking protection.

    The advantage of this is that it's fairly easy.

  • Make a copy of vB (as we need the includes and such) and move it all over to the static box, but delete all the main files but attachment.php so people can't actually use the forum there. This allows attachment.php to run on the static box and serve files from there. Redirecting to that attachment.php would be easy.

    The advantages of this is that permissions still apply and more importantly, no one will know the real URL of the attachments.

    The drawbacks are that it requires the static box to talk to the database server over the Internet (slow, probably somewhat insecure) to get the permissions and other stuff from the database.
Anyone have any thoughts or better ideas about this? I literally bought vB the day before yesterday, so I'm still learning what it can do and such.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:16 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06851 seconds
  • Memory Usage 2,281KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete