1

Topic: Multihosting PunBB

I started hacking on 1.2.15 to make it so it could be easily multihostd off a single copy of the codebase. It's a big job and before I go any further I am wondering if anyone else had already done something like this, or, might anyone else be interested in the end result if I continued ?

I'm considering dropping what I've done so far and to start again on the 1.3-dev code from SVN but that would mean an incompatible system within a few days as soon as the 1.3-dev was updated. It would be better to continue with the 1.2.15 mods I've made so far but even that basically means I need to maintain a parallel, or essentially forked, copy of the codebase. The main change revolves around forcing all access to PunBB via a single index.php (front controller pattern) by changing *all* the links in the code from something like "post.php" to "?m=post" (m could be anything, to me it means "module") with a routine in index.php to include post.php instead of accessing it directly. Doing this means that ALL of the php code can be put in an off-web include path so an unlimited number of instances can be run from a single included codebase. If it's not obvious why, then consider that any bug, modifications or improvements applied to that single codebase instantly become available to all running instances... which could be 100's if not 1000's of virtually hosted sites. So far my 1.2.15 copy mostly runs with all links changed not including the admin area.

Re: Multihosting PunBB

i would be intrested, and would help with coding

Sorry. Unactive due to personal life.

3

Re: Multihosting PunBB

matt1298 wrote:

i would be intrested, and would help with coding

Great, here is the working copy - http://bbs.netserva.org - and hopfully we can use it to discuss any changes in detail RSN. And here is the code itself - http://netserva.org/cgi-bin/gitweb.cgi? … ;a=summary -  just click on the Snapshot link to get a tarball. If you, or anyone, have any patches or suggestions then either email them to me via my email link to the left, or hopefully, the first link will be usable and there will be bugs, patches, feature requests and various discussion forums etc.

Re: Multihosting PunBB

This sounds like exactly the approach I took with PunBB-Hosting wink

5

Re: Multihosting PunBB

Smartys wrote:

This sounds like exactly the approach I took with PunBB-Hosting wink

Yes, looks interesting. Does each user get their own database ? Can each instance for each user have it's own images, themes and domainname ?

It's been a few months since I started my hack on PunBB and I forgot that to be able to cleanly include each of the PHP files required encapsulating the raw HTML output into a function that returns a string rather than firing off raw HTML output directly. That's the part that is taking all the time, just changing the links to "?m=somepage" was the easy part. How do you manage being able to run multiple instances without changing the links ? Are your changes publically available ? Questions... questions... bah :-)

Re: Multihosting PunBB

My code is not publicly available, but I am willing to answer questions wink
Each forum could potentially have its own database (they don't right now because of the constraints of my host: I probably will move to that system in the future with a new host). Each forum can upload its own stylesheets and have its own templates. I don't do image hosting for them and I don't set up domains (although I could move to a subdomain setup in the future).
The way I got around your problem with links was to make all the links www.punbb-hosting.com/forums/forumname/ and had Apache rewrite that to a link to the actual codebase with ?m=forumname wink

7

Re: Multihosting PunBB

Smartys wrote:

The way I got around your problem with links was to make all the links www.punbb-hosting.com/forums/forumname/ and had Apache rewrite that to a link to the actual codebase with ?m=forumname wink

Ah, I see. It's a pity you didn't do it the other way around, as in changed the links to "?m=somepage" and used rewrite rules to provide SEF clean URLs, and then tried to push those changes into the mainstream codebase :-) Another goal I want is to have a central repo (Git) where ongoing changes can be merged into my working production copy (almost) safely and reliably on an ongoing rolling release schedule rather than a versioned tarball/zip snapshot. MediaWiki provides that option with an upgrade script that checks the database structure and applies any changes. I also want to change all the database calls to PDO which means the code will only work with PHP 5.2.3+.

Re: Multihosting PunBB

That sounds like a rather large rewrite of PunBB wink
The upgrade script though is exactly what we're providing starting with 1.3