forked from zotonic/zotonic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zotonic_install
46 lines (42 loc) · 1.53 KB
/
zotonic_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
ZOTONIC=/home/zotonic && \
SHELL=/bin/bash && \
apt-get install -y \
erlang \
erlang-src \
build-essential \
postgresql-8.4 \
imagemagick \
exif \
git && \
echo "CREATE USER zotonic WITH PASSWORD 'zotonic';
ALTER ROLE zotonic WITH CREATEDB;
CREATE DATABASE zotonic WITH OWNER = zotonic ENCODING = 'UTF8';
\c zotonic
CREATE LANGUAGE \"plpgsql\";" | su -l postgres -c psql && \
echo "# Zotonic settings
local all zotonic ident
host all zotonic 127.0.0.1/32 md5
host all zotonic ::1/128 md5" >> /etc/postgresql/8.4/main/pg_hba.conf && \
/etc/init.d/postgresql reload && \
mkdir /home/zotonic &&\
useradd -d $ZOTONIC -s /bin/bash zotonic && \
chown -R zotonic:zotonic $ZOTONIC && \
echo "git clone git://github.com/zotonic/zotonic.git zotonic && \
cd zotonic/ && \
make && \
echo export PATH=\$PATH:\$HOME/zotonic/bin > \$HOME/.profile && \
. \$HOME/.profile && \
zotonic start" | su -l zotonic && \
CONFIG=$ZOTONIC/zotonic/priv/config && \
while [ ! -f $CONFIG ]
do
sleep 2
done && \
PASSWORD=`cat $CONFIG | grep password | sed -E 's/^\s\{\s*password\s*,\s*"(.*?)".*/\1/'` && \
echo "
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Zotonic has been successfully installed:
- Visit http://locahost:8000/ to see the Sites administration page
- The password for login to this page is $PASSWORD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"