Often times when we want to do an OJS upgrade we want our OJS site to be inaccessible.
The problem is, if there is an author who submits an article during the upgrade, then the submitted article will not be included because the database that was taken is the database before the upgrade, not during or after the upgrade.
Therefore we must make our site inaccessible to the creator. namely the maintenance of our OJS site pages.
Create a index.html file inside folder “maintenance” with a maintenance message #
Create a “maintenance” folder and create an index.html file in it
(Zip Located: D:\Folder Zul\Folder Journal\maintenance.zip)
You can try the default maintenance we provide as an example, Download template maintenance here.
Add a .htaccess in the OJS directory #
Create a file called “.htaccess” in your OJS folder and don’t forget to activate the “Show Hidden Files” option.
And then copy code below to your “.htaccess” file.
<IfModule mod_rewrite.c>
RewriteEngine on
# Our public IP address
RewriteCond %{REMOTE_ADDR} !^153\.216\.134\.10$
# Below are other people you want him to access the site as well.
RewriteCond %{REMOTE_ADDR} !^123\.2\.101\.21$
# All urls in your OJS that are accessed will be redirected to maintenance/index.html if they are not listed in RewriteCond% {REMOTE_ADDR}
RewriteRule ".*" "maintenance/index.html"
</IfModule>
Change the given red text to your ip by visit this link to get your public IP : What is My IP
Example of IP in What is My IP : 174.236.151.15
Before : !^153\.216\.134\.10$
After : !^174\.236\.151\.15$
Result #
Congratulations, you have successfully maintained your OJS!
If you want to turn off the maintenance, delete the “.htaccess” and the “maintenance folder” as well.
Troubleshoot #
Activate the mod_rewrite apache module #
First, open terminal. Then type this on terminal
sudo a2enmod rewrite
After that, restart apache
sudo service apache2 restart
And then try again.
Reference: https://forum.pkp.sfu.ca/t/how-to-limit-access-to-ojs-during-a-period/3528/3