Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Running 2 copies on server using subdomains  (Read 1528 times)

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Running 2 copies on server using subdomains
« on: January 31, 2011, 03:09:38 PM »

Need a little guidance if you will.....

I've set up a subdomain for a second copy of snews. I have uploaded the files to a designated folder on the the server where the subdomain points. The main route of the domain currently holds my own website running 1.6 SU, the new site will be in a folder running 1.6MU. After changing all the internal links so that the css and image files pointed to the correct folders ( /subdomainname/images/myimage.jpg) i got the site up plus created database etc. Trouble is I am not sure what i need to do to run the site  - clicking on links takes me to my other SU site, therefore I need to change the setting somewhere - I assume the htaccess file?  Any help would be great.....

Thanks

alks
« Last Edit: January 31, 2011, 05:13:26 PM by alks »
Logged

pearjam

  • Full Member
  • ***
  • Karma: 14
  • Posts: 152
Re: Running 2 copies on server using subdomains
« Reply #1 on: January 31, 2011, 03:33:28 PM »


I'm guessing in the .htaccess file for the subdomain, you would change the "RewriteBase" line to point to where the subdomain's snews.php engine file is.

If using a relative path (like /subdomain) doesn't work, try an absolute path too (like /var/www/html/subdomain).

It's just a guess, I haven't tried it yet.
Logged
....I must go, for I am their leader - and they have gone.

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: Running 2 copies on server using subdomains
« Reply #2 on: January 31, 2011, 03:55:27 PM »

thanks pearjam, i had added the rewrite base in, but have just added the folder name to the main snews file so
$db['website'] = 'htp://www.mywebsite.com/'; becomes $db['website'] = 'htp://www.mywebsite.com/project1/';

and this seams to have the site up and running except now I cant add anything to the database - so i can log in and view pages but not change anything? If i try and add a page it says it has done it but there is no page there!

Any other settings i've missed?

**update** I can add new categories and update the snews calendar (keyrocks mod) fine its just I cant update the pages, content or extra content. It says "operation successful" but then it says no content. Mmm....
« Last Edit: January 31, 2011, 05:24:23 PM by alks »
Logged

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: Running 2 copies on server using subdomains
« Reply #3 on: January 31, 2011, 08:06:53 PM »

Well i've tested for a few hours and cant figure it out at the moment. The website is running in the sub folder - I can log in and i can view all the pages. It just wont save any changes when creating new pages, articles or extra content. Everything else appears to work fine. Not sure why.....
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Running 2 copies on server using subdomains
« Reply #4 on: January 31, 2011, 11:02:45 PM »

When you want to run more installations of sNews on an existing domain, just install the complete file-sets for each in folders on your domain root.
These are not really sub-domains.
A true sub-domain for snews16mu would be located at http:// snews16mu.yourdomain.com.
In this case, we're actually accessing a sub-site within a domain - at http:// yourdomain.com/snews16mu/

1.  You have already created the folder for your sub-site in the domain root.
2.  Copy the complete file-set into the sub-site folder.
3.  Configure the databse settings for the database you are connecting to.
4.  Open the .htaccess file... remove the #-sign from the #RewriteBase string to enable it.
     Change the part after the forward-slash to the name of the folder your files are installed in - /snews16mu - if that's what it is.

5. Point your browser to the folder location - http:// yourdomain.com/snews16mu/ (using the same example) - and you'll get the home page.
    Everything should work.

There should be no need for any other changes anywhere.  :)
« Last Edit: January 31, 2011, 11:04:51 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: Running 2 copies on server using subdomains
« Reply #5 on: January 31, 2011, 11:23:35 PM »

Thanks Doug,

I have done all of this and the site works fine now except I cannot create new content in pages, articles or extra contents. It says "operation successful" but there is no new content when I look - I am however able to update the snews calendar and create new categories as well as change the site settings etc.
I have created a subdomain on the server using the main hosting account panel (create sub domain was an option) but in effect all it does is point to a designated folder on the server which I have set up and put the snews files in.

So everything should work but I think there is something still not set correctly....
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Running 2 copies on server using subdomains
« Reply #6 on: February 01, 2011, 04:06:12 AM »

Exactly, what package did you download and install? I could try installing the same package for test-running on my localhost.
Did you make any modifications or changes to it other than configuring the database settings and the .htaccess file?
Did you create a new, second database and table-set for this specific install, in addition to the one for your existing site?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: Running 2 copies on server using subdomains
« Reply #7 on: February 01, 2011, 11:28:57 AM »

Well I slept on it, woke up this morning and the answer just popped into my head the second I woke up - just as if my brain secretly worked on the solution while asleep!
My snewsMU contains a lot of mods so is non standard but recently I had added the user only mod to make area of the site only viewable by logged in users (to another install). What I had done was use a previous SQL file that didn't include the new table line for that mod but the snewsMU file I used did include the code for it (as I had used the files from the other site)- so naturally it would not work. Now everything works. I just have to set up the zen photo pages up correctly now (hopefully that will work without any hitches).

thanks for the help,

**edit I have noticed that my two sites running on that domain now seam to run much slower....lots of page hanging ?? - I might have to set up a new account anyway if the slowness continues :(  for a while both sites wouldn't connect to the databases but now ok**
**50 post for me! junior member now**
alks
« Last Edit: February 01, 2011, 04:01:56 PM by alks »
Logged