Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-09-06 17:18:43
- aesop1
- Archived 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
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
- Archived 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
Re: Sites outside main TXP directory (multisite install)
As promised:
Offline
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?
Offline
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
Re: Sites outside main TXP directory (multisite install)
sassy!
Offline
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
?
Offline
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 ofweb
?
No.
Offline
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
Re: Sites outside main TXP directory (multisite install)
photonomad wrote:
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)?
I don’t use Bluehost, but according to their site they are Linux-based and offer ssh shell access, so the script should work.
The script does not address subdomain setups like yours, where subdomains are subdirectories in your main site directory. I’m not too fond of setups like this, as they force the entire subdomain to be publicly browsable and I prefer to put config.php outside of the web root for better security.
The script should work fine for your main domain, except that it will want to use “public” where your setup uses “public_html”. I’ll see about making that configurable in the next version.
Offline
Re: Sites outside main TXP directory (multisite install)
I think I follow what you are saying about the shell script and I appreciate all of your efforts. I will play around with it in Bluehost
artagesw wrote:
I prefer to put config.php outside of the web root for better security.
I do have a question about the config.php security issue (inside vs. outside the web root). The installation instructions for 4.2.0 (and all earlier Textpattern versions that I can remember) say to: “Extract the files to your site (in the web root, or choose a subdirectory). The top-level index.php should reside in this directory, as should the /textpattern/ and the /rpc/ directory.”
I’ve never explored the option of placing config.php outside of the web root, but I imagine I might be able to do it in Bluehost. I do have access to the directory above public_html. I will search and see if there are any forum topics or TXP Tips related to this — if you or anyone reading this has any advice on the topic, please let me know. Thanks!
Offline