OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Individual Domain Name for Each Journal within ONE OJS inst.

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby renec » Fri Oct 17, 2008 6:07 pm

Hey Alec,

The URLs looked okay. They totally erased the /index.php from the URL. In other words, they look like the URLs on my perfectly working OJS installation (which is running a bit slow due to the rewrites, but I can probably clean it up a bit).
Perhaps part of this conversation should be moved to the OCS forum? I just realized that we are a bit off topic.
I will take a look at the Apache access logs, but what am I looking for? Also, mod_rewrite can be configured to develop its own log, as well as a variable level of logging.

Regards,
-Rene
renec
 
Posts: 24
Joined: Fri Jul 04, 2008 7:49 am
Location: Athens, Georgia

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby asmecher » Sun Oct 19, 2008 9:56 am

Hi Rene,

Yes, please start a new topic over in the OCS forum and we'll pick it up from there. If you've found logging options for mod_rewrite, I'd suggest enabling them -- this will help immeasurably in debugging which part of the puzzle is not working.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8479
Joined: Wed Aug 10, 2005 12:56 pm

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby renec » Sun Oct 19, 2008 10:35 am

Hey Alec,

The OCS version has been posted here:
viewtopic.php?f=3&t=3651

-Rene Cieszewski
renec
 
Posts: 24
Joined: Fri Jul 04, 2008 7:49 am
Location: Athens, Georgia

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby mbria » Tue Mar 10, 2009 9:47 am

Alec, let me say that your first answer to this post worth a "sticky". ;-)

I found your instructions clear and simple.
A really useful resource for those who like to personalize your multi-magazine OJS.

Thanks,

m.
mbria
 
Posts: 292
Joined: Wed Dec 14, 2005 4:15 am

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby asmecher » Tue Mar 10, 2009 9:24 pm

Hi mbria,

Thanks, will do!

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8479
Joined: Wed Aug 10, 2005 12:56 pm

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby netfunda » Sat Aug 08, 2009 11:51 pm

I don't know how many people understood the above discussion and could actually implement "Individual Domain name for each journal within one OJS installation". I undertook following steps and one can actually setup the server in 10 mins:

1. Register additional multiple domain names and set up A record to point to your server where OJS is installed, say http://www.myjournalservice.com. (with and without www)

2. Go to myjournalservice.com admin and create additional journals with journal path MYJOURNAL1, MYJOURNAL2 etc. (we will use http://www.myjournal1.com & http://www.myjournal2.com to access these journals)

3. Edit your httpd.conf to add virtual hosts:

Code: Select all
<VirtualHost YOUR_IP_ADDRESS:80>
    ServerName myjournal1.com
    ServerAlias www.myjournal1.com
    DocumentRoot /home/MYJOURNALSERVICE/public_html
    ServerAdmin webmaster@myjournalservice.com
    ## User publizer # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup MYJOURNALSERVICE MYJOURNALSERVICE
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup MYJOURNALSERVICE MYJOURNALSERVICE
    </IfModule>
    CustomLog /usr/local/apache/domlogs/myjournalservice.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    CustomLog /usr/local/apache/domlogs/myjournalservice.com combined
    Options -ExecCGI -Includes
</VirtualHost>

<VirtualHost YOUR_IP_ADDRESS:80>
    ServerName myjournal2.com
    ServerAlias www.myjournal2.com
    DocumentRoot /home/MYJOURNALSERVICE/public_html
    ServerAdmin webmaster@myjournalservice.com
    ## User publizer # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup MYJOURNALSERVICE MYJOURNALSERVICE
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup MYJOURNALSERVICE MYJOURNALSERVICE
    </IfModule>
    CustomLog /usr/local/apache/domlogs/myjournalservice.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    CustomLog /usr/local/apache/domlogs/myjournalservice.com combined
    Options -ExecCGI -Includes
</VirtualHost>


Replace "MYJOURNALSERVICE" with the cPanel username of the account on which OJS is installed and set up the correct DocumentRoot above.

Restart Apache Web Server


4. Edit config.inc.php of the OJS and set base_url

Code: Select all
; The canonical URL to the OJS installation (excluding the trailing slash)
;base_url = "http://www.myjournalservice.com" (Leave this commented)

base_url[MYJOURNAL1] = http://myjournal1.com (do not use www)
base_url[MYJOURNAL2] = http://myjournal2.com


5. Edit .htaccess file for OJS and set the following content:

Code: Select all
RewriteEngine On
RewriteBase /

# Check for and remove "www" if necessary
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Use this set of 3 lines for each of your journals
RewriteCond %{SERVER_NAME} ^myjournal1.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/MYJOURNAL1/$1 [L]

# Use this set of 3 lines for each of your journals
RewriteCond %{SERVER_NAME} ^myjournal2.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/MYJOURNAL2/$1 [L]

# Use this set of 3 lines to allow access to the main site
RewriteCond %{SERVER_NAME} ^myjournalservice.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/index/$1 [L]




..and you are done :)

Please write to me at ssrahman@netfunda.com for further help.

Thanks,
Rahman
netfunda
 
Posts: 14
Joined: Tue Jul 28, 2009 8:42 am

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby jamief » Mon Nov 16, 2009 2:07 am

Why do you need to work with ONE installation?

If you have 7 Journals, all from different fields, my gut feeling is in no case will there be ONE user ever needed in two journals (other than you!)

Why not make a single install, create a copy of that for each of the journals inside their respective domains, and create a corresponding mysql for each install.

7 Journals, 7 OJS installations. It might seem like a lot of work, but actually it isn't. And in the end, you have 7 separate dbases for the journals, giving you a set of smaller dbases, and LESS likelyhood of losing all seven journals if for some reason you have a mysql crash, corrupt session table, whatever.

Also doing mysql tinkering is much safer if you know which journal you are dealing with, and enter in that journal only. And for making CSV exports, you won't have to worry about which journal you are working with.

What is gained by one database? Administrator single sign-on. Anything else?
jamief
 
Posts: 140
Joined: Sun May 31, 2009 2:49 am

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby Doki » Thu Oct 07, 2010 1:50 pm

We played with having both setups on our server (we have 4 journals now in our system and climbing). Our ultimate answer was to use one instance of OJS vice several instances for four reasons:

1.) We tend to have a lot of crossover traffic between our journals and having one master account made logical sense.
2.) The same gentleman manages all four journals.
3.) Mods/fixes/etc. made for one of our journals tend to apply to all of them.
4.) Version release day is much easier

Of the four, #1 was the decision maker.

FYI, reasons we considered having several versions:
1.) mod_rewrite is simplified (well, as much as it could be....)
2.) XML/Smarty Template mods are much easier to coordinate
3.) Personal preference: I like storing the data for each journal in separate databases. Makes analyzing/working with the data through mysql/phpmyadmin much easier.

My guess is that crossover traffic and managerial setup will ultimately decide whether you have one or several instances of OJS....

D
Doki
 
Posts: 22
Joined: Mon Sep 27, 2010 7:41 am
Location: Villanova University, Pennsylvania, USA

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby swing » Fri Feb 11, 2011 5:32 am

Hello,

