Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-11-04 04:33:45

acleese
New Member
Registered: 2009-05-04
Posts: 8

Anyone have multisite working on Bluehost?

I’ve had a frustrating couple of days trying to convert to a multisite setup from a working TXP install on Bluehost, and I feel like I’m very close, but patience is waning. I’ve thoroughly read every multisite tutorial and forum posting that I could find.

I believe my problems stem from .htaccess. Images won’t load, links to sections don’t work and CSS is not loading. My separate admin area (admin.orphanride.org) appears to be working well.

Does anyone out there know the trick to getting the .htaccess file to work properly on Bluehost since virtual host configuration is not possible? My understanding of the cryptic .htaccess syntax has not improved much from reading the poorly-written manuals available online.

Below is my .htaccess (in /public_html, the former web root directory for my main site). The same file is symlinked from public_html/sites/orphanride.org/public.

My diagnostics:

Textpattern version: 4.4.1 (r3575)
Last Update: 2011-11-01 02:41:08/2011-11-04 01:58:32
Document root: /home6/orphanri/public_html/sites/orphanride.org/admin
$path_to_site: /home6/orphanri/public_html/sites/orphanride.org/public
Textpattern path: /home6/orphanri/public_html/textpattern
Permanent link mode: section_title
Temporary directory path: tmp
Site URL: www.orphanride.org
PHP version: 5.2.17
GD Image Library: version bundled (2.0.34 compatible), supported formats: GIF, JPG, PNG
Server TZ: America/Denver
Server Local Time: 2011-11-03 21:42:00
DST enabled?: 1
auto_dst: 0
Time Zone: Asia/Singapore (28800)
MySQL: 5.1.58-community-log
Locale: English_United States.1252
Server: Apache
PHP Server API: cgi-fcgi
RFC 2616 headers: 0
Server OS: Linux 2.6.32-46.1.BHsmp
Active plugins: rss_google_map-0.5, ob1_pagination-2.5m, upm_savenew-0.4.2
theme_name: classic 4.4.1

Pre-flight check:
————————————
File directory path is not writable: home6/orphanri/public_html/sites/orphanride.org/public/files
Temporary directory path is not writable: tmp
Missing files: /home6/orphanri/public_html/textpattern/../index.php
Site URL preference might be incorrect: admin.orphanride.org
Clean URL test failed.
————————————

#DirectoryIndex index.php index.html

# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
#Options -Indexes
#ErrorDocument 403 default

Redirect 301 /textpattern http://admin.orphanride.org

<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /relative/web/path/

	#Bluehost-supplied config
	RewriteCond %{HTTP_HOST} ^(www.)?orphanride.org$
	RewriteCond %{REQUEST_URI} !^/sites/orphanride.org/public/

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d

	RewriteRule ^(.*)$ /sites/orphanride.org/public/$1
	RewriteCond %{HTTP_HOST} ^(www.)?orphanride.org$
	RewriteRule ^(/)?$ sites/orphanride.org/public/index.php [L]
	#END Bluehost-supplied config

	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

	RewriteCond %{REQUEST_URI} !=/favicon.ico
	RewriteRule ^(.*) index.php
	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

#php_value register_globals 0

Last edited by acleese (2011-11-04 04:56:40)

Offline

#2 2011-11-04 14:32:50

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Anyone have multisite working on Bluehost?

Hi acleese.

I don’t know the specifics of Bluehost.
Questions

1) are you trying to use the multi-install setup to serve TXP-powered websites on different domains? That will be difficult if your current BH plan doesn’t let you host & serve more than one domain (i.e. serving different websites by pointing the vhosts to different DocumentRoots).

2) Or are you trying to use the multi-install setup to serve TXP-powered websites on different subdomains of orphanride.org (like client1.orphanride.org, secretproyect.orphanride.org, dev.orphanride.org, and so on)? In this case, you may be more likely to succeed, as, probably, your BH plan lets you create subdomains and point them to different DocumentRoots.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2011-11-04 14:37:33

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Anyone have multisite working on Bluehost?

BTW, by looking at those BH-supplied config, I see you are trying to achieve something similar to this:
http://www.bluehostforum.com/showthread.php?8992-VirtualHost-and%5Cor-mod_rewrite

Which seems to me like a mod_rewrite trick to “change” the DocumentRoot when you don’t have access to vhost configuration files.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2011-11-04 14:57:51

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Anyone have multisite working on Bluehost?

Am I wrong or with that mod_rewrite trick (see link in above post) you could simulate “vhosts” on cheap-one-domain-only hosting plans?

In other words, you could have a cheap hosting plan (that usually allows hosting just one domain but parking many) and by testing {HTTP_HOST}, you could serve different websites from different subfolders (being this folders the “document root”), depending on the domain accessed.

If that trick is possible, then it makes me feel a bit dumb(er)…


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2011-11-05 06:00:57

acleese
New Member
Registered: 2009-05-04
Posts: 8

Re: Anyone have multisite working on Bluehost?

Hi Maniqui, my bluehost account allows for unlimited domains, so I’m not trying to get around any rules. If you look at my .htaccess file above you’ll notice that the script between the comments “#Bluehost-supplied config” and “END #Bluehost-supplied config” has the exactly the same content (but with my directory structure) as the one you linked to, so it should work. This is the .htaccess script that Bluehost says will allow you to move you’re main site to another directory with. Instructions found here, but the same sample file can be found in bluehost’s how-tos.

So far I have three domains running on this account, but only main main site has been using textpattern. I want to rebuild one of the other sites on textpattern but the multisite setup is giving me too many headaches. Everything, symlinks included, are setup correctly as far as I can tell. I’m about to give up and revert back a to single-site TXP.

Last edited by acleese (2011-11-05 06:35:46)

Offline

#6 2011-11-05 09:10:36

acleese
New Member
Registered: 2009-05-04
Posts: 8

Re: Anyone have multisite working on Bluehost?

I’ve added “RewriteBase /sites/orphanride.org/public” to the .htaccess and now the section links work, but still no images or CSS. The reason for this is that when <txp:css /> is used in the document template it shows that the path is “http://ww.orphanride.org/css.php=?default,” which is correct, but the css.php file that is accessed is the one in my /public_html/ folder, not the one in my public_html/sites/orphanride.org/public/ folder! This results in no inclusion of the public_html/sites/orphanride.org/private/config.php and therefore no access to the database to retrieve the CSS data.

To test this I made a symlink in my public_html/textpattern/ folder to my public_html/sites/orphanride.org/private/config.php and then CSS worked, but of course this is not the way it should be setup if you want multiple sites running.

Also, I made a symlink in public_html/ to html/sites/orphanride.org/public/images and now pics are showing up on the site, but, AGAIN, this is not going to work for a multisite-setup.

So, even though path_to_site is correct (…/sites/orphanride.org/public) and the .htaccess is correctly using mod_rewrite to get to the proper public_html/sites/orphanride.org/public/index.php, it’s not doing it’s job for the public_html/sites/orphanride.org/public/ as a whole!

Are there any .htaccess experts in the house?

Offline

#7 2011-11-05 15:08:42

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Anyone have multisite working on Bluehost?

my bluehost account allows for unlimited domains, so I’m not trying to get around any rules.

So, what about correctly setting up each domain to point to the correct DocumentRoot? (This is probably done via the BH interface, I doubt you would have to toy with vhost config files directly).
Like:

For domain orphanride.org, the document root should be: /home6/orphanri/public_html/sites/orphanride.org/public
For domain somedomain.org, the document root should be: /home6/orphanri/public_html/sites/somedomain.org/public
For domain anotherdomain.org, the document root should be: /home6/orphanri/public_html/sites/anotherdomain.org/public

And so on.

Also, the #Bluehost ... #END Bluehost trick may not be helping in this situation, but interfering.

Also, if you could print your files/folders structure using tree, it could help to have a better idea on how things are organized there.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2011-11-06 04:36:11

acleese
New Member
Registered: 2009-05-04
Posts: 8

Re: Anyone have multisite working on Bluehost?

Yes, that’s the directory structure that I’m trying to use. The .htaccess should redirect my document root folder to sites/orphanride.org/public, but it’s not. Bluehost recommends that the .htaccess be used for this and there isn’t a way to redirect the domain to a subfolder within cPanel (as far as I can tell). Maybe I should take this up with Bluehost.

My structure:

public_html/
                    sites/
                             orphanride.org/
                                                      admin/ (symlinks to jquery.js, etc)
                                                      private/ (config.php)
                                                      public/ (index.php, css.php, symlink to .htaccess in document root, etc.)
                                                                  images/
                                                                  files/
                                                                  tmp/
                             site2/ ...

                    textpattern/
                    .htaccess, css.php, etc...

Last edited by acleese (2011-11-06 05:58:40)

Offline

#9 2011-11-06 05:44:29

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Anyone have multisite working on Bluehost?

acleese wrote:

Bluehost recommends that the .htaccess be used for this and there isn’t a way to redirect the domain to a subfolder within cPanel (as far as I can tell). Maybe I should take this up with Bluehost.

It would be the best to set Document root to correct path in Apache’s configs, or using file system functions (i.e. symbolic links) to direct document root directory to correct location.

