Installation
This installation guide assumes you have setup and configured your centOS / RHEL server. For more information, refer to our Server Requirements & Setup section.
Download the latest version
cd /var/www/
git clone https://github.com/au-research/ANDS-Registry-Core.git core
# Make sure the following directory have write access open
chmod 754 -R /var/www/core/engine/logs
chmod 754 -R /var/www/core/engine/cache
chmod 754 -R /var/www/core/assets/uploads
Setup the database
Having installed a MySQL server, setup a new databases and initialise the tables:
mysql -u root -p
CREATE DATABASE dbs_roles;
CREATE DATABASE dbs_registry;
CREATE DATABASE dbs_portal;
If required, create a web user account and give it access:
CREATE USER 'webuser' IDENTIFIED BY '<yourpassword>';
GRANT SELECT, INSERT, UPDATE, DELETE ON dbs_roles.* TO 'webuser';
GRANT SELECT, INSERT, UPDATE, DELETE ON dbs_registry.* TO 'webuser';
GRANT SELECT, INSERT, UPDATE, DELETE ON dbs_portal.* TO 'webuser';
FLUSH PRIVILEGES;
Import the table structure:
mysql -u root -p dbs_roles < /var/www/core/etc/db/mysql/dbs_roles_r15_full.sql
mysql -u root -p dbs_registry < /var/www/core/etc/db/mysql/dbs_registry_r15_full.sql
mysql -u root -p dbs_portal < /var/www/core/etc/db/mysql/dbs_portal_r15_full.sql
Seed the database with the first role superuser|superuser:
mysql -u root -p dbs_roles < /var/www/core/etc/db/mysql/dbs_roles_r15.seed.sql
Download and configure the search indexer
We will be using SOLR 5.4.0, ignore this section if you already have a SOLR instance running in another container (eg. Tomcat):
cd /opt
wget http://archive.apache.org/dist/lucene/solr/5.4.0/solr-5.4.0.tgz
tar -xzvf solr-5.4.0.tgz
cd /opt/solr-5.4.0/
bin/solr start -p 8983
SOLR should now be running in http://localhost:8983/solr
ARDC is making use of the JTS library for spatial searching requirements. This library is available as a jar file from Maven Repository. The jts-1.13.jar
file needs to be placed within the directory /opt/solr-5.4.0/server/lib
directory
Adding the portal
collection and the relations
collection:
cd /opt/solr-5.4.0/
bin/solr create -c portal
bin/solr create -c relations
Update the SOLR schema for the portal and relations collection:
cd /var/www/core/
php index.php registry maintenance migrate doMigration registryIndex
php index.php registry maintenance migrate doMigration relationsIndex
The schema should be updated for http://localhost:8983/solr/portal/schema and http://localhost:8983/solr/portal/schema.
You can opt to install SOLR as a service for easy management.
Update the registry configuration
Update the global_config.php:
cp myrepo/global_config.sample myrepo/global_config.php
$eDBCONF['default']['password'] = '<yourpassword>';
$ENV['default_base_url'] = "http://yourwebsite.com/"; #include trailing slash!
// The SOLR URL is the URL of the search index core
$ENV['solr_url'] = "http://yourwebsite.com:8080/solr/";
Update the deployment state to production:
$ENV['deployment_state'] = "production";
In production mode, all scripts and assets should be pre-compiled and ready to go.
To operate in development mode, various dependencies need to be installed correctly. ARDC is making use of bower
and composer
as dependency managers:
cd applications/portal
bower install
cd applications/api
composer dump-autoload --optimize
Configure the web server .htaccess file:
This may require AllowOverride All in your web server configuration
Configure the web server httpd.conf file:
If you haven't done so already, change the DocumentRoot
in /etc/httpd/conf/httpd.conf
to /var/www/core
for consistency
Copy the sample .htaccess
file:
cp myrepo/htaccess.sample myrepo/.htaccess
open it with your favourite editor and update:
RewriteBase /
to the base of your app relative to the root:
Firewall / IPTables Port Forwarding
iptables -I RH-Firewall-1-INPUT 10 -p tcp -m tcp -s 130.56.111.64/26 --match multiport --dports 80,8080 -j ACCEPT -m comment --comment "HTTP and Tomcat Ports"
iptables-save | tee /etc/sysconfig/iptables
service iptables restart
Installing ARDC TaskManager
Optionally you can create a cronjob that hit the URL http://localhost/api/task/run/ . This will achieve the same effect but will crunch through background task slower
TaskManager is ARDC own background tasking system that works closely with the Registry to lessen the amount of on demand PHP processing for some operation by putting it in the background.
cd /opt
git clone https://github.com/au-research/ANDS-TaskManager.git ands-taskmanager
cd /opt/ands-taskmanager
mkdir log
Configure TaskManager:
polling_frequency = 5 #how often does the task manager hit the databasemax_thread_count = 5 #how many concurrent threads are run
max_up_seconds_per_task = 7200 #when a task run past this number of seconds, consider it failed
run_dir = '/opt/ands-taskmanager/' #the directory of the task manager
admin_email_addr = "" #for reporting purposes
response_url='https//localhost/api/task/exe/' #the exe to execute a task eg. http://localhost/api/task/exe/:taskid
maintenance_request_url = 'http://localhost/api/task/run/' #maintenance task run when there's no task required
data_store_path = run_dir + 'result_contents'
log_dir= run_dir + 'log'
log_level = "INFO"
db_host='localhost'
db_user='webuser'
db_passwd=''
db='dbs_registry'
tasks_table='tasks'
Install TaskManager as a service:
cd /opt/ands-taskmanager
cp ands-taskprocessor /etc/init.d/ands-taskmanagerchmod 755 /etc/init.d/ands-taskmanager
chkconfig --add ands-taskmanager
chkconfig ands-taskmanager on
service ands-taskmanager start
Finish
superuser|superuser