RHEL/CentOs Mailpiler install

轉載自https://extremeshok.com/2013/08/28/rhel-centos-redhat-mailpiler-sphinx-mariadb-mysql/

RHEL/CentOS/Redhat::MailpilerwithSphinxandMariaDB(mySQL)

MailpilerMailpilerprovidesasecureandsafesolutionforemailarchivingRHEL/CentOS.PreparingtheboxInstallEPELRepository

Important

MariaDBsegfaultswiththelatestversion(0.1.24)ofmailpiler,pleaseusethestockMySQLorPerconaXtraDBguides.

Ifyouhavefollowedthisguideandhavethesegfaultissue,pleaseseethisguideonhowtofixyourmailpilerinstall.

Notes

Guideisbasedonaguideby:JanCarelPutterpostedtothemailinglist
Preparethenode

EnableOpenVZcontainers(ProxmoxV2.2andlater)

echo-e"#Thisservicemaintainsagettyontty1fromthepointthesystemis\n#starteduntilitisshutdownagain.\nstartonstoppedrcRUNLEVEL=[2345]\nstoponrunlevel[!2345]\nrespawn\nexec/sbin/agetty-8tty138400">/etc/init/tty.conf
Removeuselesspackagesfromthesystemtocreateaminimalinstall

yumremove-yhttpd*apache*php*samba*fetchmail*exim*bind*courier*maildrop*expect*ntpdntpdatebluezbluetooth


Update

yumupdate


InstallCommonUtilities

yuminstallvimscreenunzipzipcurlwgetdos2unixncbcbind-utils-y


InstallRepositories

rpm-Uvhhttp://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm-Uvhhttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
WewilluseMariaDBasadrop-inreplacementformysql.

AddtheMariaDBrepositorytoreplaceMySQL

addtherepository

echo-e"#MariaDBrepositorylist-created2012-08-2513:15UTC\n#http://downloads.mariadb.org/mariadb/repositories/\n[mariadb]\nname=MariaDB\nbaseurl=http://yum.mariadb.org/5.5/centos6-amd64\ngpgcheck=1">/etc/yum.repos.d/MariaDB.repo


ImporttheGPkey

rpm--importhttp://yum.mariadb.org/RPM-GPG-KEY-MariaDB

InstallMariaDB

yuminstall-yMariaDB-{server,test,devel,common,compat,client}


SecureMariaDB

