-- CarlEastman - 03 Jun 2016

Installing Foswiki on AWS RedHat 7.2

ToDo

* add cgi to allowed in selinux policy

Dependencies

  • Install epel repository
sudo yum install -y wget
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -i epel-release-latest-7.noarch.rpm
  • Install the following yum updates
sudo yum install -y httpd ImageMagick-perl perl-GD gcc html2text
sudo yum install -y perl-Algorithm-Diff perl-Archive-Tar perl-Authen-SASL perl-CGI perl-CGI-Session perl-Crypt-PasswdMD5 perl-Digest-SHA perl-Email-MIME perl-Encode perl-Error perl-File-Copy-Recursive perl-HTML-Parser perl-HTML-Tree perl-IO-Socket-IP perl-IO-Socket-SSL perl-JSON perl-Locale-Codes perl-Locale-Maketext perl-Locale-Maketext-Lexicon perl-Locale-Msgfmt perl-libwww-perl perl-liblwp-protocol-https perl-URI perl-Perl-Version perl-CPAN perl-LWP-Protocol-https

Install cpan

  • These cpan installs are only needed because rpms have not been made for Rhel 7 yet for these modules
  • launch cpan to install perl module(s) that don't have rpms created
    • cpan
    • install File::Copy::Recursive
    • install Email::MIME
    • quit
sudo ln -s /home/ec2-user/perl5/lib/perl5/ /usr/local/lib64/perl5
sudo ln -s /home/ec2-user/perl5/lib/perl5/x86_64-linux-thread-multi /usr/local/share/perl5
sudo chmod 755 /home/ec2-user

Download and install Foswiki

cd /var/www/html
sudo wget https://sourceforge.net/projects/foswiki/files/latest/download
sudo tar zxvf download
sudo chown -R apache:apache Foswiki-2.1.2
sudo systemctl start httpd.service

cd Foswiki-2.1.2 sudo tools/fix_file_permissions.sh </verbatim>

Generate apache 2.4 configuration

selinux

  • Set selinux to permissive

natskin

  • add the following to site preferences, make sure to indent it 3 spaces. (Remove the # comment.)
   * #Set SKIN = nat

SOLR 6.0.1 installation

cd
sudo yum install -y perl-List-MoreUtils perl-Data-OptList perl-JSON-XS perl-Cache-Cache perl-Env perl-Module-Pluggable
wget ftp://fr2.rpmfind.net/linux/centos/7.2.1511/os/x86_64/Packages/perl-Dist-CheckConflicts-0.06-2.el7.noarch.rpm
wget ftp://fr2.rpmfind.net/linux/centos/7.2.1511/os/x86_64/Packages/perl-Sub-Exporter-0.986-2.el7.noarch.rpm
wget ftp://fr2.rpmfind.net/linux/centos/7.2.1511/os/x86_64/Packages/perl-Package-Generator-0.103-14.el7.noarch.rpm
sudo rpm -i perl-Dist-CheckConflicts-0.06-2.el7.noarch.rpm
sudo rpm -i perl-Package-Generator-0.103-14.el7.noarch.rpm
sudo rpm -i perl-Sub-Exporter-0.986-2.el7.noarch.rpm
sudo yum install -y perl-Any-Moose
sudo chmod 777 /var/www/html/Foswiki-2.1.2/working
sudo chmod 777 /var/www/html/Foswiki-2.1.2/working/work_areas
sudo chmod 777 /usr/local/share/man/man3
  • cpan
    • install XML::Easy
    • install File::Which
sudo yum install -y java-1.8.0-openjdk
cd
wget http://archive.apache.org/dist/lucene/solr/6.0.1/solr-6.0.1.tgz
tar xzf solr-6.0.1.tgz solr-6.0.1/bin/install_solr_service.sh --strip-components 2  
sudo ./install_solr_service.sh ./solr-6.0.1.tgz 
sudo systemctl stop solr.service 
sudo chmod 755 /var/solr
sudo chmod 755 /var/solr/data
cd /var/solr/data 
sudo cp -r /var/www/html/Foswiki-2.1.2/solr/configsets . 
sudo cp -r /var/www/html/Foswiki-2.1.2/solr/cores . 
sudo chown -R solr.solr . 
sudo systemctl start solr.service
  • testing the solr installation
cd /var/www/html/Foswiki-2.1.2/tools
./solrindex topic=Main.WebHome
cd /var/www/html/Foswiki-2.1.2/bin
./rest /SolrPlugin/search

Solr configuration

Solr cronjobs

  • These cronjobs keep your solr up to date
  • add the following to ec2-users's crontab - crontab -e
0 0 * * 6 /var/www/html/Foswik-2.1.2/tools/solrjob --mode full
*/15 * * * * /var/www/html/Foswik-2.1.2/tools/solrjob --mode delta
Topic revision: r9 - 05 Jun 2016, CarlEastman
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy