Difference between pages "Product Opener/Installation" and "Translations - Front page - Spanish"

From Open Food Facts wiki
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
Installation instructions for Product Opener (see [[Project:Product Opener]]).
+
Go back to the main [[Translations]] page.
 
 
== Before you start ==
 
 
 
Product Opener is not yet released as open source. The instructions below are for reference and for early testers of Product Opener. They are very likely to change as the code will be restructured, made more independent of proprietary code and specific Open Food Facts uses etc.
 
 
 
When it is released, Product Opener will have much easier to use install scripts and instructions.
 
 
 
== Install directory ==
 
 
 
Instructions below use /home/obf for the install directory, replace with your install dir.
 
 
 
== Product Opener code ==
 
 
 
=== Configuration ===
 
 
 
==== startup.pl ====
 
 
 
This file is used to preload Perl module in Apache.
 
It contains a path that needs to be updated:
 
  
 
<pre>
 
<pre>
# Needs to be configured
+
<h1>Open Food Facts</h1>  
use lib "/home/obf/cgi/";
 
</pre>
 
  
==== Config.pm ====
+
<div style="float:right;width:300px;margin-left:20px;margin-bottom:20px;padding:10px;border:1px solid #cbe7ff;background-color:#f0f8ff;">
  
==== Config2.pm ====
+
<a href="http://whatsinmyyogurt.com/">
 +
<img id="og_image" src="/images/misc/yogurt-300x225.png" width="300" height="225" alt="What's in my yogurt?" />
 +
</a>
  
Contains info about the domain, database and path. This is separated from Config.pm so that it is easy to create test instance that share the same configuration in Config.pm but are on other domains.
 
  
<pre>
+
<p>Let's open yogurts from all around the world!
# server constants
+
<a href="http://en.blog.openfoodfacts.org/news/open-food-facts-launches-the-what-s-in-my-yogurt-project-on-open-data-day">On Open Data Day 2014,</a>
$domain = "openbeautyfacts.org";
+
Open Food Facts launches the <a href="http://whatsinmyyogurt.com/">What's in my yogurt?</a> project.</p>
  
# server paths
+
</div>
$www_root = "/home/obf/html";
 
$data_root = "/home/obf";
 
  
$mongodb = "obf";
 
</pre>
 
  
=== Required Perl modules ===
+
<p>Ayúdanos a reunir información (ingredientes, datos nutricionales etc.) sobre los productos alimenticios del mundo entero.
  
The following Perl modules need to be installed (some of them might be included with Perl).
+
En algunos minutos, puedes <a href="http://fr.openfoodfacts.org/comment-ajouter-un-produit">añadir fácilmente productos</a> y colaborar en la mejora de la alimentación de todos.</p>
  
To install a module, you can sometimes use packages.
 
  
e.g. on Debian / Ubuntu :  apt-get install libdatetime-perl
 
  
Or you can use cpan:
+
<p>Estos datos pueden ser reutilizados y redistribuidos libre y gratuitamente :</p>
  
cpan install DateTime
 
  
  
<pre>
+
<h3>Para ayudarte a elegir los mejores productos</h3>  
Cache::Memcached::Fast
 
Crypt::PasswdMD5
 
DateTime
 
DateTime::Format::Mail
 
Digest::MD5
 
Digest::SHA1
 
Encode::Punycode
 
File::Copy
 
File::Path
 
Geo::IP
 
Getopt::Long
 
GraphViz2
 
Hash::Util
 
HTML::Defang
 
HTML::Entities
 
Image::Magick
 
Image::OCR::Tesseract
 
IPC::Open3
 
JSON
 
LWP::Authen::Digest
 
</pre>
 
  
== MongoDB database ==
 
  
Install Mongodb.
 
  
The mongodb database name is configured in cgi/Config.pm
+
<ul>
  
The mongodb database is created when the first product is added.
+
<li>para entender las etiquetas : ¿cuáles son los aditivos alimentarios que hay que evitar ?</li>
  
=== MongoDB indexes ===
+
<li>para comparar los productos y encontrar productos similares más sanos</li>
  
See [[Product Opener mongodb indexes]]
+
<li>para encontrar productos que no contengan (o que contengan en menor proporción) algunas sustancias que queremos evitar : grasas, sales, aditivos, alérgenos etc.</li>
  
== Apache servers ==
+
</ul>
  
In production we use a light weight Apache web server for static files (e.g. images) that does reverse proxying to a modperl Apache server that dynamically generates the HTML pages.
 
  
If the trafic is low or moderate, you can use only one Apache mod_perl server that also serves images etc.
 
  
In the example below, the Apache mod_perl server listens on port 19000.
+
<h3>Para alentar a los fabricantes a ofrecer productos más sanos</h3>
  
