Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-16 17:28:10

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Support multiple sites (r3189)

Sounds great!

How does this work and how do i activate it?

Offline

#2 2009-05-16 17:50:58

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,328
Website Mastodon

Re: Support multiple sites (r3189)

Sam Weiss aka artagesw posted the original patch to the txp-dev mailing list. The change set is based upon his patch, and his instructions there still hold water.

We will probably provide a TextBook page once this feature has stabilized. Currently, we are still waiting for feedback from the testers.

Offline

#3 2009-05-30 13:56:58

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Support multiple sites (r3189)

How do you access this information? It says you need an password!


~ Cameron

Offline

#4 2009-05-30 14:33:19

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,328
Website Mastodon

Re: Support multiple sites (r3189)

By subscribing to the txp-dev mailing list.

Offline

#5 2009-06-03 12:41:16

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Support multiple sites (r3189)

I’ve looked around, but can’t find the information regarding how to use the multiple site feature. So for example, say I want to do this:

http://admin.domain.com/ is the TXP folder! and then have the sites at various locations such as http://blog.domain.com/ and http://www.domain.com/


~ Cameron

Offline

#6 2009-06-03 14:46:34

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,699
Website

Re: Support multiple sites (r3189)

I’m not sure if this will help you but here is the readme Sam Weiss originally wrote including later updates from wet. As far as I can tell, Wet just marked where it is no longer necessary to apply the patch (as now in core) and changed some paths to reflect the new admin setup. This applies only to 4.09 svn version.

You might want to ask Sam Weiss if you can’t make head or tail of it.

PS: if sam or the devs would rather I remove this, I will.

textpattern-multi-site-patch

Version 4.0.8-dev (r3193)

Author: Sam Weiss (***@***.***)
==================================


Contents of Directory
=====================

This directory contains a patch file to be applied against Textpattern v.4.0.7,
as well as a web root layout template to be used for creating a Textpattern-driven web site
that is compatible with the multi-site capabilities enabled by the patch.

Files:
	-- readme.txt:	this file
	(obsoleted by core code) -- txp_multi_site_patch_4_0_7.txt: the multi-site patch file
	-- txp_site_template.tar.bz2: template for creating web root directory


Overview
========

The textpattern-multi-site-patch patch enables two main capabilities:

	1. The creation of multiple Textpattern-driven web sites from a single installation
	of the Textpattern core code base.

	2. The ability to separate the Textpattern admin area from the Textpattern-driven
	web site by placing it into its own web root and subdomain.

In addition, a modicum of extra security is achived because the vast majority of the
Textpattern core code is removed from the web document root.

As an added bonus, the admin area can be protected by SSL quite easily, since it exists
in a separate subdomain.

For example, after applying this patch, you might have the following Textpattern-driven sites,
all running off a single shared installation of the Textpattern code:

	http://www.mysite1.com
	https://admin.mysite1.com

	http://www.mysite2.com
	https://admin.mysite2.com

	http://www.mysite3.com
	https://admin.mysite3.com


Installation
============

Follow the steps below to apply and use the patch.

1. Install Textpattern into shared location outside of web document root. All commands will assume /usr/local/share/textpattern/.
	# Substitute the path to your shared Textpattern installation for "/usr/local/share/textpattern/".
		$ mkdir /usr/local/share/textpattern/
		$ tar xzf textpattern-4.0.7.tar.gz -C /usr/local/share/textpattern/

2. Create symlink to current version of Textpattern.
	# Substitute the path to your shared Textpattern installation for "/usr/local/share/textpattern/".
		$ ln -s textpattern-4.0.7 /usr/local/share/textpattern/textpattern

(obsoleted by core code) 3. Apply multi-site patch.
	# Substitute the path to your shared Textpattern installation for "/usr/local/share/textpattern/".
		$ cd /usr/local/share/textpattern/textpattern
		$ patch -p1 < /path/to/txp_multi_site_patch_4_0_7.txt

4. Extract directory template to web document root and rename it.
	$ tar xjf txp_site_template.tar.bz2 -C /path/to/my/textpattern/sites/
	$ mv /path/to/my/textpattern/sites/txp_site_template /path/to/my/textpattern/sites/mysite.com

5. (Optional) Configure your web server to create separate subdomains and web roots for web site vs. Textpattern admin area.
	# You may also wish to activate SSL on the admin subdomain. For example:
	# https://admin.mysite.com ->  /path/to/my/textpattern/sites/mysite.com/admin
	# http://www.mysite.com ->  /path/to/my/textpattern/sites/mysite.com/public

6. Update path in admin/setup/index.php to match location of Textpattern installation.
	# If you installed into /usr/local/share/textpattern/ per step 1, then skip this step and proceed to step 8.
	# Open /path/to/my/textpattern/sites/mysite.com/admin/setup/index.php in a text editor.
	# Edit line 13 to reflect the location where you installed Textpattern.
	# Important! You want the full path to the internal "textpattern" folder (inside the main textpattern directory).

