Child pages
  • OpenTUSK Install Instructions for RHEL-CentOS-5.8
Skip to end of metadata
Go to start of metadata

Hardware

TUSK server architecture/requirement information can be found at this link.

Installation

Please note that the following instructions are to be used after successful installation of RHEL or CentOS

* Please note that everything that needs to be cut is in the code boxes below.
* Except where noted, please copy and paste each line separately.

1.0  Configure Additional YUM Repositories for RHEL/CentOS 5.8
sudo curl --output /etc/yum.repos.d/opentusk.repo -LOk https://raw.github.com/opentusk/Opentusk/master/install/centos-5.8/opentusk.repo
2.0  Install Services and Perl Packages Needed for TUSK
curl -LOk https://raw.github.com/opentusk/Opentusk/master/install/centos-5.8/install_yum_packages.bash
sudo bash install_yum_packages.bash
2.1  Install App::cpanminus
sudo curl -o /usr/bin/cpanm 'https://metacpan.org/raw/MIYAGAWA/App-cpanminus-1.7004/bin/cpanm?download=1'
sudo sed -i 's@#!perl@#!/usr/bin/perl@' /usr/bin/cpanm
sudo chmod 755 /usr/bin/cpanm
2.2  Upgrade XML::Writer to 0.604
sudo yum install -q -y 'perl(XML::Writer)'

If the command above fails with 'Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again'

sudo sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo
sudo yum install -q -y 'perl(XML::Writer)'
2.3  Re-install Moose with cpanm for a newer version

This will take a while as there are so many dependencies to be installed. Altogether 58 modules.

sudo yum remove 'perl(Moose)'
sudo cpanm http://cpan.metacpan.org/authors/id/E/ET/ETHER/Moose-2.1205.tar.gz
2.4  Install modules used by CI report tool
sudo cpanm Types::XSD@0.005
sudo cpanm Data::UUID@1.219
sudo cpanm URI::Encode@0.09
2.5  Install Apache::Session::MySQL::NoLock
sudo cpanm http://search.cpan.org/CPAN/authors/id/C/CH/CHORNY/Apache-Session-1.93.tar.gz

3.0  Install Tusk Software

Please note that each line needs to be cut and pasted separately. At this point we are creating user accounts and set permissions.

3.1  Create TUSK Account

These are recommended values for the tusk user, and can be modified for local uid and gid requirements. This account should also be locked, and not have a working password.

sudo /usr/sbin/groupadd -g 1100 tusk
sudo /usr/sbin/useradd -c 'Tusk' -u 1100 -g tusk -d /usr/local/tusk tusk
sudo /usr/sbin/usermod -a -G tusk apache
sudo chmod 755 /usr/local/tusk
3.2  Download OpenTUSK from Github
cd  /usr/local/tusk
sudo git clone git://github.com/opentusk/opentusk.git
sudo ln -s opentusk current

Note: git uses port 9418 by default. You can check if you can connect to port 9418 using the following command:

nc -v github.com 9418

If you can't connect to this port use HTTP instead:

sudo git clone http://github.com/opentusk/opentusk.git
3.3  Create TUSK Directory & Data Tree
 
sudo bash /usr/local/tusk/current/install/scripts/create_directories.sh
3.4  Create a Self-Signed SSL Certificate

These commands create a SSL certificate tailored for your site. Please answer questions with appropriate answers. You will be asked for your country abbreviation and your state/province name). If you don’t want to provide this information you can press “enter” for the defaults to be applied. It will default to Great Britain (GB) as the country and “Berkshires” as the province.

cd /usr/local/tusk/ssl_certificate
sudo openssl genrsa -out server.key 1024
sudo openssl req -new -key server.key -out server.csr
sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
4.0           TUSK MySQL Setup and Configurations

Here we are setting up three accounts. It is best to remember the account names and passwords as you will be using them later. The three accounts and a brief description are as follows:

 root : This is the MySQL root password it is used for most database core changes.

 content manager: This is a MySQL account that will be used for all tusk database queries and updates. This username and password will be used in both apache and tusk configuration files.

 admin: This is NOT a MySQL account but is a TUSK application account. This will allow you to log into TUSK. This is for use WITHOUT LDAP. Please contact us if you use LDAP or another authentication system.