=== Light-weight reverse proxy for static files ===
 
  
Compile:
 
  
./configure --prefix=/home/xyz/proxy --enable-rewrite --enable-proxy --enable-proxy_http --disable-userdir --enable-headers --enable-expires --enable-mime --enable-so --with-included-apr
+
<ul>
  
Add to httpd.conf:
+
<li>evaluando los productos y publicando comparativas con la composición nutricional</li>
  
<pre>
+
<li>comprobando los alegatos de tipo "25% menos de azúcar/sal/grasa en comparación con otros productos de la misma categoría"</a>  
  
<VirtualHost *>
+
</ul>  
DocumentRoot /home/obf/html
 
ServerName world.openbeautyfacts.org
 
ServerAlias *.openbeautyfacts.org
 
  
ErrorLog /home/obf/logs/proxy_error_log
 
CustomLog /home/obf/logs/proxy_access_log combined
 
ServerAdmin stephane@openbeautyfacts.org
 
  
<Directory "/home/obf/html">
 
    Options -Indexes FollowSymLinks
 
    Order allow,deny
 
    Allow from all
 
</Directory>
 
RewriteEngine on
 
RewriteCond  %{REQUEST_URI}  !/./
 
RewriteRule ^(/cgi/.*)$ http://localhost:19000$1 [P,L]
 
RewriteMap escape int:escape
 
RewriteRule ^/favicon.ico$ /favicon.ico [L]
 
RewriteCond  %{REQUEST_URI}  !^/images/
 
RewriteCond  %{REQUEST_URI}  !^/js/
 
RewriteCond  %{REQUEST_URI}  !^/rss/
 
RewriteCond  %{REQUEST_URI}  !^/robots
 
RewriteCond  %{REQUEST_URI}  !^/clicks/
 
RewriteCond  %{REQUEST_URI}  !^/data/
 
RewriteCond  %{REQUEST_URI}  !^/files/
 
RewriteRule  ^(.*)$ http://localhost:19000/cgi/display.pl?${escape:$1} [P,L,QSA]
 
</VirtualHost>
 
  
 +
<h3>Para ayudar a los investigadores</h3>
 +
  
<VirtualHost *>
 
DocumentRoot /home/obf/html
 
ServerName openbeautyfacts.org
 
ErrorLog /home/obf/logs/proxy_error_log
 
CustomLog /home/obf/logs/proxy_access_log combined
 
DirectoryIndex index.html index.shtml
 
<Directory "/home/obf/html">
 
    Options -Indexes FollowSymLinks Includes
 
    Order allow,deny
 
    Allow from all
 
</Directory>
 
RewriteEngine on
 
RewriteCond %{HTTP_HOST} ^openbeautyfacts\.org
 
RewriteRule ^/products$ /products.shtml [L]
 
  
</VirtualHost>
+
<ul>  
  
</pre>
+
<li>cruzando los datos con los de otros estudios, los investigadores pueden establecer correlaciones
 +
e intentar vincular ciertos ingredientes con ciertas enfermedades.</li>  
  
=== modperl Apache server for dynamic pages ===
+
</ul>
  
* download the latest version of the source of the Apache httpd server from the 2.2 branch (2.2.29 when writing this)
 
** do not use the 2.4 branch as mod_perl is not yet compatible with it
 
* extract the source
 
* ./configure --with-mpm=prefork --prefix=/home/obf/apache --enable-rewrite --enable-proxy --enable-proxy_http --enable-deflate --disable-userdir --enable-headers
 
* make
 
* make install
 
  
* download the latest version of mod_perl from http://perl.apache.org/
 
* extract the source
 
* perl Makefile.PL MP_APXS=/home/obf/apache/bin/apxs
 
* make
 
* make install
 
  
==== Configuration ====
+
<p>... y para todas aquellas aplicaciones en las que aún no hemos pensado. El poner a disposición del público toda la información disponible de forma pública y gratuita, permitirá a las personas de todo el mundo encontrar miles de nuevas formas de utilización que jamás se nos habrían ocurrido.</p>
  
In /home/obf/apache/conf/httpd.conf:
 
  
Change the port:
 
  
Listen 19000
+
<p>¿Tienes ideas ? ¡Compártelas en el <a href="https://openfoodfacts.uservoice.com/">foro de ideas</a> !</p>
  
Add at the end:
 
  
<pre>
 
PerlWarn Off
 
PerlRequire /home/obf/cgi/startup.pl
 
  
 +
<h2>Últimos productos añadidos :</h2>
  
