One server-5 blogs-5domains-root and 4 subfolders

Having trouble installing serendipity?
Post Reply
kaution
Posts: 4
Joined: Tue Oct 06, 2009 12:53 pm

One server-5 blogs-5domains-root and 4 subfolders

Post by kaution »

I tried for hours looking this up, so I apologize if I missed it.

I am very pleased with serendipty! I do not want to run wordpress under any circumstances.

I have a shared hosting account at godaddy and I want to run 5 serendipity blogs off of one account.

I got one install in the root. Then I have four folders in the root each with it's own domain name and sql data base.

The problem is, I cannot install more than one copy of seredipity! I think it keeps looking for the root rather than staying within the boundries of the created folder with it's own domain. Can some one please help me with this?

I really want to use serendipity!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: One server-5 blogs-5domains-root and 4 subfolders

Post by garvinhicking »

Hi!

Which serendipity version do you use?

I believe this is a problem of GoDaddy subdomains. They have a way to redirect domains without changing $_SERVER['DOCUMENT_ROOT'] to point to the actual domain!

For that to work, you would need to either create a global php_prepend file (through .htaccess), or you would need to patch the serendipity_config.inc.php file and set $_SERVER['DOCUMENT_ROOT'] depending on your subdirectory, instead of relying on what GoDaddy specifies inside that variable.

Does that make sense to you? :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
kaution
Posts: 4
Joined: Tue Oct 06, 2009 12:53 pm

Re: One server-5 blogs-5domains-root and 4 subfolders

Post by kaution »

Thank you for the quick reply. :D

The version I'm running is 1.4.1 and all 5 blogs will be a fresh install.

Abiut your advice, I'm so sorry, I don't understand. I saw another thread something about what you was saying but couldn't get it to work.

Also, just so you know, the four subfolders are not sub domains, they have top level domains pointing at them. example below.

Root-yoursite.com

Folder1-yoursite2.com

Folder1-yoursite3.com

Folder1-yoursite4.com

Folder1-yoursite5.com

Thank you so much for your patience. I'm learning. he he
kaution
Posts: 4
Joined: Tue Oct 06, 2009 12:53 pm

Re: One server-5 blogs-5domains-root and 4 subfolders

Post by kaution »

O.K. I think I got it! I modified if (@file_exists($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php')) {
$local_config = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php';
} elseif (defined('S9Y_DATA_PATH')) {
to

if (@file_exists($_SERVER['ts'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php')) {
$local_config = $_SERVER['ts'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php';
} elseif (defined('S9Y_DATA_PATH')) {


(The "ts" is the name of the subfolder with the top domain pointed at it)

Next, I got this warning but ignored it

Verify Installation Integrity
serendipity_config.inc.php corrupt or modified: failed verification [?]

Then in expert install mode I modified the "Full Path" from

"/var/chroot/home/content/#/#/#/#########/html/" to

"/var/chroot/home/content/#/#/#/#########/html/ts/"

Everything appears to be in order, a few questions though.
Will this make any of the given websites less secure?

And why was there no htaccess file created in the "ts" directory? Should I copy and paste the htaccess from the root to all the subfolders or is the root htaccess all that is needed even though theres is the four subfolders with top domains as my blogs?

Hope I was detailed enough.

Thank you for your time.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: One server-5 blogs-5domains-root and 4 subfolders

Post by Don Chambers »

Garvin and others have already forgotten more than I will ever know about server stuff, but why do I get the feeling that you would not have to jump through all of these hoops if that top level installation did not exist at all, and it too was in a folder? Is that possible?
=Don=
kaution
Posts: 4
Joined: Tue Oct 06, 2009 12:53 pm

Re: One server-5 blogs-5domains-root and 4 subfolders

Post by kaution »

I appreciate the reply, but I still need to know if my sites are safe doing it this way. If not I have to move on. I try to be descriptive as possible as I know people lead busy lives. I'm assuming the "one" htaccess file will cover the other domains and folders on the same account as far as security. Am I right? I know I will have to put an individual htaccess file in each folder for each domain for protection against hot linking for each individual domain. I'm not one of those that expect everyone to do things for me like most do, I spend hours working with this stuff, but I can't know everything.

It would appear that what I have done has worked. Please tell me what's the best way to secure these sights. It also wouldn't hurt to make a list of directory permission for newbies. I came here to seredipity because I don't trust wordpress. I hope I don't have to resort to creating each individual html page per blog post! lol

Again, I know you all are busy, thanks for your time.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: One server-5 blogs-5domains-root and 4 subfolders

Post by garvinhicking »

Hi!

The best patch would be, if you modify your serendipity_config.inc.php and at the very top after <?php add code like this:

Code: Select all

if ($_SERVER['HTTP_HOST'] = 'www.domain1.com') {
    $_SERVER['DOCUMENT_ROOT'] = '/var/chroot/home/content/#/#/##########/html/domain1/';
}

if ($_SERVER['HTTP_HOST'] = 'www.domain2.com') {
    $_SERVER['DOCUMENT_ROOT'] = '/var/chroot/home/content/#/#/##########/html/domain2/';
}

if ($_SERVER['HTTP_HOST'] = 'www.domain3.com') {
    $_SERVER['DOCUMENT_ROOT'] = '/var/chroot/home/content/#/#/##########/html/domain3/';
}
Replace the proper paths and domain names, of course. This will adjust the DOCUMENT_ROOT variable to point to what your provider actually let it point to in first instance. Then you don't need the patch you did initially, because it only fixes one specific error but leaves others intact, that rely on DOCUMENT_ROOT.

By properly adjusting DOCUMENT_ROOT you don't need anything else, and you can use Serendipity safely in all aspects. Also the .htaccess file should then be properly created.

I wasn't too verbose in my first posting because you were quite descriptive, and I thought you were already quite into this. Sorry for that, I hope this precise code now helps you better.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply