Textpattern Forum

You are not logged in. Register | Login | Help

#1 2009-09-06 17:18:43

aesop1
Plugin Author
Registered: 2004-09-19
Posts: 142

Sites outside main TXP directory (multisite install)

It seems that it might be useful to do a multisite install with sites residing outside, rather than inside, the TXP directory. This would be useful in cases of hosts like Bluehost were new site setups are automated and domain root dirs are set up automatically.

Presumably, one could just recreate the symlinked files outside the TXP directory. Question: is there any other path info that would make this problematic? Is there a script out there that could make this task easier?

Thanks,

Matt

Offline

#2 2009-09-06 18:21:28

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

Re: Sites outside main TXP directory (multisite install)

aesop1 wrote:

It seems that it might be useful to do a multisite install with sites residing outside, rather than inside, the TXP directory. This would be useful in cases of hosts like Bluehost were new site setups are automated and domain root dirs are set up automatically.

Presumably, one could just recreate the symlinked files outside the TXP directory. Question: is there any other path info that would make this problematic? Is there a script out there that could make this task easier?

Yes, for shared hosts that impose a domain directory structure (Joyent shared hosting falls into this category), you cannot use the included sites directory. Instead, you must create your own. Works fine on Joyent with no issues. I will see about whipping up a script to automate the process.

Offline

#3 2009-09-06 18:43:58

aesop1
Plugin Author
Registered: 2004-09-19
Posts: 142

Re: Sites outside main TXP directory (multisite install)

That would be very cool and I’m sure that many in the TXP community would benefit! Thanks, Sam. Be a nice script to roll into the TXP distro too.

Offline

#4 2009-09-06 22:37:19

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

Re: Sites outside main TXP directory (multisite install)

Offline

#5 2009-09-07 21:10:55

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,187
Website

Re: Sites outside main TXP directory (multisite install)

Sam, the script and help is much appreciated – thanks! One note for Joyent users – some of us (like me) have a site structure like /web/public/ rather than just /web.

Had a quick look at the script and first thing that came across my mind is how does one approach this is the sites already exist? In my case, I have 6 domains in operation on Joyent, all running TXP 4.2 already (except one site which is being upgraded from 4.06).

What would be a sensible way of setting up multi site support for non-clean installs?


TXP Tips | @txptips | Me | @jonathanstubbs | Github

TXP Builders – finely-crafted code, design and txp @txpbuilders

Offline

#6 2009-09-07 21:41:55

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

Re: Sites outside main TXP directory (multisite install)

The script should not overwrite directories that already exist. The default settings are for Joyent, so it tries to create:

web/
   admin/
   public/
   private/

If the site already exists, web/public will already be there, so the script should not overwrite it.

For upgrading existing sites, I would:

1. Rename the web directory to, for example, web.orig

2. Run the script to create a new web directory

3. Copy your static assets (images, files, etc.) from web.orig/public/ to the new web/public/

4. Copy your config.php to web/private/

Obviously, your site will be down for a short while during the transition.

Last edited by artagesw (2009-09-07 21:42:48)

Offline

#7 2009-09-08 03:39:54

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,066
Website

Re: Sites outside main TXP directory (multisite install)

sassy!

Offline

#8 2009-09-08 06:36:23

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,187
Website

Re: Sites outside main TXP directory (multisite install)

Thanks Sam. Do I need to edit the script to make it web/public instead of web?


TXP Tips | @txptips | Me | @jonathanstubbs | Github

TXP Builders – finely-crafted code, design and txp @txpbuilders

Offline

#9 2009-09-08 17:29:31

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

Re: Sites outside main TXP directory (multisite install)

jstubbs wrote:

Thanks Sam. Do I need to edit the script to make it web/public instead of web?

No.

Offline

#10 2009-09-08 23:53:44

photonomad
Member
Registered: 2005-09-10
Posts: 260
Website

Re: Sites outside main TXP directory (multisite install)

I’m hung up on the whole main domain vs. subdomain situation in Bluehost and not sure how to use shell commands (and also not sure if Sam’s bash script would even work for Bluehost)? Is there anyone out there who would want to help steer us Bluehosters in the right direction?

Right now my domain/site root structure (txp 4..0.x installations) is:

Textpattern site for my main domain:

/home/maindomainusername/public_html/ static asset files including index.php, .htaccess, files, images, etc.
/home/maindomainusername/public_html/textpattern/ textpattern files for my main domain site installation

The addon domain is set up the same way, just within a folder inside public_html/addondomainfolder/

Below, I am attempting to visualize what the directory would need to look like if I were to install 4.2.0:

Textpattern site for my main domain:

/home/maindomainusername/public_html/
	admin/ _with setup/, theme/, txp_img/, index.php, jquery.js, textpattern.css, textpattern.js_
	public/ _with admin/, files/, images/, setup/, theme/, css.php, index.php
	private/ config.php
	textpattern/ with all of the textpattern 4.2.0 files for use by all of the sites -- not sure if I would need to remove index.php from this folder?
	css.php <- for use by all of the sites
	.htaccess <- not sure if this would be used for all of the sites and/or to specially redirect to the primary domain's /public folder or something?
	index.php <- not sure if this should be here or if it should be deleted?

Second Textpattern site for an addon domain:

/home/maindomainusername/public_html/addondomainfolder/
	admin/ with setup, theme, txp_img, index.php, jquery.js, textpattern.css, textpattern.js
	public/ with admin, files, images, setup, theme, css.php, index.php
	private/ config.php

Am I close in visualizing the site directory structure? Thanks!

Last edited by photonomad (2009-09-08 23:55:48)

Offline

Board footer

Powered by FluxBB