4.1              Setup MySQL root password
sudo /sbin/service mysqld start

If MySQL is successfully installed you should see the following:

Starting mysqld:                    [ OK ]

 If MySQL failed to start you may need to check system logs.

To set the password for MySQL:

sudo /usr/bin/mysql_secure_installation

 The following should appear. Please enter and re-enter your root password. REMEMBER password, as you will need it later!

 Enter current password for root: [TUSK:Press enter here]

Set root password? [TUSK:Y/n]

New password: Enter mysql root password

Re-enter new password: Re-enter root password

Password updated successfully!

Reloading privilege tables..

 ... Success!

At the end please press “enter” when it asks you to accept the default.

question: Remove anonymous users? [Y/N]  enter y

question: Disallow root login remotely? [Y/N] enter y

question: Remove test database and access to it? [Y/N] enter y

question: Reload privilege tables now?[Y/N] enter y

4.2  Set up TUSK Privileged MySQL “content manager” Account

This command starts MySQL:

When it asks you to enter password, please enter your MySQL root password (from Step 4.1).

mysql -u root -p
Enter password: <MySQL root password from section 4.1>

Enter the following at the mysql> prompt:

grant all on *.* to CONTENT_MANAGER@'localhost' identified by '<CONTENT_MANAGER_PASSWORD>';

Change ‘CONTENT_MANAGER_PASSWORD’ to your own password. Please remember this password as well- you will use it later!!

4.3    Set up TUSK Crontab MySQL Account

Fill in a value for <tuskpassword> then run command

grant all on *.* to tusk@'localhost' identified by '<tuskpassword>';

flush privileges;
quit;

REMEMBER YOUR PASSWORD!

Now save your settings and quit using the below commands:

4.4              Copy TUSK and Apache Templates

Note: Second copy command below contains will create a file called /etc/httpd/conf.d/tusk_logging. This contains tufts specific logging formats, feel free to modify or remove the contents of this file.
If you delete this file you must also delete any 'Include conf.d/tusk_logging' statements in the tusk_httpd.conf and tusk_https.conf files.

sudo cp /usr/local/tusk/current/install/templates/conf/tusk/tusk.conf /usr/local/tusk/conf/tusk.conf
sudo cp /usr/local/tusk/current/install/templates/conf/apache2/tusk_* /etc/httpd/conf.d/
4.5 Edit TUSK and Apache Configuration Files

Please add the local administrator email where appropriate.

sudo sed -i 's/^LoadModule mime_magic_module/#LoadModule mime_magic_module/g' /etc/httpd/conf/httpd.conf

sudo cp /etc/httpd/conf.d/ssl.conf /tmp
sudo sh -c "sed -n '/<VirtualHost _default_:443>/q;p' /tmp/ssl.conf > /etc/httpd/conf.d/ssl.conf"

sudo find /usr/local/tusk/conf -name "*.conf" -exec sed -i 's/CONTENT_MANAGER_USER/<from step 4.2>/g' {} \;
sudo find /usr/local/tusk/conf -name "*.conf" -exec sed -i 's/CONTENT_MANAGER_PASSWORD/<from step 4.2>/g' {} \;

sudo find /etc/httpd/conf.d/ /usr/local/tusk/conf -name "*.conf" -exec sed -i 's/MYWEBMASTER/<your local admin email>/g' {} \;
sudo find /etc/httpd/conf.d/ /usr/local/tusk/conf -name "*.conf" -exec sed -i "s/MYFQDN/<hostname>/g" {} \;
sudo find /etc/httpd/conf.d/ /usr/local/tusk/conf -name "*.conf" -exec sed -i "s/TUSKFQDN/<hostname>/g" {} \;
4.6           Adding & Configuring Additional Schools

Before doing this step please make sure you know what schools your installation will need. Do not just copy the below example; use it as a template for the schools you actually need/want. It is recommended that you always keep the default school; it is useful for testing.

Please refer to the following file in order to configure the TUSK instance. It will help explain why and how we customize your TUSK installation:

/usr/local/tusk/current/install/conf_templates/tusk_conf_templates/tusk.conf.explain

Using the explanation and directions from the above file, please go to the file below to customize it.

/usr/local/tusk/conf/tusk.conf

NOTE:  Section 8 below on Branding and Customizing  will refer again to the tusk.conf directory to find the template that must be used to further customize your site.

To add more schools, please go to the above file again (/usr/local/tusk/conf/tusk.conf)The default school appears first. As previously mentioned, you should keep the default school as it helps with testing and demos. To add necessary new schools, please copy and paste the default school lines for every new school you need. Please note that between schools there needs to be a comma (see below), but not at the beginning or end of the list of schools. 

For each school please only change the Display Names to the name of the schools you need. Changing the other names ("short names," "displayname," etc.) will break the script and should not be changed. In the below example we kept the default school and added a medical and veterinary school:
"Default" : {
    "Initial" : "D",
    "ShortName" : "default",
    "DisplayName" : "Default School",
    "Groups" : {
        "SchoolWideUserGroup" : "3",
        "SchoolAdmin" : "1",
        "EvalAdmin" : "2"
    }
},

"Medical" : {
    "Initial" : "M",
    "ShortName" : "med",
    "DisplayName" : "School of Medicine",
    "Groups" : {
        "SchoolWideUserGroup" : "3",
        "SchoolAdmin" : "1",
        "EvalAdmin" : "2"
    }
},
"Veterinary" : {
    "Initial" : "V",
    "ShortName" : "vet",
    "DisplayName" : "School of Veterinary Medicine",
    "Groups" : {
        "SchoolWideUserGroup" : "3",
        "SchoolAdmin" : "1",
        "EvalAdmin" : "2"
    }
}
This is the default school.








There needs to be a comma between each
  new school; not in beginning or end
Change "default" to "Medical" to add a Medical school
Do not change
Do not change
Do not change

Do not change
Do not change
Do not change

Do not forget comma
Change "default" to "Veterinary" to add a Vet School
Do not change
Do not change
Do not change

Do not change
Do not change
Do not change


No comma needed at end of list of schools

4.7              Create TUSK Databases
 /usr/bin/perl /usr/local/tusk/current/bin/db/baseline.pl --create-school --create-admin --dbuser=root --dbpw="<MySQL root pw from 4.1>" --verbose  

This command starts MySQL:

When it asks you to enter password, please enter your MySQL root password (from Step 4.1).

mysql -u root -p
Enter password: <MySQL root password from section 4.1>

The following user and password is what you will use to log onto the installation once it is completed. PLEASE REMEMBER IT! It is different than the password that you chose for content manager or your MySQL password.

update hsdb4.user set password=password('<TUSK Admin Password, remember this>') where user_id = 'admin';
quit;

Upgrade your database to the latest changes: 

 /usr/bin/perl /usr/local/tusk/current/bin/db/upgrade.pl --all --dbuser=root --dbpw="<MySQL root pw from 4.1>" --verbose
5.0 Final Tasks

At this point the key apache2 and MySQL services are being set to restart in event of some kind of failure or scheduled restart.

5.1              Fix Permissions
Run script to create slide hierarchy.
sudo perl /usr/local/tusk/current/install/scripts/make_slide_folders.pl &> /dev/null

sudo chown -R tusk.tusk /usr/local/tusk /var/log/tusk
sudo chown -R apache.tusk /data
sudo chown -R apache.apache /usr/local/tusk/current/mason_cache
sudo chmod 777 /data /data/TUSKdoc /data/temp
sudo chmod +t  /data /data/TUSKdoc /data/temp
sudo chown tusk.apache /data/temp



5.2              Set up MySQL for Startup at Reboot

Check if set to auto start; note all levels are currently 'off':

sudo /sbin/chkconfig --list mysqld

If it is correct, you should see:

mysqld  0:off 1:off 2:off 3:off 4:off 5:off 6:off

 

Turn on auto start level 3:

sudo /sbin/chkconfig --levels 345 mysqld on

 

Check to see if auto start levels 3,4,5 are on:

sudo /sbin/chkconfig --list mysqld

If it is correct, you should see:

mysqld  0:off 1:off 2:off 3:on 4:on 5:on 6:off

5.3              Set up Apache2 for Startup at Reboot

Check if set to auto start; note all levels are currently 'off':

sudo /sbin/chkconfig --list httpd

If it is correct, you should see:

httpd  0:off 1:off 2:off 3:off 4:off 5:off 6:off

Turn on auto start levels 3,4,5:

sudo /sbin/chkconfig --levels 345 httpd on

Check to see if auto start levels 3,4,5 are on:

sudo /sbin/chkconfig --list httpd

If it is correct, you should see:

httpd  0:off 1:off 2:off 3:on 4:on 5:on 6:off

5.4              Turn Off (most) SELinux Security

We need to set the SELnux on CentOS to 'permissive' otherwise we encounter mason caching issues no matter what permissions we apply.

sudo sed -i 's/^\s*SELINUX=.*$/SELINUX=permissive/g' /etc/selinux/config
5.5              Create Crontabs

Replace "<mysqlTuskPassword>" with the password you created in step 4.4 below. Then cut and paste the following:

# Note: tusk user has no password


sudo su - tusk

vi .my.cnf   # Insert the following

[client]
user=tusk
password=<mysqlTuskPassword>

Then run the following (it will edit your crontab file):

chmod 600 .my.cnf  

crontab -e

Cut and paste:

### Session Tracking
1 1 * * * /usr/local/tusk/current/bin/clean_session_table 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Old Session Cleaner"
0 3 * * * /usr/local/tusk/current/bin/update_tracking 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Daily Tracking updater"
30 4 * * * /usr/local/tusk/current/bin/update_hot_content noprint 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Hot content updater"


### Misc cleanup
25 4 * * * /usr/bin/find /data/temp/ -type f -ctime +2 -exec /bin/rm -f {} \; 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Temp file cleanup"

### Forum Crons
10 3 * * * /usr/local/tusk/current/code/forum/cron_jobs.pl 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Forums: cron_jobs"
20 3 * * * /usr/local/tusk/current/code/forum/cron_subscriptions.pl 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Forums: cron_subscriptions"
30 * * * * /usr/local/tusk/current/code/forum/cron_rss.pl 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Forums: cron_rss"

### Eval fts index
5 2 * * 1-5 /usr/local/tusk/current/bin/eval_fts_index --changes_update --school=all 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "Eval FTS Indexer"

### fts index
0,15,30,45 * * * * TZ="US/Eastern";export TZ;/usr/local/tusk/current/bin/fts_index --recent --noprint 2>&1 | /usr/local/tusk/current/bin/mail_cron_error "FTS Indexer"

### Run mysql backups - This is run by root because the job needs to be able to read/write mysql owned files
#0 11 * * * /usr/local/tusk/current/bin/mysql_backup --backup --replication --days 5 --dir /data/mysql_backup --socket /var/lib/mysql/mysql.backup.sock
NOTE: If you are not in US Eastern time zone (see above "US/Eastern"), you will need to change the time zone; please change to the crontab to the appropriate time zone.

If you are unsure about the format of your time zone, run the command "tzselect"

5.6              Run Crontabs

As usr/tusk run the following command to see the database and allow cron to index for search content:

/usr/local/tusk/current/bin/fts_index --all

Next, type exit to get out of tusk user account.

6.0          Reboot
6.1              Reboot the system and use a browser to connect to the tusk home page
sudo reboot

7.0          Useful Commands
7.1              Apache Start/Stop/Restart/Status
sudo /sbin/service httpd start

If successful, this should appear:

Starting httpd:                    [ OK ]
sudo /sbin/service httpd stop

If successful, this should appear:

Stopping httpd:                    [ OK ]
sudo /sbin/service httpd restart

