SHARE
TWEET

baruwa 2.0 install hack notes

bbrendon Apr 5th, 2013 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. SOURCE INSTALL NOTES (FOLLOWing baruwa install 2.0 docs)  http://www.baruwa.org/docs/2.0/install/source/install.html
  3. -All commands are run as root except where noted.
  4. -Search for "TODO" and you'll find things that didn't work.
  5.  
  6.  
  7. setup a squeeze amd64 instance
  8.  
  9. apt-get install memcached -y
  10.    -This is part of a later step. No configuration required so just do it now
  11.  
  12. apt-get install postgresql-plpython-8.4 postgresql
  13.   -This is actually part of step3a, but we'll run it now.
  14.  
  15. apt-get install build-essential
  16. apt-get install gcc g++ git subversion curl patch
  17. apt-get install libjpeg62-dev libxml2-dev libxslt1-dev cython \
  18.      libpq-dev libfreetype6-dev libldap2-dev libssl-dev \
  19.      swig libcrack2-dev libmemcached-dev libgeoip-dev \
  20.      python-dev libsasl2-dev libmysqlclient-dev -y
  21.          
  22. apt-get install python-setuptools -y
  23. apt-get install python-virtualenv -y
  24.  
  25. mkdir -p /home/baruwa
  26. cd /home/baruwa
  27.  
  28. virtualenv --no-site-packages --distribute px
  29.  
  30. export SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl"
  31. curl -O https://raw.github.com/akissa/baruwa2/2.0.0/requirements.txt
  32.  
  33. easy_install -U distribute   --I added this to the install list because pip install failed. Does this only effect the virtual env?
  34. easy_install pyparsing==1.5.7  --I added this to get around an install error
  35.  
  36. pip install -r requirements.txt
  37.  
  38. curl https://sphinxsearch.googlecode.com/svn/trunk/api/sphinxapi.py -o \
  39.         px/lib/python2.6/site-packages/sphinxapi.py
  40.                
  41.                
  42. curl -O https://raw.github.com/akissa/baruwa2/2.0.0/extras/patches/repoze.who-friendly-form.patch
  43. curl -O https://raw.github.com/akissa/baruwa2/master/extras/patches/repoze-who-fix-auth_tkt-tokens.patch
  44. cd px/lib/python2.6/site-packages/repoze/who/plugins/
  45. patch -p3 -i /home/baruwa/repoze.who-friendly-form.patch
  46. patch -p4 -i /home/baruwa/repoze-who-fix-auth_tkt-tokens.patch
  47. cd -
  48.  
  49. "M2Crypto on Debian/Ubuntu issue"  -- BEGIN
  50.  -I ran this in the python virtual env. Not sure if that was correct.
  51.  
  52. curl -O https://raw.github.com/akissa/baruwa2/master/extras/patches/0002-Disable-SSLv2_method.patch
  53. curl -O http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz
  54. tar xzvf M2Crypto-0.21.1.tar.gz
  55. cd M2Crypto-0.21.1/
  56. patch -p1 -i ../0002-Disable-SSLv2_method.patch
  57. python setup.py install
  58. cd -
  59.  
  60. "M2Crypto on Debian/Ubuntu issue"  -- END
  61.  
  62. Configure postgres. I did this outside the virtual env
  63.  
  64. mv /etc/postgresql/8.4/main/pg_hba.conf /etc/postgresql/8.4/main/pg_hba.conf.orig
  65. cat > /etc/postgresql/8.4/main/pg_hba.conf << 'EOF'
  66. # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
  67. local   all         postgres                          trust
  68. host    all         all         127.0.0.1/32          md5
  69. host    all         all         ::1/128               md5
  70. EOF
  71.  
  72. sed -e "s/^#timezone = \(.*\)$/timezone = 'UTC'/" -i /etc/postgresql/8.4/main/postgresql.conf
  73.  
  74. service postgresql restart
  75.  
  76. su - postgres -c "psql postgres -c \"CREATE ROLE baruwa WITH LOGIN PASSWORD 'verysecretpw';\""
  77.  
  78. su - postgres -c 'createdb -E UTF8 -O baruwa -T template1 baruwa'
  79.  
  80. su - postgres -c "psql baruwa -c \"CREATE LANGUAGE plpgsql;\""
  81. su - postgres -c "psql baruwa -c \"CREATE LANGUAGE plpythonu;\""
  82.  
  83. curl -O https://raw.github.com/akissa/baruwa2/2.0.0/baruwa/config/sql/admin-functions.sql
  84. su - postgres -c 'psql baruwa -f /home/baruwa/admin-functions.sql'
  85.  
  86.  
  87. RABBITMQ
  88.  
  89. apt-get install rabbitmq-server -y
  90. rabbitmqctl add_user baruwa mysecretpwd
  91. rabbitmqctl add_vhost baruwa
  92. rabbitmqctl set_permissions -p baruwa baruwa ".*" ".*" ".*"
  93. rabbitmqctl delete_user guest
  94.  
  95. SPHINX (TODO)
  96.  --service FAILS to start with the sphinx in debian squeeze. Use a different/newer package
  97.  --the 2.0.7 from sphinxsearch.com doesn't work either.
  98.  --use the custom (backported 2.0.4 package I made) -- This doesn't appear to be perfect either
  99.  
  100.  
  101. ## apt-get install sphinxsearch -y
  102. ## wget http://sphinxsearch.com/files/sphinxsearch_2.0.7-release-1_amd64.deb
  103.  
  104. curl -O https://raw.github.com/akissa/baruwa2/2.0.0/extras/config/sphinx/sphinx.conf
  105.  
  106.  
  107. sed -i -e 's:sql_host =:sql_host = 127.0.0.1:' \
  108.         -e 's:sql_user =:sql_user = baruwa:' \
  109.         -e 's:sql_pass =:sql_pass = verysecretpw:' \
  110.         -e 's:sql_db =:sql_db = baruwa:' sphinx.conf
  111.  
  112. sed -i -e 's:START=no:START=yes:' /etc/default/sphinxsearch
  113.  
  114. sed -i -e 's:/var/log/sphinx:/var/log/sphinxsearch:' \
  115.         -e 's:/var/lib/sphinx:/var/lib/sphinxsearch:' sphinx.conf
  116.                
  117. cp sphinx.conf /etc/sphinxsearch/
  118. service sphinxsearch restart
  119.  
  120. cat > /etc/cron.hourly/baruwa-updateindex << 'EOF'
  121. #!/bin/bash
  122. #
  123. indexer auditlog lists domains accounts organizations --rotate &>/dev/null
  124. EOF
  125.  
  126. chmod +x /etc/cron.hourly/baruwa-updateindex
  127.  
  128.  
  129. ############## Step 3e: MailScanner
  130. Install from apt.baruwa.org
  131. apt source : deb http://apt.baruwa.org/debian unstable main
  132.  
  133. apt-get install mailscanner
  134.  
  135. I didn't run the for mailscanner in the docs listed as "Baruwa patches". Shouldn't they be included since I got mailscanner from them?
  136.  
  137.  
  138.  
  139.  
  140. cpan String::CRC32 Encoding::FixLatin AnyEvent::Handle EV DBD::mysql DBD::Pg
  141.         -Maybe these should be installed as packages?
  142.  
  143.  
  144. curl -O https://raw.github.com/akissa/baruwa2/2.0.0/extras/perl/BS.pm
  145. mv BS.pm /usr/share/MailScanner/MailScanner/CustomFunctions
  146.  
  147. Follow "Sample configurations" section in the docs (TODO)
  148.  
  149. ################ Step 4: Install Baruwa
  150. pip install baruwa
  151.  
  152.  
  153. ############ Step 5a,5b,: Create configuration files (for baruwa)
  154.  
  155. paster make-config baruwa production.ini
  156.  
  157. sed -i -e 's|baruwa:@127.0.0.1:5432/baruwa|baruwa:verysecretpw@127.0.0.1:5432/baruwa|' \
  158.         production.ini
  159.                
  160. sed -i -e 's:broker.password =:broker.password = mysecretpwd:' \
  161.         -e "s:snowy.local:$(hostname):g" \
  162.         -e 's:^#celery.queues:celery.queues:' production.ini
  163.  
  164. mkdir /etc/baruwa
  165. mv production.ini /etc/baruwa
  166.  
  167. # Set your timezone
  168. sed -i -e 's|baruwa.timezone.*|baruwa.timezone = America/Los_Angeles|' /etc/baruwa/production.ini
  169.  
  170. # create user account : admin / rutbekEnn9
  171. paster setup-app /etc/baruwa/production.ini
  172.  
  173.  
  174. indexer --all --rotate
  175.  
  176. mkdir -p /var/log/baruwa /var/run/baruwa /var/lib/baruwa/data/{cache,sessions,uploads} \
  177. /var/lock/baruwa /etc/MailScanner/baruwa/signatures /etc/MailScanner/baruwa/dkim \
  178. /etc/MailScanner/baruwa/rules
  179.  
  180.  
  181. paster celeryd /etc/baruwa/production.ini -f /var/log/baruwa/celeryd.log &
  182.  
  183.  
  184. paster serve --reload /etc/baruwa/production.ini
  185.  
  186. # Login with your web-browser
  187. http://10.1.1.245:5000/
  188.  
  189. ########### Step 6: Production deployment
  190. # Follow this once things improve above
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top