7. Update symlinks in admin/ directory.
	# If you installed into /usr/local/share/textpattern/ per step 1, then skip this step and proceed to step 8.
		$ rm /path/to/my/textpattern/sites/mysite.com/admin/{jquery.js,theme,textpattern.js,txp_img}
	# Substitute the path to your shared Textpattern installation for "/usr/local/share/textpattern/".
		$ ln -s /usr/local/share/textpattern/textpattern/textpattern/jquery.js /path/to/my/textpattern/sites/mysite.com/admin/
		$ ln -s /usr/local/share/textpattern/textpattern/textpattern/theme /path/to/my/textpattern/sites/mysite.com/admin/
		$ ln -s /usr/local/share/textpattern/textpattern/textpattern/textpattern.js /path/to/my/textpattern/sites/mysite.com/admin/
		$ ln -s /usr/local/share/textpattern/textpattern/textpattern/txp_img /path/to/my/textpattern/sites/mysite.com/admin/

8. Point your web browser to your admin setup directory and proceed through setup.
	# https://admin.mysite.com/setup/
	# On MySQL setup page, be sure to enter the correct URL to your Textpattern site (not the admin site).
	# When you create your config.php file, add the following line just before the closing curly brace:
		define('txpath', $txpcfg['txpath']);

9. Log in!
	# Note: The "Welcome to Your Site!" article contains hard-coded links that assume the admin area is at /textpattern.
	# These links will be broken because we have moved the admin area to its own subdomain. This is expected.

10. Repeat steps 4-8 for each new Textpattern site you want to create. Your site directory layout will look like the following:
		my-web-root/
			mysite1.com/
				admin/
				private/
				public/
			mysite2.com/
				admin/
				private/
				public/
			mysite3.com/
				admin/
				private/
				public/

TXP Builders – finely-crafted code, design and txp

Offline

#7 2009-06-03 17:34:56

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Support multiple sites (r3189)

Yep, one day I’m going to get up early, purify myself, put on my plate-mail and boldly try this sucker out. Till then, I’ll cower in the corner.

Offline

#8 2009-06-05 02:12:12

artagesw
Member
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

Re: Support multiple sites (r3189)

My original patch (and the code in 4.0.9) simply eliminates certain internal limitations and assumptions in the core code that prohibit a multi-site installation. As several folks have discovered, that alone does not make deploying a multi-site installation a one-click affair.

Building a UI for managing multiple installations, whether in the core or as a plugin, would be a logical next step once 4.0.9 is in place. I have not fully thought through whether or not this could be accomplished via a plugin alone.

Also, careful consideration must be given to any changes made to the layout of the installation directory, so as not to break existing single-site installations that upgrade to a multi-site enabled version of Textpattern.

I am certainly willing to take this feature to the next level if the demand is there and wet is willing to incorporate my work.

Offline

#9 2009-06-05 12:36:21

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Support multiple sites (r3189)

artagesw wrote:

My original patch (and the code in 4.0.9) simply eliminates certain internal limitations and assumptions in the core code that prohibit a multi-site installation. As several folks have discovered, that alone does not make deploying a multi-site installation a one-click affair.

Building a UI for managing multiple installations, whether in the core or as a plugin, would be a logical next step once 4.0.9 is in place. I have not fully thought through whether or not this could be accomplished via a plugin alone.

Also, careful consideration must be given to any changes made to the layout of the installation directory, so as not to break existing single-site installations that upgrade to a multi-site enabled version of Textpattern.

I am certainly willing to take this feature to the next level if the demand is there and wet is willing to incorporate my work.

Well the demand is certainly there for me. And I can guess many more will want such a feature. However this needs to be implemented as lightweight as possible, lightweight enough that it should be invisable should someone not be needing it, but easily accessible should someone want to use it. With that I think that the major elements should be part of the core that allow said functionality, but the management side of things should be a plugin that say adds a new menu for the admin section called sites perhaps?

Last edited by driz (2009-06-05 12:36:43)


~ Cameron

Offline

#10 2009-06-05 14:32:35

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Support multiple sites (r3189)

not to be a lazy ass, but…

I’d definitely use one install for multiple sites if it were just a bit easier to setup.

Offline

#11 2009-06-06 06:47:03

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: Support multiple sites (r3189)

This multiple sites setup seems to be for people who are server admins and have TXP on many different accounts.

It would be good to also have a solution that works more like EE where to just copy the index.php and path.php file and change a few settings in the path file. Also an interface for quick switching between sites.

Offline

#12 2009-06-06 06:51:04

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,328
Website Mastodon

Re: Support multiple sites (r3189)

FireFusion wrote:

This multiple sites setup seems to be for people who are server admins and have TXP on many different accounts.

Nope. It just requires the capability to establish symbolic links, and it even works on Windows servers with a few amendments.

It would be good to also have a solution that works more like EE where to just copy the index.php and path.php file and change a few settings in the path file.

This is how it works, basically. s/path.php/config.php/

Offline

Board footer

Powered by FluxBB