That kind of nonsense using RewriteRule module isn’t recommended. Even if it was working, all it’s doing is adding extra strain to server and limiting possibilities.

Offline

#10 2011-11-06 15:31:30

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Anyone have multisite working on Bluehost?

Hi acleese

Bluehost recommends that the .htaccess be used for this and there isn’t a way to redirect the domain to a subfolder within cPanel (as far as I can tell). Maybe I should take this up with Bluehost.

If that’s the way BH supports unlimited domains (via an .htaccess trick instead of a proper way of configuring the virtual host’s DocumentRoot), I’d say that, well, it may be a bit more complicated to arrive to a working, correct setup.
So, check again the cPanel or BH documentation or ask BH support, because the “unlimited domains” support may just be a “unlimited parked domains”.

That being said, you may want to try a cleaner approach to this, separating the “concerns” of the different .htaccess files.
First, on /public_html/.htaccess, just leave the Bluehost-supplied config lines, one for each domain.
Something like this:

	RewriteEngine On

	#Bluehost-supplied config for first domain.
	RewriteCond %{HTTP_HOST} ^(www.)?orphanride.org$
	RewriteCond %{REQUEST_URI} !^/sites/orphanride.org/public/
	RewriteCond %{REQUEST_FILENAME} !-f [OR]
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ /sites/orphanride.org/public/$1

	RewriteCond %{HTTP_HOST} ^(www.)?orphanride.org$
	RewriteRule ^(/)?$ sites/orphanride.org/public/index.php [L]
	#END Bluehost-supplied config

        ###

	#Bluehost-supplied config for second domain.
	RewriteCond %{HTTP_HOST} ^(www.)?somedomain.org$
	RewriteCond %{REQUEST_URI} !^/sites/somedomain.org/public/
	RewriteCond %{REQUEST_FILENAME} !-f [OR]
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ /sites/orphanride.org/public/$1

	RewriteCond %{HTTP_HOST} ^(www.)?somedomain.org$
	RewriteRule ^(/)?$ sites/somedomain.org/public/index.php [L]
	#END Bluehost-supplied config


        ###

	#Bluehost-supplied config for third domain.
	RewriteCond %{HTTP_HOST} ^(www.)?anotherdomain.org$
	RewriteCond %{REQUEST_URI} !^/sites/anotherdomain.org/public/
	RewriteCond %{REQUEST_FILENAME} !-f [OR]
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ /sites/orphanride.org/public/$1

	RewriteCond %{HTTP_HOST} ^(www.)?anotherdomain.org$
	RewriteRule ^(/)?$ sites/anotherdomain.org/public/index.php [L]
	#END Bluehost-supplied config

Just that, nothing else on the .htaccess at public_html/.

Now, don’t symlink to it from /public_html/sites/orphanride.org/public/.

Instead, on /public_html/sites/orphanride.org/public/, and /public_html/sites/somedomain.org/public/, and /public_html/sites/anotherdomain.org/public/ just put the standard .htaccess file provided by TXP. That is:

<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /relative/web/path/

	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

	RewriteCond %{REQUEST_URI} !=/favicon.ico
	RewriteRule ^(.*) index.php

	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

And yell us how it went.

I really don’t have any idea if that will work. I don’t even know if .htaccess files on public_html/sites/[domain]/public files will have any effect at all, as for how the sites are being served.
You may want to have Apache documentation at hand:
http://httpd.apache.org/docs/2.2/
mod_rewrite


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2011-11-06 17:12:38

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

Re: Anyone have multisite working on Bluehost?

and there isn’t a way to redirect the domain to a subfolder within cPanel (as far as I can tell). Maybe I should take this up with Bluehost.

For additional domains you can do this if Bluehost lets you set the document root using cpanel’s Add-on Domain functionality.

But I haven’t found a way to do the same for the primary domain with cpanel. It does seem to be a common problem that has been discussed but as yet seems to be unresolved. It’s unfortunate given that many shared hosts don’t provide access to the httpd.conf / virtual host files.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2011-11-07 02:49:29

acleese
New Member
Registered: 2009-05-04
Posts: 8

Re: Anyone have multisite working on Bluehost?

Hi maniqui – I tried out your suggestion but to no avail. I’m going to give up on mod_rewrite for now. The .htaccess should work as far as I can tell since I can now understand the syntax to some extent. Thanks for for the help in any case!

I forgot to mention, though it matters little, that add-on domains are each given their own folder in the document root, so they would need their own .htaccess (if it worked) or redirection to public_html/sites/addondomainX/public.

I’ll see if there’s anything that can be done in cPanel and if not…well, I suppose I might try to do a separate TXP install in each add-on domain folder.

Offline

Board footer

Powered by FluxBB