Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Multisite setup questions
I’m running a ton of subdomains with my main domain, and most have their own TXP installation, as i want them to show up as
subdomain.domain.com
instead of
domain.com/subdomain/
In order to minimize TXP update routines I’d like to merge them all into one database instead, while keeping subdomain.domain.com as their individual access point. How can this be done?
Thanks for any pointers. I haven’t used a multisite setup yet…
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Multisite setup questions
The multisite setup does allow you to run multiple domains or subdomains off a base textpattern installation but in the standard configuration, each has an admin area and database of its own, usually also as a subdomain, e.g. www.mysite.com and admin.mysite.com (although you can call it what you want). With this setup you have one main /textpattern/… folder that serves multiple sites. When you want to update, you only need swap out the files in that folder and it will apply to all your sites. You’ll still need to visit each site in turn and run the update routine, and each site can have its own plugins and templates that you might need to revisit if they are not quite compatible.
I’m not sure how the single database helps: you could use the table prefix facility to install multiple textpattern installations alongside each other in a single database, e.g. site1_textpattern, site1_txp_section…, site2_textpattern, site2_txp_section… and so on, but even then you still need to visit each site in turn to update them.
If you want to have a single admin area that you use for multiple front-end sites, the only way I can think of off the top of my head is to make a single textpattern installation and structure your sections for your various sites so that they don’t overlap with each other. You would then point all your subdomains to the same installation folder on your server and leave the site_url setting in Textpattern blank (and then use /relative/section/title links rather than txp:site_url). Then you’d use a plugin like ied_if_domain to detect which domain is currently being called in the browser and serve only the relevant articles to that domain. This does have complications: first of all your content for all sites exists alongside and interleaved with one another in the admin area, and things like categorisation and search need to be handled carefully to avoid articles from other sites being found. How tricky that ends up being depends on how simple or complex your sites are.
TXP Builders – finely-crafted code, design and txp
Online
Re: Multisite setup questions
Thank you, good advice.
The main reason why I’d love to use one database is, that my hosting gets too expensive. I can have as many databases as i want atm, but in the future I might have to work with just one or very few. Sadly this won’t do it. Hmm. I’ll give your advice a good thought for sure and eventually will have to go through running subdomains in dedicated sections. Yet I don’t understand right now, how this would be accessible as subdomain.domain.com… EDIT: Understood you now!
Last edited by jayrope (2026-01-17 17:46:10)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Multisite setup questions
My host only allows very few databases so I use DB prefixes like Jools outlined above. That way, you can host multiple sites in one database, all completely separated with their own prefix.
Then you can either choose to have a single instance of the Txp files and multiple sites swinging off that (what we call “multisite”). Or, install one Txp per site as normal. Up to you. Then use the Subdomain feature of your host to create and point sub1.domain.com, sub2.domain.com, etc, to each sites filesystem area, whether that’s a multisite “sites” folder or a dedicated /textpattern.
In all cases, when you run /setup, just choose a prefix for each DB. You may be able to set up multiple DB connection users from your host’s control panel too. That means each site has its own DB administrator and is safer than using the same credentials for multiple sites.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Multisite setup questions
jayrope wrote #342269:
The main reason why I’d love to use one database is, that my hosting gets too expensive.
That you may be able to solve by using another host, of course. There are probably lots of variants. Pete posted recently about cost-effective VPS servers on Hetzner. I’m not as practiced as Pete or Algaris in serverops, so I tried it out using Cloudpanel for server and site management, and then you are free of artificial limits placed by a provider and limited only by your server’s capacity. My server currently costs 5,80€ a month (no email hosting, so am using smtp2go for Textpattern’s internal system mail sending, which is free for up to 1000 mails a month).
in the future I might have to work with just one or very few.
If you just need to squeeze 30 sites into 10 allowed databases, the table prefix option would allow you to use a single database for several independent textpattern sites. You’d have some manual work to do in renaming tables and setting the prefix in config.php. That option works with or without a multisite setup. I think the only thing you might have to watch out for is plugins that don’t properly cater for table prefixes. That is easily fixed, though.
eventually may have to go through running subdomains in dedicated sections. Yet I don’t understand right now, how this would be accessible as subdomain.domain.com…
In a standard scenario, you probably have https://www.mysite.com/ and https://mysite.com set up in your host’s control panel to both point to the same textpattern installation directory. Usually, you then pick your favourite of those and enter that as Site URL under Admin › Settings. When you use the <txp:site_url /> tag, it automatically places your chosen site_url variant in front of your links.
If you were to point https://www.site1.com/ and https://www.site2.com/ and https://www.site3.com/ to the same textpattern installation directory, they will all be served from that installation. You would then leave the Site URL setting blank and in your templates avoid using <txp:site_url /> or the automatic permlink variants. That’s easy, you just do:
<a href="/<txp:section />/<txp:article_url_title />"><txp:title /></a>
and so on.
There’s an old but still functioning plugin called ied_if_domain – and if I recall correctly, also a way to do the same without a plugin – that allows you to say (in pseudo-code): “if the visitor is looking at site1, show this” and so on.
EDIT: I found this post where I’d outlined something similar before. Not quite the same scenario but the same basic approach.
TXP Builders – finely-crafted code, design and txp
Online
Re: Multisite setup questions
Okay, so:
Look for a new hosting eventually.
That poses other problems:
- I am running my own newsletters with Mailman on this shared host here.
- I’ve a cpanel to administer the backend. I never installed or admined an Apache server myself, not databases, php MyAdmin, what have you. My SSH skills are next to non-existing, same with terminal commands in general.
Grrmph.
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Multisite setup questions
Different thing: Can I turn my main domain site into a multisite now, although there is already a 1000 articels in there? How? Or would i need to start from scratch? Do we have a tutorial on this?
Last edited by jayrope (2026-01-17 22:15:19)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Multisite setup questions
jayrope wrote #342273:
Look for a new hosting eventually.
That poses other problems:
- I am running my own newsletters with Mailman on this shared host here.
- I’ve a cpanel to administer the backend. I never installed or admined an Apache server myself, not databases, php MyAdmin, what have you. My SSH skills are next to non-existing, same with terminal commands in general.
The control panel stuff is pretty straightforward if you’re used to it, whether it’s actual cPanel + WHM or some off-brand version. Some hosting will have that built in, for others it’s a € extra.
The newsletter thing is more of a hurdle, since email deliverability is getting progressively more complex as time goes on. The sending part of a bulk email is easy peasy…having it arrive safely and not be marked as spam / junk is another matter.
What sort of subscriber volume are you working with? How many emails are you sending per week or month?
Offline
Re: Multisite setup questions
gaekwad wrote #342286:
…
The newsletter thing is more of a hurdle, since email deliverability is getting progressively more complex as time goes on. The sending part of a bulk email is easy peasy…having it arrive safely and not be marked as spam / junk is another matter.What sort of subscriber volume are you working with? How many emails are you sending per week or month?
Hey there, I am running two newsletters with each around 400-500 recipients once every few months.
Musician here, just announcing concerts and releases, when there is any.
All members are moderated, I am the only allowed poster, so these are not mailing lists.
The only thing I believe my setup would need is the ability for Mailman to only end about 80-100 emails per hour, instead of all at once. But my provider doesn’t offer me this, and also refuses to install the nwest Mailman, which would eventually give me more control (i believe).
Edit: On a further note i am also running my own social media (Hubzilla, Fediverse) on that account, so it’ll be very hard to find such hoster again.
Last edited by jayrope (Yesterday 16:29:02)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Multisite setup questions
jayrope wrote #342289:
I am running two newsletters with each around 400-500 recipients once every few months.
For this volume, and given your familiarity with Mailman on cPanel, finding a successor hosting org with cPanel + Mail feels like the least friction approach: you won’t have to learn a bunch of new things, and that level of email won’t bother most hosting companies.
Aside: that email volume is also pretty low for bulk email services and with a bit of r&d you may find a free tier that fits your needs. Bulk email providers also have benefits of being able to provide a lot more info email deliverability…it’s a bit ‘acronym soup’ with SPF, DKIM, DMARC and so on, but they’re very much incentivised to deliver your single player email…whereas Mailman is more geared to multiplayer use.
Offline
Re: Multisite setup questions
gaekwad wrote #342290:
For this volume, and given your familiarity with Mailman on cPanel, finding a successor hosting org with cPanel + Mail feels like the least friction approach… that email volume is also pretty low for bulk email services and with a bit of r&d you may find a free tier that fits your needs. Bulk email providers also have benefits of being able to provide a lot more info email deliverability…it’s a bit ‘acronym soup’ with SPF, DKIM, DMARC and so on, but they’re very much incentivised to deliver your single player email…whereas Mailman is more geared to multiplayer use.
Any common email providers capitalize on tracking recipients, am not into this. Also, why should 400-500 recipients for a one-time email every few months be a problem? There’s a provider gap there.
What we actually need, is a newsletter software, that can handle emailing fromn a pool of email adresses while sending them out in batches of max 100 every hour. Hmm. Sadly i am not capable of writing even a TXP plugin for this type of minor need anymore.
Last edited by jayrope (Yesterday 21:19:32)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Multisite setup questions
I have a newsletter plugin in development that would fill this void but it’s been eclipsed by other work. I’ll see if I can divert some time to it because it’s going to be a handy addition to leverage the power of 4.9.x and SMTP.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline