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
Code Block |
---|
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
Code Block |
---|
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
Code Block |
---|
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
Code Block |
---|
sudo yum install -q -y 'perl(XML::Writer)' |
...
Code Block |
---|
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.
Code Block |
---|
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
Code Block |
---|
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
Code Block |
---|
sudo cpanm http://search.cpan.org/CPAN/authors/id/C/CH/CHORNY/Apache-Session-1.93.tar.gz |
...
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.
Code Block |
---|
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
Code Block |
---|
cd /usr/local/tusk sudo git clone git://github.com/opentusk/opentusk.git sudo ln -s opentusk current |
...
Code Block |
---|
sudo git clone http://github.com/opentusk/opentusk.git |
3.3 Create TUSK Directory & Data Tree
Code Block |
---|
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.
Code Block |
---|
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:
...
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
Code Block |
---|
sudo /sbin/service mysqld start |
...
question: Reload privilege tables now?[Y/N] enter y
4.2 Set up TUSK Privileged MySQL “content manager” Account
This command starts MySQL:
...
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
...
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.
Code Block |
---|
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.
Code Block |
---|
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.
...
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:
Section | ||||||||
---|---|---|---|---|---|---|---|---|
|
No comma needed at end of list of schools
4.7 Create TUSK Databases
Code Block |
---|
/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 |
...
Code Block |
---|
/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
Code Block |
---|
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':
...
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':
...
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.
Code Block |
---|
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:
...
Code Block |
---|
### 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"
...
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
Code Block |
---|
sudo reboot |
7.0 Useful Commands
7.1 Apache Start/Stop/Restart/Status
Code Block |
---|
sudo /sbin/service httpd start |
...
httpd (pid 3535) is running...
7.2 MySQL start/stop/restart/status
Code Block |
---|
sudo /sbin/service mysqld start |
...
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:
...
/usr/local/tusk/current/install/conf_templates/tusk_conf_templates/tusk.conf.explain
9.0 Trouble Shooting
9.1 Logs
On CentOS:
Code Block |
---|
sudo tail -f /var/log/httpd/error_log |
Code Block |
---|
sudo tail -f /var/log/httpd/access_log |