Gentoo has made Courier-imap version 4 stable, and has moved authentication back to /etc/courier. This is just after I've gone through and hacked all the Make and config files in the vhcs source to point to /etc/courier-imap so as to create the gentoo vhcs tarball. So if you want to try this, please follow the source part of this howto and skip my tarball atm - else you won't have any authentication working and all hell will break loose! Alternatively you could use my tarball and tell portage you want to use Courier-imap v 3.

This is a work in progress - I was trying to get it working on my system and thought I'd document it as I went in case I got it working So please feel free to try it out and let me know what you find.. I'll be updating this as I learn more about it. Having said that, please give it a go!

Init script for Gentoo
I created a little init.d script, which you can use. Please see this thread here.

64bit daemon fix
If you are using 64bit like me (Opteron) the vhcs2_daemon will segfault. You need to re-compile it 64bit, see my howto here.

Guide
This guide is derived from Petzch's work in the VHCS Forums. Thank you!

If you see anything in square brackets through out this guide (ie [ipaddress]), then it is something you should be modifying for your network.
This guide assumes you extract the tarball to /root. If you have extracted it elsewhere, just replace /root/vhcs-2.4 with your location

This guide should give you the follow setup:
Apache2 for web
Postfix for MTA
Courier IMAP / POP3
MySQL for database
Bind for DNS
ProFTPd for FTP server

Sync your portage tree
First you may like to get a copy of the latest portage tree. If so, then

Code:

emerge --sync

USE flags
Now we need to ensure we have the correct USE flags. These are related to VHCS2 and based on my dual Opteron server, but feel free to change them based on your profile and other requirements.

Courier-IMAP V4 is now stable in portage, so it is used as the default in this howto. As of version 4, authentication is now handled by courier-authlib not authdaemond. If you have courier-imap <= version 3 then replace courier-authlib with authdaemond, else follow the howto.

Carefully check and update config files

Code:

etc-update

Configure services
Install MySQL database

Code:

/usr/bin/mysql_install_db ; /etc/init.d/mysql start

Now, set root's mysql password

Code:

mysqladmin password [password]

Copy proftp config file

Code:

cp /etc/proftpd/proftpd.conf.distrib /etc/proftpd/proftpd.conf

Add PHP and SSL support to Apache

Code:

nano -w /etc/conf.d/apache2

replace line with

Code:

APACHE2_OPTS="-D SSL -D PHP4"

Open apache2 config

Code:

nano -w /etc/apache2/conf/apache2.conf

set your fqdn in apache2.conf

Code:

ServerName [set your fqdn]

exit and save.

Configure VHCS
Now we need to start configuring VHCS2.
The configuration files that come with the tarball need to be changed to reflect our Gentoo base.
So I have already changed them all for you, and re-packaged it into a convenient tarball
Download it here.

If you want to use the source from VHCS.net, then you will need to extract the tarball and manually change to suit the Gentoo naming convention.

Edit the main config
If you are using my tarball, I have already gone through each and every file and replaced apache with apache2, courier with courier-imap etc, and pointed everything to the proper locations. I have also Gentoofied the vhcs2.conf file, however you will still need to edit it to suit your network.
Change anything that has a square bracket, ie [hostname].

Code:

cd /root/vhcs-gentoo-2.4/configs ; nano -w vhcs2.conf

If you are not using my tarball, then you can grab my config and overwrite the one that came with the source if you like

Once again, if you are using <= courier-imap 3, then change CMD_AUTHD = /etc/init.d/courier-authlib to CMD_AUTHD = /etc/init.d/authdaemond.

Edit Postfix main.cf
I found the default postfix config a little restrictive (like not letting you email other domains outside your network), so I changed it. Either way you will need to edit the main.cf file so that it is compatible with your network.
If you used my tarball, main.cf will soon be changed to grab variables from the vhcs2.conf so you won't have to edit anything, but for now change anything in square brackets, else you can edit it manually.

Code:

nano -w /root/vhcs-gentoo-2.4/configs/postfix/main.cf

exit and save

Rebuild the daemon
You need to re-build the daemon so that it is Gentoo init compatible. See howto here.

thank you for the tip j-m, I have updated the howto.
I look forward to any other advice you can give me.. I have been messing around so much with my boxen getting vhcs2 working that I need a fresh Gentoo system to test on

Once I am satisfied that the Howto works, I will write an ebuild.

Cheers_________________Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!

*** Warning: This library needs some functionality provided by -lpython2.0.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

