Installing Emergence on Gentoo Linux

Gentoo Linux is the recommended operating environment for Emergence

Configure Build Options

This guide will assume that you are starting from a clean Gentoo install following the Official Gentoo Handbook.

We will be installing nginx, PHP, MySQL, and node.js.

All documentation examples will show text editing with nano to follow Gentoo handbook conventions. You may of course use any editor you wish.

USE flags

Before we emerge everything we need to configure which features should be included during compilation.

			

user@hostname ~ $ sudo nano -w /etc/portage/package.use

Add these lines to /etc/portage/package.use

			

www-servers/nginx ssl nginx_modules_http_fastcgi nginx_modules_http_flv -nginx_modules_http_geo -nginx_modules_http_memcached -nginx_modules_http_referer -nginx_modules_http_proxy -nginx_modules_http_scgi -nginx_modules_http_ssi -nginx_modules_http_uwsgi

dev-lang/php ctype curl filter gd imap json mysqli simplexml truetype xml xmlreader xmlrpc zip soap fpm

/etc/portage/package.use

If the file doesn't already exist then the folder probably doesn't either so run sudo mkdir /etc/portage/ to make the directory.

Once you have the directory follow the instructions above again. If the file doesn't exist your text editor should make it.

Unmask nodejs for 64-bit

If you're running the amd64 version of Gentoo you'll need to unmask nodejs.

			

user@hostname ~ $ sudo nano -w /etc/portage/package.keywords

Add these lines to /etc/portage/package.keywords

			

net-libs/nodejs

Set PHP target to 5.3

This tells Gentoo exactly what PHP major version you want to use when compiling PHP and its extensions.

			

user@hostname ~ $ sudo nano -w /etc/portage/make.conf

user@hostname ~ $ sudo eselect php set fpm 1

Add these lines to /etc/make.conf

			

PHP_TARGETS="php5-3"

Emerge Server Binaries

Now let's compile, if you're on a clean install this will take some time.

			

user@hostname ~ $ sudo emerge -av nginx php mysql nodejs pecl-apc pecl-imagick

Method 1: Install Emergence from GitHub

Clone Emergence into your home directory, then use npm to install the package and its dependencies.

			

user@hostname ~ $ git clone https://github.com/JarvusInnovations/Emergence ~/Emergence

user@hostname ~ $ cd ~/Emergence

user@hostname ~/Emergence $ sudo npm install -g

Method 2: Install Emergence from npm

Coming soon

Start Emergence

npm -g option intalled the kernel's startup script to /usr/bin/emergence-kernel, you can now launch it manually or install the init script.

			

user@hostname ~ $ sudo wget http://emr.ge/dist/gentoo/init.d -O /etc/init.d/emergence-kernel

user@hostname ~ $ sudo chmod +x /etc/init.d/emergence-kernel

user@hostname ~ $ sudo rc-update add emergence-kernel

user@hostname ~ $ sudo /etc/init.d/emergence-kernel start

Create a Site

You can now open your web browser to take control of emergence and create your first site: http://127.0.0.1:9083. If you're installing to a remote machine replace 127.0.0.1 with your remote IP or hostname.

When prompted, login with username/password admin / admin

Secure your Installation

Once you confirm that you are able to access the control panel, use the htpasswd tool provided in NPM to delete the default admin login and create your own. Then restart the emergence kernel to apply the changes.

			

user@hostname ~ $ sudo npm install -g htpasswd

user@hostname ~ $ sudo htpasswd -D /emergence/admins.htpasswd admin

user@hostname ~ $ sudo htpasswd /emergence/admins.htpasswd myusername

user@hostname ~ $ sudo /etc/init.d/emergence-kernel restart