<Location /cgi>
+
<p>&rarr; <a href="/estado/a-completar">productos que están siendo añadidos/a> (en particular los productos añadidos a través del iPhone, Android y Windows Phone apps)</p>
SetHandler perl-script
+
PerlResponseHandler ModPerl::Registry
 
PerlOptions +ParseHeaders
 
Options +ExecCGI
 
Order allow,deny
 
Allow from all
 
</Location>
 
  
 +
[[query:{"sort_by":"last_modified_t_complete_first"}]]
  
<VirtualHost *>
+
<p style="clear:left">&rarr; <a href="/cgi/search.pl?action=process&sort_by=last_modified_t_complete_first&page=2">productos siguientes</a></p>
DocumentRoot /home/obf/html
 
ServerName world.openbeautyfacts.org
 
ErrorLog /home/obf/logs/error_log
 
CustomLog /home/obf/logs/access_log combined
 
ScriptAlias /cgi/ "/home/obf/cgi/"
 
</VirtualHost>
 
  
PerlPostReadRequestHandler My::ProxyRemoteAddr
 
 
</pre>
 
</pre>
 
 
== Installation issues ==
 
 
Depending on your environment (in particular different versions of Linux, Apache, MongoDB, Perl, Perl modules etc.), you may encounter some issues when installing or running Product Opener.
 
 
[[Product Opener installation issues]] lists those issues and steps to resolve them.
 

Revision as of 08:44, 3 February 2015

Go back to the main Translations page.

<h1>Open Food Facts</h1> 

<div style="float:right;width:300px;margin-left:20px;margin-bottom:20px;padding:10px;border:1px solid #cbe7ff;background-color:#f0f8ff;">

<a href="http://whatsinmyyogurt.com/">
<img id="og_image" src="/images/misc/yogurt-300x225.png" width="300" height="225" alt="What's in my yogurt?" />
</a>


<p>Let's open yogurts from all around the world!
<a href="http://en.blog.openfoodfacts.org/news/open-food-facts-launches-the-what-s-in-my-yogurt-project-on-open-data-day">On Open Data Day 2014,</a>
 Open Food Facts launches the <a href="http://whatsinmyyogurt.com/">What's in my yogurt?</a> project.</p>

</div>


<p>Ayúdanos a reunir información (ingredientes, datos nutricionales etc.) sobre los productos alimenticios del mundo entero.

En algunos minutos, puedes <a href="http://fr.openfoodfacts.org/comment-ajouter-un-produit">añadir fácilmente productos</a> y colaborar en la mejora de la alimentación de todos.</p> 



<p>Estos datos pueden ser reutilizados y redistribuidos libre y gratuitamente :</p> 



<h3>Para ayudarte a elegir los mejores productos</h3> 



<ul> 

<li>para entender las etiquetas : ¿cuáles son los aditivos alimentarios que hay que evitar ?</li> 

<li>para comparar los productos y encontrar productos similares más sanos</li> 

<li>para encontrar productos que no contengan (o que contengan en menor proporción) algunas sustancias que queremos evitar : grasas, sales, aditivos, alérgenos etc.</li> 

</ul> 



<h3>Para alentar a los fabricantes a ofrecer productos más sanos</h3> 



<ul> 

<li>evaluando los productos y publicando comparativas con la composición nutricional</li> 

<li>comprobando los alegatos de tipo "25% menos de azúcar/sal/grasa en comparación con otros productos de la misma categoría"</a> 

</ul> 



<h3>Para ayudar a los investigadores</h3> 
 


<ul> 

<li>cruzando los datos con los de otros estudios, los investigadores pueden establecer correlaciones 
e intentar vincular ciertos ingredientes con ciertas enfermedades.</li> 

</ul> 



<p>... y para todas aquellas aplicaciones en las que aún no hemos pensado. El poner a disposición del público toda la información disponible de forma pública y gratuita, permitirá a las personas de todo el mundo encontrar miles de nuevas formas de utilización que jamás se nos habrían ocurrido.</p> 



<p>¿Tienes ideas ? ¡Compártelas en el <a href="https://openfoodfacts.uservoice.com/">foro de ideas</a> !</p> 



<h2>Últimos productos añadidos :</h2> 

<p>→ <a href="/estado/a-completar">productos que están siendo añadidos/a> (en particular los productos añadidos a través del iPhone, Android y Windows Phone apps)</p>
 

[[query:{"sort_by":"last_modified_t_complete_first"}]]

<p style="clear:left">→ <a href="/cgi/search.pl?action=process&sort_by=last_modified_t_complete_first&page=2">productos siguientes</a></p>