Your tutorial is great.
vhcs2 have it's own daemon, and he make the domains active and other thing in vhcs2.
so you must add the vhcs2 daemon in cron_________________Users must now undergo formal training before contacting Microsoft tech support.

Your tutorial is great.
vhcs2 have it's own daemon, and he make the domains active and other thing in vhcs2.
so you must add the vhcs2 daemon in cron

I re-created the daemon to run in an init (as per my howto) so I have the daemon running without cron.

Did you use my tarball? or the source from vhcs2?

what version of courier? authlib? or authdaemond?

...........

SpideriK, you might want to search the forums for that error - it doesn't *seem* vhcs related. Perhaps there is a fix out there that will enable you to get past that point. I don't seem to have ENTITY emerged on my system at all, although I DO have python use flag. havey ou tried a newer version from portage?_________________Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!

I am just checking your work on VHCS2 for Gentoo, but there are some thinks, I don't quite understand:

1. Is the USE flag "authdaemond" still necessary when using courier-imap V4? cyrus-sasl is the only package, listening to this USE flag.

2. I made a diff between the original package and your vhcs-2.4-gentoo-2005041801 package. I don't quite understand, how that comes, but the original package from the VHCS website is dated with 23rd April, so how comes your package is from 18th?

3. How comes, you have an older version of phpmyadmin included in your package? Can't phpmyadmin be left out, and emerged through portage instead, as it is done with pflogsumm?

4. I am not quite sure about the nessary changes to be applied to the original package concerning the use of courier-imap V4. Is it enough to change the CMD_AUTHD line in vhcs2.conf, or are there changes necessary in vhcs-2.4/configs/courier/Makefile necessary as well??? As it looks like, "courier-imap" is the valid dir in most cases, except when it is about authentication, which means "courier/authlib" then. But it's only about two files (authdaemonrc & authmodulelist), whereas authdaemonrc does not show any major differences, and authmodulelist even seems to be not needed.

I'd appreciate clearification for that matters, as I'd like to use the original package and apply a patch for Gentooification._________________Las torturas mentales de la CIA

yes, to a degree - it does not really do everything I want, but it IS promising. The main issue is time. I run two IT companies and in my spare time I'm trying to organise a new webserver for myself. I was hoping someone else might be able to contribute..

Master One wrote:

I am just checking your work on VHCS2 for Gentoo, but there are some thinks, I don't quite understand:

1. Is the USE flag "authdaemond" still necessary when using courier-imap V4? cyrus-sasl is the only package, listening to this USE flag.

this should NOT be needed, but having it will not affect courier v4 if it doesn't use that flag

Master One wrote:

2. I made a diff between the original package and your vhcs-2.4-gentoo-2005041801 package. I don't quite understand, how that comes, but the original package from the VHCS website is dated with 23rd April, so how comes your package is from 18th?

I guess they have actually done an update to their tarball and called it the same version..

Master One wrote:

3. How comes, you have an older version of phpmyadmin included in your package? Can't phpmyadmin be left out, and emerged through portage instead, as it is done with pflogsumm?

umm.. I don't remember including phpmyadmin in my tarball (it was prob from the original vhcs2 tarball), but yes, you could remove it and emerge it yourself

Master One wrote:

4. I am not quite sure about the nessary changes to be applied to the original package concerning the use of courier-imap V4. Is it enough to change the CMD_AUTHD line in vhcs2.conf, or are there changes necessary in vhcs-2.4/configs/courier/Makefile necessary as well??? As it looks like, "courier-imap" is the valid dir in most cases, except when it is about authentication, which means "courier/authlib" then. But it's only about two files (authdaemonrc & authmodulelist), whereas authdaemonrc does not show any major differences, and authmodulelist even seems to be not needed.

this is part of the deal.. the original tarball is not designed for gentoo, but for debian - and as such a lot of the components don't point to the right places.
Originally I got vhcs working by using a plethora of symlinks - you should be able to do this too. it should be much easier now with courier v4 because it is now pointing parts back to /etc/courier, whereas for courier3 I had to change every single make file in the program to point it ot another location.. very tedious!

Master One wrote:

I'd appreciate clearification for that matters, as I'd like to use the original package and apply a patch for Gentooification.

Go for it! I was hoping someone else would be able to contribute some changes.. I didn't get it all working. I think we should use the original tarball and use symlinks or what not to get it working under gentoo.. else it's a lot of work for each subsequent version release.._________________Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!