MyBB Community Forums

Full Version: Domain Function - Forum Host
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey,

Im looking in creating a forum host, I know it needs to be on seperate tables thanks to sporks advice All I need to know now is how to redirect the domain servers (eg.. localhost/exampleforum/) to its own settings and content. How is that possible.

I obviously know PHP, SQL, Java &bJava Script & Linux since my Android Tablet is linux based.

Thanks,

Spudster
The way I managed to do it is check for the subdomain. The subdomain is the key for each forum. I then modified MyBB to use that key for the settings, config, cache, and uploads.

E.g. /inc/configs/subdomain.php, /inc/settings/subdomain.php, /uploads/subdomain/, /cache/subdomain/

Instead of requiring /inc/config.php I would require /inc/configs/{$subdomain}.php. Each forum had its own database (and database user) so you don't have thousands upon thousands of tables in the same database and you have better control over how the users access the data.

That's generally it. There were also changes to the ACP to disallow modifications to certain settings and functions (Templates, PHP Info, uploads path (set in the core instead), etc..).

Having a separate config file allows for better tuning for forums that need it (larger forums usually require some form of caching).

I hope this helps. I found this to be the best way out of my options.
I could try that as that does sound like a better option, Most forum htheost like Forumotion or IcyBoards say they use the same database for all forums.Your way does sound simpler then Redirecting each domain to certain tables.

It would be neater hosting all forums in one database.
I wouldn't recommend having thousands of schemas. I would suggest having hundreds of thousands of tables in a single schema, created such as {$subdomain}_posts, etc... It's actually very easy to manage. You can't do "SHOW TABLES blah blah blah", but to get a list of tables, just go to the data location and type ls support_* to get a list of all support forum tables. I should note that I have just over 250,000 in my schema and it still runs perfectly.
The one database sounds abit better and neater and you can make A feature where it will come up All forums in the database. What im looking at now is trying to replace settings.php & config to add with each new forum instead.
It doesn't matter which looks neater. It about what is more efficient. I have not done benchmarks to compare, but I find a single schema a lot easier to manage.
The problem with that is if the installation is exploited it's going to cause more problems than it's worth. You've just given an attacker access to every user password hash from the ~3,500 forums. It's much more secure to have a separate database and user than having all tables in one database.
In settings.php what would i put to tell it to look into another folder based on the url/forum? Im getting starting to get the hang of it.
Its 12am herem If i dont reply quick as usual i will in the morning(7hrs)
Thanks for the help so far.
(2013-02-12, 02:07 PM)Spudster Wrote: [ -> ]In settings.php what would i put to tell it to look into another folder based on the url/forum? Im getting starting to get the hang of it.
Its 12am herem If i dont reply quick as usual i will in the morning(7hrs)
Thanks for the help so far.

You have to find all the files that write to settings.php and reroute the path/filename. I don't recall which files these are offhand, I would have to look through my installation.
Ok then would I create A index.php including all the mybb files? Hostdomain.com/forum/ would only redirect to the config & setting files not the mybb installation folder.

dont know if .htaccess would help.

Edit: I have a more simpler and great idea I could create A file in the mybb root. forum.php?fid=thatforum and htaccess to change it to /thatforum/ get will also goto a config folder depending on the get id.I could edit index.php todo this.
Pages: 1 2