If successful, this should appear:

Stopping httpd:                    [ OK ]
Starting httpd:                    [ OK ]
sudo /sbin/service httpd status

If successful, this should appear:

httpd (pid  3535) is running... 

7.2              MySQL start/stop/restart/status
sudo /sbin/service mysqld start

If successful, this should appear:

Starting mysqld:                   [ OK ]
sudo /sbin/service mysqld stop

If successful, this should appear:

Stopping mysqld:                   [ OK ]
sudo /sbin/service mysqld restart

If successful, this should appear:

Stopping mysqld:                   [ OK ]
Starting mysqld:                   [ OK ]
sudo /sbin/service mysqld status

If successful, this should appear:

mysqld (pid  2475) is running...

8.0          Branding/Customizing TUSK

To customize your site you will need to continue to edit tusk.conf mentioned in section 4.6 above.  The tusk.conf.explain file  provides brief instructions on the meaning of each element in the file.  These files are located in directories as follows:

tusk.conf:

/usr/local/tusk/conf/tusk.conf

tusk.conf.explain:

/usr/local/tusk/current/install/conf_templates/tusk_conf_templates/tusk.conf.explain

9.0          Trouble Shooting
9.1              Logs

On CentOS:

sudo tail -f /var/log/httpd/error_log

sudo tail -f /var/log/httpd/access_log

10.0          Testing the Installation 
11.0          UMLS Licensing
  • No labels

4 Comments

  1. Anonymous

    i have this error when try to install opentusk

    # sudo perl /usr/local/tusk/current/install/scripts/make_slide_folders.pl

    malformed text data., at character offset 0 (before "(end of string)") at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Constants.pm line 72
    Can't use an undefined value as an ARRAY reference at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Constants.pm line 115.
    Compilation failed in require at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Core/ServerConfig.pm line 19.
    BEGIN failed--compilation aborted at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Core/ServerConfig.pm line 19.
    Compilation failed in require at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Core/DB.pm line 19.
    BEGIN failed--compilation aborted at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Core/DB.pm line 19.
    Compilation failed in require at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Core/SQLRow.pm line 32.
    BEGIN failed--compilation aborted at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Core/SQLRow.pm line 39.
    Compilation failed in require at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Search/SearchQueryField.pm line 41.
    BEGIN failed--compilation aborted at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Search/SearchQueryField.pm line 48.
    Compilation failed in require at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Search/SearchQuery.pm line 39.
    BEGIN failed--compilation aborted at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/Search/SearchQuery.pm line 39.
    Compilation failed in require at /usr/local/tusk/Opentusk/install/scripts/../../lib/HSDB4/SQLRow/Content.pm line 30.
    BEGIN failed--compilation aborted at /usr/local/tusk/Opentusk/install/scripts/../../lib/HSDB4/SQLRow/Content.pm line 30.
    Compilation failed in require at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/UploadContent.pm line 20.
    BEGIN failed--compilation aborted at /usr/local/tusk/Opentusk/install/scripts/../../lib/TUSK/UploadContent.pm line 20.
    Compilation failed in require at /usr/local/tusk/current/install/scripts/make_slide_folders.pl line 22.
    BEGIN failed--compilation aborted at /usr/local/tusk/current/install/scripts/make_slide_folders.pl line 22.

  2. Anonymous

    error when using .

    1. perl /usr/local/tusk/current/install/scripts/create_school.pl
    
    Can't locate MySQL/Password.pm in @INC (@INC contains: /usr/local/tusk/Opentusk/install/scripts/../lib /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/tusk/current/install/scripts/create_school.pl line 6.
    BEGIN failed--compilation aborted at /usr/local/tusk/current/install/scripts/create_school.pl line 6.
    1. Anonymous

      Has anyone succesfully installed this Open TUSK ???

      1. Sorry! I made a mistake in release alpha6. Also added to release notes.

        I made a mistake in TUS-2386 and missed an environment variable dependency. This has been fixed in the latest release, opentusk-4_0_0-alpha6-hotfix-1