I am using OJS 2.3.4 and I have managed to configure everything correctly to use an individual domain for each journal -- I can access/view every journal as well as the site wide content using the appropriate domain but I can't log in and register at all and the search doesn't seem to function either :-( Has something changed in the meanwhile or am I doing something wrong?

Thanks!
swing
 
Posts: 140
Joined: Tue Oct 09, 2007 2:59 am

Individual Domain Name for Each Journal within MULTIPLE OJS

Postby mbria » Wed Apr 13, 2011 8:36 am

Hi fellows,

I don't know if I must open a different post or just follow the discussion here.
Alec, if you think is worth to open a new post, please, feel free to split this conversation.

I'm working on a new project at my university and we decided to go with one OJS per magazine.

We are working in some bash scripts to keep it simple, but now I'm stuck with RESTful urls.

The magazines' service will be the base URL (with a CMS on it) and each subdirectory will be a magazine with shared code (symbolic links) and specific config, htaccess, files and probably templeates.

So the structure will be:

http://service.mydomain.com --> cms
-- /magazine1 --> ojs-installation1
-- /magazine2 --> ojs-installation2

The point now is how to set up each .htaccess to redirect in the proper way.

I suppose the redirection need to be something like:
http://service.mydomain.com/magazine1/index --> http://service.mydomain.com/magazine1/i ... zine/index

As far as each magazine owns an OJS (and .htaccess) mod_rewrite need to be easy, but I'm unable to fix it.

Any comment, suggestion or RTFM to drive me in the right direction.

Cheers,
m.
mbria
 
Posts: 292
Joined: Wed Dec 14, 2005 4:15 am

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby mbria » Mon May 23, 2011 9:16 am

Sorry to bump... but no comments about this?

Thanks a lot for your help,
m.
mbria
 
Posts: 292
Joined: Wed Dec 14, 2005 4:15 am

Re: Individual Domain Name for Each Journal within ONE OJS inst.

Postby asmecher » Fri May 27, 2011 10:42 am

Hi all,

See http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=7578 for more on this subject.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8479
Joined: Wed Aug 10, 2005 12:56 pm

Re: Individual Domain Name for Each Journal within ONE OJS i

Postby annajonna » Fri Jul 26, 2013 1:34 pm

asmecher wrote:Hi Rene,

[CLIP]

In the OJS installation directory, create a .htaccess file with the following contents:
Code: Select all
RewriteEngine On
RewriteBase /

# Check for and remove "www" if necessary
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Use this set of 3 lines for each of your journals
RewriteCond %{SERVER_NAME} ^journal-domain-here
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/journal-path-here/$1 [L]

# Use this set of 3 lines to allow access to the site level
RewriteCond %{SERVER_NAME} ^site-domain-here
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/index/$1 [L]
...replacing "journal-domain-here" with the journal's domain name (e.g. "journal1.com"), journal-path-here with the path you used in the OJS "create journal" dialog box (e.g. "demo"), and "site-domain-here" with the domain name you're using to access site-level content (e.g. the Site Administrator's interface).

Now configure OJS so that it knows to use these URLs. Edit your configuration file, and in the "general" section, add a base_url[index] setting and a base_url[...] setting for each of your journal paths, e.g.:
Code: Select all
base_url[journal-path-here] = http://journal-domain-here
base_url[index] = http://site-domain-here
Regards,
Alec Smecher
Public Knowledge Project Team


I am setting up an OJS system and although I am a seasoned Linux sysadmin in web servers and databases, the OJS is rather new to me. I have used a few days searching for answers in this forum and tested lots of suggestions but to no avail. For now, I just need to get the base_url[index] setting to work. For testing purposes, I have stripped off the SSL I had configured and the journal domain. My installation has one journal, (there are more coming but I am just trying to backtrace to get the basic installation to work correctly) but at the moment it does not work at my site. In config.inc.php I have this:
Code: Select all
base_url = "http://ojs.mysite.is"
base_url[index] = "http://ojs.mysite.is"
restful_urls = Off

In the apache virtual server config i have the lines that were supposed to go into .htaccess .
Code: Select all
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Use this set of 3 lines to allow access to the site level
    RewriteCond %{SERVER_NAME} ^ojs.mysite.is
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /index.php/index/$1 [qsa,L]
</IfModule>


This seems to result in any URL being rewritten into /index.php/index/index . How can this be, and is this rewrite supposed to be applied to the journal machine itself? If not then what is the purpose of the base_url[index]?

The server header returns 200 OK and the server access_log looks completely normal, like nothing suspicious is going on.

Getting back to my original problem, I just need to know the OJS mod_rewrite requirements for base_url to work for a very basic setting like so:
Code: Select all
base_url[index] = https://ojs.mysite.is


Best regards, Anna.
annajonna
 
Posts: 3
Joined: Fri Jul 26, 2013 8:05 am

Re: Individual Domain Name for Each Journal within ONE OJS i

Postby asmecher » Fri Jul 26, 2013 2:12 pm

Hi Anna,

A quick few words about the way URL routing works in OJS might clarify things. OJS uses the CGI PATH_INFO variable to route requests, which means you'll see URLs with components showing up *after* the index.php script the request is interpreted through. Typically you'll see two or three things after the index.php: the journal, page, and operation. The journal component is used to identify which of potentially several journals is being requested, with "index" reserved for site-wide concerns that don't fall under any particular journal. The page and operation identify the code that's used to respond to that request, with page mapping to an index.php file in a subdirectory of the pages/ directory, and operation mapping to a function within one of the classes there. (If no operation is specified in the URL, the default function is called "index".

So it's legitimate to see a URL with [something]/index.php/index/index -- it means the page is not related to any single journal (the first "index") and the page being requested is the "index" page (i.e. the request will be handed by pages/index/index.php). The quest will eventually be handed off to the "index" function in pages/index/IndexHandler.inc.php.

This is the way OJS will handle things without any rewriting being used, and of course your configuration can modify that.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8479
Joined: Wed Aug 10, 2005 12:56 pm

Re: Individual Domain Name for Each Journal within ONE OJS i

Postby annajonna » Fri Jul 26, 2013 2:53 pm

asmecher wrote:Hi Anna,

[CLIP]

This is the way OJS will handle things without any rewriting being used, and of course your configuration can modify that.

Regards,
Alec Smecher
Public Knowledge Project Team


Thanks for the explanation. I still cant figure out how to configure OJS to get this working properly:
Code: Select all
base_url[index] = http://site-domain-here
Tried to set restful_urls = On but now i just get 404 .

Best regards, Anna
annajonna
 
Posts: 3
Joined: Fri Jul 26, 2013 8:05 am

PreviousNext

Return to OJS Technical Support

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 3 guests