I noticed a lot of TODO in the documentation page of baruwa 2.0 when it
comes to FreeBSD.
Maybe someone can add this to the page.
This is what i do on FreeBSD. baruwa 2.0 still does not work but i
think it has nothing to do with the following.
I can not get any message into the database!
Well that is for later ..
Here the documentation part.
*Step 3a*
cd /usr/ports/databases/postgresql84-server
make install clean
cd /usr/ports/databases/postgresql84-plpython
make install clean
Next step
Now that the PostgreSQL server is installed you need to initialize and
start it
echo # postgresql >> /etc/rc.conf
|echo '||postgresql_enable="YES"' >> /etc/rc.conf|
|echo '||postgresql_initdb_flags="--encoding=utf-8 --lc-collate=C -W -A
md5"' >> /etc/rc.conf|
/usr/local/etc/rc.d/postgresql initdb
/usr/local/etc/rc.d/postgresql start
Edit the file /usr/local/pgsql/data/pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
localall postgres trust
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
local all baruwa trust
Use the UTC time
sed -i -e "s/^#timezone = \(.*\)$/timezone = 'UTC'/"
/usr/local/pgsql/data/postgresql.conf
Restart the service
/usr/local/etc/rc.d/postgresql restart
For FreeBSD there is another postgresql user then centos and debian.
Create the database user.
su - pgsql -c "psql postgres -c \"CREATE ROLE baruwa WITH LOGIN PASSWORD
'verysecretpw';\""
Create the database.
su - pgsql -c 'createdb -E UTF8 -O baruwa -T template1 baruwa'
Baruwa uses functions written in theplpgsql andplpythonu procedural languages.
Enable these languages in the db:
su - pgsql -c "psql baruwa -c \"CREATE LANGUAGE plpgsql;\""
su - pgsql -c "psql baruwa -c \"CREATE LANGUAGE plpythonu;\""
Creation of functions written in plpythonu requires PostgreSQL admin
user access. So we create them in this step using the postgres admin
account:
curl -O
https://raw.github.com/akissa/baruwa2/2.0.1/baruwa/config/sql/admin-functions.sql
su - pgsql -c 'psql baruwa -f /usr/home/baruwa/admin-functions.sql'
*Step 3b*
RabbitMQ
cd /usr/ports/net/rabbitmq
make install clean
echo # rabbitmq >> /etc/rc.conf
|echo '||rabbitmq_enable="YES"' >> /etc/rc.conf|
/usr/local/etc/rc.d/rabbitmq start
*Step 3c: Sphinx*
cd /usr/ports/textproc/sphinxsearch
make install clean
Select postgresql support.
cd /usr/local/etc; mv sphinx.conf sphinx.conf.orig
curl -O
https://raw.github.com/akissa/baruwa2/2.0.1/extras/config/sphinx/sphinx.conf
sed -i -e 's:sql_host =:sql_host = 127.0.0.1:' sphinx.conf
sed -i -e 's:sql_user =:sql_user = baruwa:' sphinx.conf
sed -i -e 's:sql_pass =:sql_pass = 'verysecretpw':' sphinx.conf
sed -i -e 's:sql_db =:sql_db = baruwa:' sphinx.conf
sed -i -e 's:/var/lib/sphinx:/var/db/sphinxsearch/data:g'
sphinx.conf
sed -i -e 's:/var/log/sphinx:/var/log/sphinxsearch:g' sphinx.conf
echo # sphinxsearch >> /etc/rc.conf
|echo '||sphinxsearch_enable="YES"' >> /etc/rc.conf|
Start the service
/usr/local/etc/rc.d/sphinxsearch start
*Step 3d: Memcached*
cd /usr/ports/databases/memcached
make install clean
echo # memcached >> /etc/rc.conf
|echo '||memcached_enable="YES"' >> /etc/rc.conf|
*Step 5a: Create configuration files*
mkdir usr/local/etc/baruwa
mv production.ini /usr/local/etc/baruwa
*Step 5d: Create the required directories*
mkdir -p /var/log/baruwa /var/run/baruwa
/var/lib/baruwa/data/{cache,sessions,uploads} \
/var/lock/baruwa /usr/local/etc/MailScanner/baruwa/signatures
/usr/local/etc/MailScanner/baruwa/dkim \
/usr/local/etc/MailScanner/baruwa/rules
*Step 5e: Start the celery daemon*
paster celeryd /usr/local/etc/baruwa/production.ini -f /var/log/baruwa/celeryd.log
&
*Step 5f: Test using builtin server*
paster serve --reload /usr/local/etc/baruwa/production.ini
regards
Johan
_______________________________________________
http://pledgie.com/campaigns/12056