Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 48 lines (43 sloc) 1.597 kb
d219bc7 @AlainODea Automated Installation Script
AlainODea authored
1 #!/bin/bash
2 ZOTONIC=/home/zotonic && \
3 SHELL=/bin/bash && \
4 apt-get install -y \
5 erlang \
6 build-essential \
7 rake \
8 libxml2-dev \
9 libexpat1-dev \
10 postgresql-8.4 \
11 imagemagick \
12 mercurial && \
13
14 echo "CREATE USER zotonic WITH PASSWORD 'zotonic';
15 ALTER ROLE zotonic WITH CREATEDB;
16 CREATE DATABASE zotonic WITH OWNER = zotonic ENCODING = 'UTF8';
17 \c zotonic
18 CREATE LANGUAGE \"plpgsql\";" | su -l postgres -c psql && \
19 echo "# Zotonic settings
20 local all zotonic trust
21 host all zotonic 127.0.0.1/32 trust
22 host all zotonic ::1/128 trust" >> /etc/postgresql/8.4/main/pg_hba.conf && \
23 /etc/init.d/postgresql reload && \
24
25 mkdir /home/zotonic &&\
26 useradd -d $ZOTONIC -s /bin/bash zotonic && \
27 chown -R zotonic:zotonic $ZOTONIC && \
28
29 echo "hg clone https://zotonic.googlecode.com/hg/ zotonic && \
30 cd zotonic/ && \
31 make && \
32 echo export PATH=\$PATH:\$HOME/zotonic/bin > \$HOME/.profile && \
33 . \$HOME/.profile && \
34 zotonic start" | su -l zotonic && \
35
36 CONFIG=$ZOTONIC/zotonic/priv/config && \
37 while [ ! -f $CONFIG ]
38 do
39 sleep 2
40 done && \
41 PASSWORD=`cat $CONFIG | grep password | sed -E 's/^\s\{\s*password\s*,\s*"(.*?)".*/\1/'` && \
42 echo "
43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 Zotonic has been successfully installed:
45 - Visit http://locahost:8000/ to see the Sites administration page
46 - The password for login to this page is $PASSWORD
47 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Something went wrong with that request. Please try again.