Textpattern 4.2 introduced the new capability of hosting multiple sites from a single installation of the Textpattern core code. Using this feature on dedicated servers or VPS’s is pretty simple. But getting it to work on shared hosts can be a bit tricky. I whipped up a bash script that should make it easier to get multi-site running on a shared host. Of course, it won’t help if your host does not offer shell access. But for those that do, this script should save you some time.
Instructions for use are included at the top of the script, but the basic usage is:
txp_create_site.sh /path/to/textpattern [/path/to/site] [sitedir]
The script is pre-configured with default parameters suitable for Joyent shared hosting. Assuming you have installed Textpattern into ~/web/textpattern, simply cd into the top level of the domain you want to install for and run the script as follows:
$ cd ~/domains/mydomain.com
$ ~/txp_create_site.sh ~/web/textpattern
The script has been tested on Joyent shared hosting (and was used to create this very site). Please feel free to share your experiences using this script on other hosts. If modifications are needed, I’ll gladly incorporate them.