Difference between revisions of "PKP/OJS/Install Software/After"

From Libopedia
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
  '''[[PKP/OJS/Install Software|Back to OJS Installation]]'''
 
  '''[[PKP/OJS/Install Software|Back to OJS Installation]]'''
 
</center>
 
</center>
 +
__TOC__
  
==Enable Journal Proxy==
+
==Enable clean URLs without "index.php" - Optional==
 +
To force OJS to remove the "index.php" portion of all URLs, edit config.inc.php and set "restful_urls" to "On".
 +
sudo nano /var/www/config.inc.php
 +
'''OR'''
 +
sudo nano /var/www/html/config.inc.php
 +
 
 +
Then enable the "mod_rewrite" module;
 +
sudo a2enmod rewrite
 +
Then create the ".htaccess" file;
 +
sudo nano /var/www/.htaccess
 +
'''OR'''
 +
sudo nano /var/www/html/.htaccess
 +
Copy and paste the following;
 +
<pre>
 +
  <IfModule mod_rewrite.c>
 +
  RewriteEngine on
 +
  RewriteCond %{REQUEST_FILENAME} !-d
 +
  RewriteCond %{REQUEST_FILENAME} !-f
 +
  RewriteRule ^(.*)$ index.php/$1 [QSA,L]
 +
  </IfModule>
 +
</pre>
 +
 
 +
Save and exit the file.
 +
 
 +
Then update file ownership;
 +
sudo chown www-data.root /var/www/.htaccess
 +
'''OR'''
 +
sudo chown www-data.root /var/www/html/.htaccess
 +
 
 +
==Restart the web server and lock down the config file==
 +
Restart the Apache2 web server.
 +
sudo service apache2 restart
 +
 
 +
Type the following to "lock-down" the OJS config file.
 +
chmod 0644 /var/www/html/config.inc.php
 +
 
 +
==Enable Journal Proxy - Only for Stellenbosch University==
 
;Setup Squid
 
;Setup Squid
 
Add the journal ip address to ''openjournals'' rule on the SQUID server on ez.sun.ac.za.
 
Add the journal ip address to ''openjournals'' rule on the SQUID server on ez.sun.ac.za.
Line 37: Line 74:
 
; proxy_password = password
 
; proxy_password = password
 
</pre>
 
</pre>
 
==Fix URL's==
 
===Setup the default "pub" journal URL for single instance journal publishing===
 
Login as the site admin and create the default journal as '''pub'''. See screenshot below.
 
 
[[File:Ojs-default-pub.png|border]]
 
 
Go to site settings and setup default redirection. Also amend the journal title. See screenshot below.
 
 
[[File:Ojs-default-redirect.png|border]]
 
 
===Remove "index.php" from the journal URL===
 
Refer to: http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=3546
 
 
Open the config file.
 
nano /var/www/config.inc.php
 
Enable restful URL's. See example below.
 
<pre>
 
; Generate RESTful URLs using mod_rewrite.  This requires the
 
; rewrite directive to be enabled in your .htaccess or httpd.conf.
 
; See FAQ for more details.
 
restful_urls = On
 
</pre>
 
Download the following and save as '''.htaccess''' in '''/var/www'''.
 
nano /var/www/.htaccess
 
 
<pre>
 
<IfModule mod_rewrite.c>
 
  RewriteEngine on
 
  RewriteCond %{REQUEST_FILENAME} !-d
 
  RewriteCond %{REQUEST_FILENAME} !-f
 
  RewriteRule ^(.*)$ index.php/$1 [QSA,L]
 
</IfModule>
 
</pre>
 
 
chown www-data.root /var/www/.htaccess
 
 
===Fix base URL's===
 
To ensure all links only reference one journal URl the base URL must be setup twice.
 
 
Open the config file.
 
nano /var/www/config.inc.php
 
Setup the base URl's as per examples below.
 
 
First the main site URl.
 
<pre>
 
; The canonical URL to the OJS installation (excluding the trailing slash)
 
base_url = "http://sajie.journals.ac.za"
 
</pre>
 
 
Then the "index" URL.
 
<pre>
 
; Base URL override settings: Entries like the following examples can
 
; be used to override the base URLs used by OJS. If you want to use a
 
; proxy to rewrite URLs to OJS, configure your proxy's URL here.
 
; Syntax: base_url[journal_path] = http://www.myUrl.com
 
; To override URLs that aren't part of a particular journal, use a
 
; journal_path of "index".
 
; Examples:
 
base_url[index] = http://sajie.journals.ac.za
 
; base_url[myJournal] = http://www.myUrl.com/myJournal
 
; base_url[myOtherJournal] = http://myOtherJournal.myUrl.com
 
</pre>
 
 
==Restart the web server and lock down the config file==
 
Restart the Apache2 web server.
 
/etc/init.d/apache2 restart
 
 
Type the following to "lock-down" the OJS config file.
 
chmod 0644 /var/www/config.inc.php
 
  
 
==Notes==
 
==Notes==
Line 114: Line 81:
 
*http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=7578
 
*http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=7578
 
*http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=12175
 
*http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=12175
 +
*https://github.com/pkp/ojs/blob/master/docs/FAQ
 
*http://stackoverflow.com/questions/18934304/mod-rewrite-to-get-rid-of-index-php
 
*http://stackoverflow.com/questions/18934304/mod-rewrite-to-get-rid-of-index-php

Latest revision as of 16:53, 26 July 2016

Back to OJS Installation

Enable clean URLs without "index.php" - Optional

To force OJS to remove the "index.php" portion of all URLs, edit config.inc.php and set "restful_urls" to "On".

sudo nano /var/www/config.inc.php

OR

sudo nano /var/www/html/config.inc.php

Then enable the "mod_rewrite" module;

sudo a2enmod rewrite

Then create the ".htaccess" file;

sudo nano /var/www/.htaccess

OR

sudo nano /var/www/html/.htaccess

Copy and paste the following;

  <IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ index.php/$1 [QSA,L]
  </IfModule>

Save and exit the file.

Then update file ownership;

sudo chown www-data.root /var/www/.htaccess

OR

sudo chown www-data.root /var/www/html/.htaccess

Restart the web server and lock down the config file

Restart the Apache2 web server.

sudo service apache2 restart

Type the following to "lock-down" the OJS config file.

chmod 0644 /var/www/html/config.inc.php

Enable Journal Proxy - Only for Stellenbosch University

Setup Squid

Add the journal ip address to openjournals rule on the SQUID server on ez.sun.ac.za.

Ask Natasja/Wouter/Hilton to add this address using the web interface to ez.sun.ac.za.

Setup Ubuntu Server

Then do the following on the journal:

sudo nano /etc/environment

Add the following to the bottom of the file.

http_proxy=http://ez.sun.ac.za:3128/
https_proxy=http://ez.sun.ac.za:3128/
HTTP_PROXY=http://ez.sun.ac.za:3128/
HTTPS_PROXY=http://ez.sun.ac.za:3128/

Save and exit nano.

Setup OJS

Modify the config file and add the proxy settings. See example below.

;;;;;;;;;;;;;;;;;;
; Proxy Settings ;
;;;;;;;;;;;;;;;;;;

[proxy]

; Note that allow_url_fopen must be set to Off before these proxy settings
; will take effect.

; The HTTP proxy configuration to use
http_host = ez.sun.ac.za
http_port = 3128
; proxy_username = username
; proxy_password = password

Notes

We will be moving to a federated system. Below are links to pages regarding rewrites/redirection instructions for custom journal URL's.