Each journal with its own domain name

@Buyi_Li
Here is my mini HOWTO for configuring different domain names in a single OJS installation. They have been tested on Ubuntu 16.0.4 and a recent Open Suse, both running Apache 2.4.
Goal: You have a main journal platform (journals.uni-giessen.de) with some journals. The index.php in the URL should be stripped from all journals. Some of your journals are fine with staying on your main journal page. Others want to have their own domain (rmm-journal.de).

OJS is installed in /var/www/html/ojs

  • Activate the apache rewrite mod
  • Set up you apache hosts
    For the main journal platform:
<VirtualHost *:80>
	<Directory /var/www/html/ojs>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>
	ServerName journals.uni-giessen.de
	DocumentRoot /var/www/html/ojs
</VirtualHost>

For the journal that wants its own domain:

<VirtualHost *:80>
	<Directory /var/www/html/ojs>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>
	ServerName rmm-journal.de
	DocumentRoot /var/www/html/ojs
</VirtualHost>

The options in in directory clause are important. You also have to consider the servernames with www and port 443 configuration. For better overview i stripped this from the example

RewriteEngine On
RewriteBase /
## RMM has its own domain
RewriteCond %{SERVER_NAME} ^(www\.)?rmm-journal.de
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/rmm/$1 [QSA,L]
## test2 just index.php stripping
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^test2(.*)$ /index.php/test2/$1 [QSA,L]
## Mainsite of OJS with journal overview
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^index/(.*)$ /index.php/index/$1 [QSA,L]

I didn’t use RewriteCond %{REQUEST_FILENAME} !-d because it made some trouble and it seems to work without it.

  • Set up OJS config.inc.php. Here are the relevant lines that worked for me
base_url = "http://journals.uni-giessen.de"
...
base_url[index] = http://journals.uni-giessen.de/index
base_url[rmm] = http://rmm-journal.de
base_url[test2] = http://journals.uni-giessen.de/test2
...
restful_urls = On
  • Create an empty directory “index” in the ojs directory on the filesystem level /var/www/html/ojs/index I had to do this so that the OJS mainsite (with all the journals available on this ojs installation) works well with the rewrite rule.

Our OJS in not live yet but so far everything seems to be fine this way.

7 Likes