User Tools

Site Tools


raspberrypi:resin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
raspberrypi:resin [2013/08/16 16:36] – created rlunaroraspberrypi:resin [2022/12/02 22:02] (current) – external edit 127.0.0.1
Line 3: Line 3:
 Yes [[http://www.caucho.com/|resin]] can be installed on the raspberry PI, too. Here are some instructions to achieve this. Yes [[http://www.caucho.com/|resin]] can be installed on the raspberry PI, too. Here are some instructions to achieve this.
  
 +===== Download and install =====
 +
 +Download the latest resin package and uncompress it. Follow the usual steps for configure and install, which are: 
 +
 +  * ''configure''
 +  * ''make''
 +  * ''sudo make install''
 +
 +We don't need root privileges for the first two, but yes for the latest.
 +
 +The install procedure has created the following directories and files:
 +
 +|Path|What is|
 +|/etc/resin| Configuration files |
 +|/etc/init.d/resin | The daemon script, to start and stop the server|
 +|/var/resin | To locate the web pages |
 +|/var/log/resin | Location of log files |
 +|/usr/local/share | The program itself | 
 +       
 +
 +===== Create a resin user for running the web server =====
 +
 +We have created a resin user. This user will be the one who will run the application. This is 
 +a safer scenario than running as a root user.
 +
 +<code>
 +# addgroup resin
 +# adduser --ingroup resin --home /home/resin  resin
 +</code>
 +
 +Please choose a difficult password and forget it because you won't need to log in as this user
 +anymore.
 +
 +===== Change permissions in favor of the resin user =====
 +
 +I prefer to change the ownership of the files of the application to the resin user, although this is not entirely necessary. In fact, it is more savvy to keep them as root ownership, because it prevents them to be overwritten in case of an intrusion. 
 +
 +<code>
 +# cd /usr/local/share
 +# chown resin:resin resin 
 +# cd /var
 +# chown resin:resin resin 
 +# chown o-x,o-r resin 
 +</code>
 +
 +
 +===== Minor fixings =====
 +
 +I've tried to run the application and I've discovered that the application look for a directories who don't exist, but who have a simple solution. Here are my notes:
 +
 +</code>
 +# symbolic link to the resin configuration from the application directory
 +# ln -s /etc/resin /usr/local/share/resin/conf
 +# symbolic link to the resin log from the application directory
 +# ln -s /var/log/resin /var/log/resin
 +</code>
 +
 +===== Changes in the ''/etc/init.d/resin'' script =====
 +
 +Edit the ''/etc/init.d/resin'' script and make the changes detailed below. 
 +
 +You have to add an user value. In my case I've selected the root value and afterwards I will change the resin.properties to have then the user changed to resin once it is opened the port 80.
 +
 +<code>
 +START_CMD="start-all"
 +
 +USER="root"
 +</code>
 +
 +You must uncomment the RESIN_ROOT line:
 +
 +<code>
 +#
 +# -resin-root /var/resin         -- the main data directory
 +#
 +RESIN_ROOT="-root-directory /var/resin"
 +</code>
 +
 +And the RESIN_CONF line:
 +
 +<code>
 +#
 +# -conf /etc/resin/resin.xml   -- the main configuration file
 +#
 +RESIN_CONF="-conf /etc/resin/resin.xml"
 +</code>
 +
 +And the RESIN_LOG line:
 +
 +<code>
 +
 +# Licenses for Resin. TODO in progress
 +# RESIN_LICENSE=" -license-directory /etc/resin/licenses "
 +#
 +# -log-directory /var/log/resin -- the main log directory
 +#
 +RESIN_LOG="--log-directory /var/log/resin"
 +</code>
 +
 +===== Change the resin.properties =====
 +
 +Change the following values:
 +
 +<code>
 +setuid_user   : resin
 +setuid_group  : resin
 +</code>
 +
 +<code>
 +rest_admin_ssl : true
 +</code>
 +
 +<code>
 +admin_user : PUT-AN-USERNAME-HERE
 +admin_password : {SSHA}CREATE-THE-CRYPTED-PASSWORD-AND-ADD-IT-HERE
 +</code>
 +
 +
 +===== Optional: remove unnecessary things =====
 +
 +These two clusters of below can be deleted from the configuration file whithout complains: 
 +
 +<code xml>
 +  <cluster id="memcached" xmlns:memcache="urn:java:com.caucho.memcached">
 +    <!-- define the servers in the cluster -->
 +    <server-multi id-prefix="memcached-" address-list="${memcached_servers}" po
 +      <!-- listen for the memcache protocol -->
 +      <listen port="${memcached_port?:11211}"
 +              keepalive-timeout="600s" socket-timeout="600s">
 +
 +        <memcache:MemcachedProtocol/>
 +      </listen>
 +    </server-multi>
 +  </cluster>
 +
 +  <cluster id="proxycache">
 +    <!-- define the servers in the cluster -->
 +    <server-multi id-prefix="proxycache-" address-list="${proxycache_servers}"
 +    <host id="" root-directory="proxycache">
 +      <web-app id="">
 +        <resin:HttpProxy regexp=".*">
 +          <!-- backend HTTP servers to proxy to -->
 +          <addresses>${backend_servers}</addresses>
 +        </resin:HttpProxy>
 +      </web-app>
 +    </host>
 +  </cluster>
 +
 +</code>
  
raspberrypi/resin.1376663774.txt.gz · Last modified: 2022/12/02 22:02 (external edit)