/docs/source/install_fedora.txt

https://bitbucket.org/datopdog/baruwa · Plain Text · 169 lines · 110 code · 59 blank · 0 comment · 0 complexity · 63c75732ae2ea0d8d94fa3185c5b7db3 MD5 · raw file

  1. .. _installfedora:
  2. ================
  3. Baruwa on Fedora
  4. ================
  5. The Baruwa rpm that is provided only supports apache out of the
  6. box, if you are running a different web server, please install
  7. from source or rebuild the source rpm to support your web server.
  8. Baruwa rpm install
  9. ==================
  10. Install the dojo rpm from http://topdog-software.com/oss/dojo/::
  11. # yum --nogpgcheck localinstall dojo-1.4.3-1.fc13.noarch.rpm
  12. Download the rpm from http://www.topdog-software.com/oss/baruwa/
  13. Then proceed and install the rpm::
  14. # yum --nogpgcheck localinstall baruwa-<version>.noarch.rpm
  15. Create the database::
  16. # mysqladmin -u root -p create baruwa
  17. Create the database user::
  18. mysql> GRANT ALL ON baruwa.* TO baruwa@localhost IDENTIFIED BY '<password>';
  19. mysql> flush privileges;
  20. Configure MailScanner
  21. =====================
  22. It is assumed that you have a working MailScanner system already installed
  23. and configured, if you are installing from scratch please refer to their
  24. documentation on how to install and configure MailScanner.
  25. Edit /usr/lib/baruwa/BaruwaSQL.pm and set the variables::
  26. my ($db_name) = 'baruwa';
  27. my ($db_host) = 'localhost';
  28. my ($db_user) = 'baruwa';
  29. my ($db_pass) = '<password>';
  30. my ($sqlite_db) = "/var/spool/MailScanner/incoming/baruwa.db";
  31. Next edit the MailScanner config file /etc/MailScanner/MailScanner.conf,
  32. you need to make sure that the following options are set::
  33. Quarantine User = exim (Or what ever your "Run As User" is set to)
  34. Quarantine Group = apache (or your webserver user if not apache)
  35. Quarantine Permissions = 0660
  36. Quarantine Whole Message = yes
  37. Quarantine Whole Message As Queue Files = no
  38. Detailed Spam Report = yes
  39. Include Scores In SpamAssassin Report = yes
  40. Always Looked Up Last = &BaruwaSQL
  41. To actually quarantine and later process messages with in baruwa, set
  42. 'store' as one of your keywords for the "Spam Actions" and
  43. "High Scoring Spam Actions" MailScanner options
  44. **Integrate SQL Blacklists/Whitelists**
  45. Edit /usr/lib/baruwa/BaruwaLists.pm and set the variables::
  46. my ($db_name) = 'baruwa';
  47. my ($db_host) = 'localhost';
  48. my ($db_user) = 'baruwa';
  49. my ($db_pass) = '<password>';
  50. Next edit the MailScanner config file /etc/MailScanner/MailScanner.conf, and
  51. set the following options::
  52. Is Definitely Not Spam = &BaruwaWhitelist
  53. Is Definitely Spam = &BaruwaBlacklist
  54. **Integrate per user settings**
  55. Edit /usr/lib/baruwa/BaruwaUserSettings.pm and set the variables::
  56. my ($db_name) = 'baruwa';
  57. my ($db_host) = 'localhost';
  58. my ($db_user) = 'baruwa';
  59. my ($db_pass) = '<password>';
  60. Link the BaruwaUserSettings module::
  61. ln -s /usr/lib/baruwa/BaruwaUserSettings.pm /usr/lib/MailScanner/MailScanner/CustomFunctions/
  62. Edit the MailScanner config file /etc/MailScanner/MailScanner.conf, and
  63. set the following options::
  64. Required SpamAssassin Score = &BaruwaLowScore
  65. High SpamAssassin Score = &BaruwaHighScore
  66. If you want users to be able to turn off spam checks for their own profiles,
  67. set the following options::
  68. Spam Checks = &BaruwaShouldScan
  69. **Apply configuration changes**
  70. Restart up MailScanner::
  71. # /etc/init.d/MailScanner restart
  72. **Verify that is working**
  73. Check your log files you should see
  74. Baruwa SQL logger::
  75. Aug 9 18:58:27 localhost MailScanner[8470]: Logging message 1OiVg7-0003zS-9s to Baruwa SQL
  76. Aug 9 18:58:27 localhost MailScanner[11052]: 1OiVg7-0003zS-9s: Logged to Baruwa SQL
  77. Baruwa Lists::
  78. Aug 9 18:32:42 localhost MailScanner[27260]: Starting Baruwa whitelists
  79. Aug 9 18:32:42 localhost MailScanner[27260]: Read 6 whitelist items
  80. Aug 9 18:32:42 localhost MailScanner[27260]: Ip blocks whitelisted 192.168.1.0/24 192.168.2.0/24 xxx.xx.xxx.0/26
  81. Baruwa User settings::
  82. Aug 9 15:00:03 localhost MailScanner[25708]: Baruwa - Populating spam score settings
  83. Aug 9 15:00:03 localhost MailScanner[25708]: Read 1 spam score settings
  84. Aug 9 14:59:53 localhost MailScanner[25668]: Baruwa - Populating high spam score settings
  85. Aug 9 14:59:53 localhost MailScanner[25668]: Read 1 high spam score settings
  86. Configure Baruwa
  87. ================
  88. Edit the baruwa settings.py::
  89. # baruwa_path=$(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
  90. # vi $baruwa_path/baruwa/settings.py
  91. And set the mysql database details::
  92. DATABASE_ENGINE = 'mysql'
  93. DATABASE_NAME = 'baruwa'
  94. DATABASE_USER = 'baruwa'
  95. DATABASE_PASSWORD = '<baruwa_password>'
  96. DATABASE_HOST = 'localhost'
  97. Create the baruwa admin user and populate the database::
  98. # $baruwa_path/baruwa/manage.py syncdb
  99. Edit the settings.py file and make configuration changes to suit your site.::
  100. # vi $baruwa_path/baruwa/settings.py
  101. **Setup Web server**
  102. Edit your apache configurations to enable virtual hosting if
  103. not enabled already. Then set the correct hostname in
  104. /etc/httpd/conf.d/baruwa.conf::
  105. # change to your hostname
  106. ServerName baruwa-alpha.local
  107. Make sure mod_wsgi is enabled, uncomment the following line in
  108. /etc/httpd/conf.d/wsgi.conf::
  109. LoadModule wsgi_module modules/mod_wsgi.so
  110. Restart apache and point your browser to the hostname url.