mysql_secure_installation
Entercurrentpasswordforroot(enterfornone):
Setrootpassword?Y
Removeanonymoususers?[Y
Disallowrootloginremotely?[Y
Removetestdatabaseandaccesstoit?[Y
Reloadprivilegetablesnow?[Y


StartMariaDBatboot

chkconfigmysqlon


RestartMariaDB

servicemysqlrestart


Installrequiredpackages

yuminstall-yopensslhttpdopenssl-develtre-develphp-mysqlmemcachedcatdoclibpstlibziptresysstatpoppler-utilsunrtf


SetupMySQL

servicemysqlstart&&chkconfigmysqlon


ConfigureyourrootpasswordforMySQL

mysqladmin-urootpasswordsecurepass


Downloadandinstallxlhtml

cd/tmp
wgethttps://bitbucket.org/jsuto/piler/downloads/xlhtml-0.5-sj-mod.tar.gz
tarxfvzxlhtml-0.5-sj-mod.tar.gz
cdxlhtml-0.5-sj-mod
./configure--build=i686-pc-linux-gnu--host=i686-pc-linux-gnu
make&&makeinstall


InstallSphinx

cd/tmp
wgethttp://sphinxsearch.com/files/sphinx-2.0.9-1.rhel6.x86_64.rpm
yumlocalinstallsphinx-2.0.9-1.rhel6.x86_64.rpm


Createauserforpiler

groupaddpiler
useradd-gpiler-s/bin/sh-d/var/pilerpiler
usermod-Lpiler


DownloadandInstallMailpiler
cd/tmp
wgethttps://bitbucket.org/jsuto/piler/downloads/piler-0.1.24.tar.gz
tarxfvzpiler-0.1.24.tar.gz
cdpiler-0.1.24
./configure–localstatedir=/var–enable-starttls–enable-tcpwrappers–with-database=mysql
make&&makeinstall
makepostinstall

Thisisthepostinstallutilityforpiler
Itshouldberunonlyatthefirstinstall.DONOTrunonanexistingpilerinstallation!
Continue?[Y/N][N]y
Pleaseenterthepathofyourdocumentroot[/var/www/localhost]/var/www/html/mailpiler
Pleaseenterthewebservergroupname[apache]
Pleaseentermysqlhostname[localhost]
Pleaseentermysqldatabase[piler]
Pleaseentermysqlusername[piler]
Pleaseentermysqlpasswordforpiler[]
Pleaseentermysqlrootpassword[]
mysqlconnectionsuccessful
Pleaseenterthepathofsphinx.conf[/etc/sphinx.conf]/etc/sphinx/sphinx.conf
Pleaseentersmtprelay[]smtp.example.com
Pleaseentersmtprelayport[25]


Registertheliberary

echo/usr/local/lib>/etc/ld.so.conf.d/piler.conf
ldconfig

SetupApacheVirtualHost

cat>/etc/httpd/conf.d/mailpiler.conf<<EOF
##eXtremeSHOK.com
<VirtualHost*:80>
ServerNamemailarchiver.example.com
DocumentRoot/var/www/html/mailpiler
<Directory/var/www/html/mailpiler>
AllowOverrideAll
</Directory>
ServerAdmin[email protected]
ErrorLog/var/log/httpd/mailarchiver-error.log
CustomLog/var/log/httpd/mailarchiver-access_logcommon
</VirtualHost>
##eXtremeSHOK.com
EOF


StartApache2

servicehttpdstart&&chkconfighttpdon

ConfigureMailpilerSQLSettings

cat>vi/usr/local/etc/piler.conf<<EOF
##eXtremeSHOK.com
;
;mysqlstuff
;
mysqlhost=127.0.0.1
mysqlport=3306
mysqlsocket=/tmp/mysql.sock
mysqluser=piler
mysqlpwd=securepass
mysqldb=piler
mysql_connect_timeout=2
##eXtremeSHOK.com
EOF


Initialisesearchindexes

supiler
indexer--all


SetupMailpilerstartupscript

cd/tmp/piler-0.1.23/init.d
mvrc.pilermailpiler
Changeinitscripttoworkwithchkconfig(file:/tmp/piler-0.1.23/init.d/mailpiler)
Addthefollowingjustbelowtheshebang

file:/tmp/piler-0.1.23/init.d/mailpilerShell

#chkconfig:2359840
#description:startupscriptformailpiler


Copytheinitscriptinthecorrectlocation

cp/tmp/piler-0.1.23/init.d/mailpiler/etc/init.d/mailpiler


Makeitexecutable

chmod+x/etc/init.d/mailpiler


Addtheservicetochkconfigandsetittostartupatboot

chkconfig--addmailpiler&&chkconfigmailpileron
SetupSphinxinitscript(file:/tmp/piler-0.1.23/init.d/rc.searchd)
Mailpilersuppliesitowninitscriptthatstartssphinxhoweversinceweinstallsphinxfromarpmthebinaryexecutableforsphinxislocatedat/usr/bin/andnot/usr/local/binasstatedintheinitscript.
Addthefollowingjustbelowtheshebang

file:/tmp/piler-0.1.23/init.d/rc.searchdShell

#chkconfig:2359742
#description:startupscriptforsphinx

Correctthepath

sed-i"s|/usr/bin/|/usr/local/|g/tmp/piler-0.1.23/init.d/rc.searchd


Installtheinitscript

cp/tmp/piler-0.1.23/init.d/rc.searchd/etc/init.d/searchd
chmod+x/etc/init.d/searchd
chkconfig--addsearchd&&chkconfigsearchdon
ConfigureMailpilerSettings(file:/var/www/html/mailpiler/config-site.php)
Setyourwebsiteurl/domain

file:/var/www/html/mailpiler/config-site.phpShell

$config['SITE_URL']='http://mailarchiver.example.com/';


Thisisimportantasmailpilerusesthisurltoredirectrequests.Thiswillalwaysmatchyourvirtualhostservername.

servicemailpilerstart&&servicesearchdstart
Youcannowaccesshttp://mailarchiver.exameple.comDefaultcredentialsUsername:admin@localPassword:pilerrocks

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章