Difference between revisions of "Infrastructure"

From Open Food Facts wiki
Jump to navigation Jump to search
Line 33: Line 33:
 
* apt-get install fail2ban
 
* apt-get install fail2ban
 
* apt-get install sudo
 
* apt-get install sudo
 +
 +
* apt-get install build-essential
 +
* apt-get install git
 +
  
 
==== Users ====
 
==== Users ====
Line 40: Line 44:
  
 
==== Product Opener dependencies ====
 
==== Product Opener dependencies ====
 +
 +
===== exim =====
 +
 +
* apt-get install exim4
 +
* dpkg-reconfigure exim4-config
 +
** Internet Site mail is sent by smtp 
 +
** 127.0.0.1
  
 
===== MongoDB =====
 
===== MongoDB =====
Line 89: Line 100:
  
 
apt-get install nginx
 
apt-get install nginx
 +
 +
 +
==== Product Opener ====
 +
 +
===== Libraries =====
 +
 +
* apt-get install zlib1g-dev
 +
 +
===== Perl modules =====
 +
 +
apt-get install libwww-perl libimage-magick-perl libxml-encoding-perl libtext-unaccent-perl libmime-lite-perl libcache-memcached-fast-perl libjson-perl libclone-perl  libgraphviz-perl libmime-lite-perl libcrypt-passwdmd5-perl libencode-detect-perl libgraphics-color-perl libbarcode-zbar-perl libxml-feedpp-perl libmongodb-perl liburi-find-perl libxml-simple-perl
 +
 +
Some modules seem not to have Debian packages and must be built using CPAN:
 +
 +
<pre>
 +
cpan
 +
install URI::Escape::XS
 +
install Encode::Punycode
 +
install GraphViz2
 +
install HTML::Defang
 +
install Algorithm::CheckDigits
 +
install Geo::IP
 +
install Image::OCR::Tesseract
 +
DateTime::Format::Mail
 +
DateTime::Format::CLDR
 +
DateTime::Locale
 +
</pre>

Revision as of 12:12, 17 June 2016

Infrastructure

This page describes the hardware/software infrastructure for the Open Food Facts + Open Beauty Facts projects.

New server install log

OFF and OBF have been hosted from 2012 to 2016 on a (now very old) OVH dedicated server that is also hosting other projects. On June 13th 2016, a new dedicated server has been ordered specifically for OFF and OBF.

Hardware

Server setup

Server configuration

  • uname -a
    • Linux ns3362784.ip-37-187-74.eu 3.14.32-xxxx-grs-ipv6-64 #7 SMP Wed Jan 27 18:05:09 CET 2016 x86_64 GNU/Linux
  • perl -v
    • This is perl 5, version 20, subversion 2 (v5.20.2) built for x86_64-linux-gnu-thread-multi

Basic configuration

  • apt-get update
  • apt-get upgrade
  • apt-get install fail2ban
  • apt-get install sudo
  • apt-get install build-essential
  • apt-get install git


Users

  • admin users with sudo access
  • off user

Product Opener dependencies

exim
  • apt-get install exim4
  • dpkg-reconfigure exim4-config
    • Internet Site mail is sent by smtp
    • 127.0.0.1
MongoDB

See https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/

apt-get install mongodb

MongoDB shell version: 2.4.10

service mongod stop mv /var/lib/mongodb /home/mongodb

vi /etc/mongod.conf

#  dbPath: /var/lib/mongodb
  dbPath: /home/mongodb

service mongod start

Stars with some warnings:

mongo
MongoDB shell version: 3.2.7
connecting to: test
Server has startup warnings:
2016-06-13T19:34:08.245+0200 I CONTROL  [initandlisten]
2016-06-13T19:34:08.246+0200 I CONTROL  [initandlisten] ** WARNING: Cannot detect if NUMA interleaving is enabled. Failed to probe "/sys/devices/system/node/node1": Permission denied
2016-06-13T19:34:08.246+0200 W CONTROL  [initandlisten]
2016-06-13T19:34:08.246+0200 W CONTROL  [initandlisten] Failed to probe "/sys/kernel/mm/transparent_hugepage": Permission denied
2016-06-13T19:34:08.246+0200 W CONTROL  [initandlisten]
2016-06-13T19:34:08.246+0200 W CONTROL  [initandlisten] Failed to probe "/sys/kernel/mm/transparent_hugepage": Permission denied
2016-06-13T19:34:08.246+0200 I CONTROL  [initandlisten]


Apache / mod_perl and nginx

Apache 2 + mod_perl serve the dynamically generated HTML pages from Product Opener.

nginx is installed on port 80 as a reverse proxy. It serves the static files (images, JS, CSS etc.) and proxies the dynamic requests to the Apache server on another port.

apt-get install apache2

  1. stop apache in order to be able to install nginx (default port 80)

service stop apache2

apt-get install nginx


Product Opener

Libraries
  • apt-get install zlib1g-dev
Perl modules

apt-get install libwww-perl libimage-magick-perl libxml-encoding-perl libtext-unaccent-perl libmime-lite-perl libcache-memcached-fast-perl libjson-perl libclone-perl libgraphviz-perl libmime-lite-perl libcrypt-passwdmd5-perl libencode-detect-perl libgraphics-color-perl libbarcode-zbar-perl libxml-feedpp-perl libmongodb-perl liburi-find-perl libxml-simple-perl

Some modules seem not to have Debian packages and must be built using CPAN:

cpan
install URI::Escape::XS
install Encode::Punycode
install GraphViz2
install HTML::Defang
install Algorithm::CheckDigits
install Geo::IP
install Image::OCR::Tesseract
DateTime::Format::Mail
DateTime::Format::CLDR
DateTime::Locale