Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Last active December 17, 2015 16:49
Show Gist options
  • Save AlainODea/5641310 to your computer and use it in GitHub Desktop.
Save AlainODea/5641310 to your computer and use it in GitHub Desktop.
Install Zotonic on SmartMachine
pkgin up
pkgin in -y erlang postgresql92-server ImageMagick build-essential scmgit unzip
curl -L https://github.com/downloads/basho/rebar/rebar > /opt/local/bin/rebar
chmod +x /opt/local/bin/rebar
groupadd zotonic
useradd -m -s /usr/bin/bash -G zotonic zotonic
vim /var/pgsql/data/pg_hba.conf
# add lines above any uncommented rules (trim leading hash on each line)
## Postgres off the ground settings
#local all postgres ident
## Zotonic settings
#local all zotonic ident
#host all zotonic 127.0.0.1/32 md5
#host all zotonic ::1/128 md5
svcadm enable postgresql:default
su - postgres
psql <<EOF
CREATE USER zotonic WITH PASSWORD 'zotonic';
CREATE DATABASE zotonic WITH OWNER = zotonic ENCODING = 'UTF8';
GRANT ALL ON DATABASE zotonic TO zotonic;
\c zotonic
CREATE LANGUAGE "plpgsql";
EOF
exit
su - zotonic
curl -OL http://zotonic.googlecode.com/files/zotonic-0.9.1.zip
unzip zotonic-0.9.1.zip
cd zotonic
bin/zotonic debug
# visit http://smartmachine-ip:8000
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='application/web/zotonic' type='service' version='0'>
<create_default_instance enabled='false'/>
<single_instance/>
<dependency name='network' grouping='require_all' restart_on='error' type='service'>
<service_fmri value='svc:/milestone/network:default'/>
</dependency>
<dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local:default'/>
</dependency>
<dependency name='autofs' grouping='optional_all' restart_on='error' type='service'>
<service_fmri value='svc:/system/filesystem/autofs:default'/>
</dependency>
<dependency name='milestone' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/sysconfig'/>
</dependency>
<exec_method name='start' type='method' exec='/home/zotonic/zotonic/bin/zotonic start' timeout_seconds='60'>
<method_context working_directory='/home/zotonic/zotonic' project='default'>
<method_credential user='zotonic' group='zotonic' privileges='basic,net_privaddr'/>
<method_environment>
<envvar name='PATH' value='/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin'/>
<envvar name='HOME' value='/home/zotonic'/>
<envvar name='ZOTONIC_PORT' value='80'/>
</method_environment>
</method_context>
</exec_method>
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'>
<method_context working_directory='/home/zotonic/zotonic' project='default'>
<method_credential user='zotonic' group='zotonic' privileges='basic,net_privaddr'/>
<method_environment>
<envvar name='PATH' value='/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin'/>
<envvar name='HOME' value='/home/zotonic'/>
</method_environment>
</method_context>
</exec_method>
<property_group name='startd' type='framework'>
<propval name="duration" type="astring" value="contract"/>
<propval name='ignore_error' type='astring' value='core,signal'/>
</property_group>
<stability value='Evolving'/>
<template>
<common_name>
<loctext xml:lang='C'>Zotonic, the Erlang Web Framework</loctext>
</common_name>
</template>
</service>
</service_bundle>
@AlainODea
Copy link
Author

Thanks @kaos :) I was able to get a prompt for psql and create the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment