Install Ubuntu 8.04.1 server add: Select LAMP Server Select SSH server Select Samba server Login via SSH and become root (sudo su): -- Networking ------------------------------------------------------------------------------------------------------------- Set static IP if you want: nano /etc/network/interfaces Find row: iface eth0 inet dhcp Change it to: iface eth0 inet static Then and add the following lines: address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 gateway 192.168.1.1 broadcast 192.168.1.255 Save and exit. Set static DNS: nano /etc/resolv.conf Enter your DNS name and DNS server IP: search your.domain.corp nameserver 192.168.1.200 Save and exit If you want to start using your new settings at once, restart the networking (you will lose the SSH connection): /etc/init.d/networking restart -- Source lists ----------------------------------------------------------------------------------------------------------- Edit the source list: nano /etc/apt/sources.list Add Webmin: # Webmin repository deb http://download.webmin.com/download/repository sarge contrib Activate: deb http://se.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse deb-src http://se.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse And activate: deb http://archive.canonical.com/ubuntu hardy partner deb-src http://archive.canonical.com/ubuntu hardy partner Save and exit. -- Remove CTRL ALT Del Reboot --------------------------------------------------------------------------------------------- Remove CTRL + ALT + DEL - Auto Reboot function: nano /etc/event.d/control-alt-delete Comment out: # start on control-alt-delete # exec /sbin/shutdown -r now "Control-Alt-Delete pressed" -- Blacklist PC-Speaker --------------------------------------------------------------------------------------------------- Blacklist the PC-Speaker module: nano /etc/modprobe.d/blacklist Add the following: # PC-Speaker blacklist pcspkr -- Update all pakages ----------------------------------------------------------------------------------------------------- Update repository lists and packets. apt-get update apt-get upgrade -- Install WebMin --------------------------------------------------------------------------------------------------------- Install Webmin apt-get install webmin When done you can surf to: https://[YOUR IP]:10000 Login with your account. Configure Samba using Webmin.... My suggestion is (if you have your server on the inside of a firewall) to add upload share for later use. That way you can easily copy anything from/to the server from any computer in your network. Very handy. :) -- Install WMWare Tools --------------------------------------------------------------------------------------------------- Install needed packets. apt-get install build-essential linux-headers-`uname -r` Select on Host in VM menu, "Install VMWare Tools...", Press Install on the warning. mount /dev/cdrom /media/cdrom cp /media/cdrom/VMwareTools-*.tar.gz /tmp/ cd /tmp/ tar zxvf VMwareTools-*.tar.gz cd vmware-tools-distrib/ Do this from CONSOLE! (Not via SSH!) ./vmware-install.pl Restart the server. reboot -- Ubuntu installed as a Guest -------------------------------------------------------------------------------------------- When you have installed the virtual machine you will see the syslog filling on the host. Something like this: host clock rate change request 0 -> 19 host clock rate change request 19 -> 0 host clock rate change request 0 -> 250 host clock rate change request 250 -> 0 host clock rate change request 0 -> 483 host clock rate change request 483 -> 733 host clock rate change request 733 -> 868 host clock rate change request 868 -> 0 host clock rate change request 0 -> 212 host clock rate change request 212 -> 287 host clock rate change request 287 -> 297 host clock rate change request 297 -> 804 host clock rate change request 804 -> 833 host clock rate change request 833 -> 942 This can be fixed the follwing way: Log in to your new virtual machine. Edit the menu.lst file: sudo nano /boot/grub/menu.lst add "clock=pit" to the "kernel line" in default startup like so: This below example is form a Ubuntu 7.10 guest. ----------------------- Cut ----------------------- ## ## End Default Options ## title Ubuntu 7.10, kernel 2.6.22-14-server root (hd0,0) kernel /boot/vmlinuz-2.6.22-14-server root=UUID=53527d0a-29d5-440b-ade5-e5818ed129b5 ro quiet splash clock=pit initrd /boot/initrd.img-2.6.22-14-server quiet ----------------------- Cut ----------------------- You can also do this: You can also prevent /dev/rtc from being used. This will generally cause clocks to run slow in any virtual machines you have that need the additional interrupts, but that may be acceptable to you, depending on your application. To do so, add the following setting to each virtual machine's .vmx configuration file, or add the setting globally to the host's configuration file (/etc/vmware/config): host.useFastClock = FALSE To set the clock using NTP instead in the virtual machine: apt-get install ntp nano /etc/ntp.conf add the server(s) you want - Look here: http://www.pool.ntp.org/zone/europe find one that fits your location. add it above the ubuntu one, like so: # You do need to talk to an NTP server or two (or three). server se.pool.ntp.org server ntp.ubuntu.com -- Install Zarafa --------------------------------------------------------------------------------------------------------- First edit php.ini to turn off magic_quotes_gpc: nano /etc/php5/apache2/php.ini ----------------------- Cut ----------------------- ; Magic quotes for incoming GET/POST/Cookie data. magic_quotes_gpc = Off ----------------------- Cut ----------------------- If you want to send mails bigger then 2MB you also have to change the variable "upload_max_filesize". I have set mine to 16M. ----------------------- Cut ----------------------- ; Maximum allowed size for uploaded files. upload_max_filesize = 16M ----------------------- Cut ----------------------- Restart apache2: /etc/init.d/apache2 restart Copy "zarafa-6.20-ubuntu8.04-i386.tar.gz" to the upload share. tar zxvf zarafa-6.20-ubuntu8.04-i386.tar.gz cd zarafa-6.20-ubuntu8.04-i386 ./install.sh Answer all the questions... When installation is done. Create users: zarafa-admin -c -p -e -f "" -a 1 # -a 1 = admin Poll mail form other POP servers apt-get install getmail4 Edit the dagent.cfg nano /etc/zarafa/dagent.cfg Change the server_socket to: file:///var/run/zarafa ----------------------- Cut ----------------------- ############################################################## # DAGENT SETTINGS server_socket = file:///var/run/zarafa # server_socket = https://localhost:237/zarafa ############################################################## ----------------------- Cut ----------------------- Setup automatic POP polling of mailboxes. I have selected to use cron-jobs for this tasks. There is of course a million ways to do this, with scripts and and other things. But because I like Webmin I will use that to set up cron-jobs for each POP mail to pull. The command line we will use looks like this. getmail_fetch --delete --timeout=30 '| /usr/bin/zarafa-dagent -s ' The pop3 mail server you pop your mail form (usually your ISPs pop3 server). The username for your pop3 mail account. The password for your pop3 mail account. The Zarafa username of the mailbox that the popped mail belongs to. If you have SSL encryption on your POP mail server then add "--ssl" on the string after "--delete". The argument "--delete" deletes the "popped" mail from the pop mail server when it's done. The argument "--timeout=30" set the time out to wait for the pop mail server to answer (30 secs). Now, login to Webmin, go to "System" and click "Scheduled Cron Jobs". Click "Create a new scheduled cron Job.". Select the user that shall "run" the job. (Not root). Activate "Yes". Command "getmail_fetch --delete --timeout=30 your.pop3.server '| /usr/bin/zarafa-dagent -s '" Description "The Popmail that is popped..." Click "Times and dates selected below..." And click Save. Now you can "Clone" this cron job for the rest of the pop mailboxes. Cron (re)start of the spooler. I noticed that the "SMTP" gate don't work when you restart the server (if you don't have your own SMTP server anyway). But if you just do "sudo /etc/init.d/zarafa-spooler restart" it works again. Just make a cron-job to restart the spool service when the server restarts. Again login to Webmin and go to "Create a new scheduled cron Job.". Select user root to "run" the job. Activate "Yes" Command "/etc/init.d/zarafa-spooler restart" Description "Restart the mail Spooler" Simple schedule "When system boots" And click Save. I like to check logs from time to time. Zarafa have some logging as well. So you can actually add them to the "system Logs" in Webmin. Go to "System logs". Click "Add a new system log." File Select /var/log/zarafa/gateway.log Facilities select "All" Priorities none Save. Repeat these steps for all logs in the "zarafa" folder. I have these: /var/log/zarafa/gateway.log /var/log/zarafa/getmail.log /var/log/zarafa/ical.log /var/log/zarafa/licensed.log /var/log/zarafa/monitor.log /var/log/zarafa/server.log /var/log/zarafa/spooler.log -- Poll hotmail accounts as long as DAV is open --------------------------------------------------------------------------- Pop Hotmail the easy way: If you have an old hotmail account (we are talking at least 10 years old), and back in the days enabled it for use in outlook you can use the following procedure at least a while longer. Microsoft is for the moment developing a new protocol to repalce the old "DAV" called "DeltaSynch". When Microsoft decide to stop the support for "DAV" this will no longer work! To install hotway and get the automatic configuration, I need to disable the default POP3 server in Zarafa just during the installation. If you don't do this, the "automatic" setup don't work when installing hotway. This can be done with some changes in the gateway.cfg. Change pop3_enable to "no" nano /etc/zarafa/gateway.cfg ----------------------- Cut ----------------------- # enable/disable POP3, and POP3 listen port pop3_enable = no pop3_port = 110 ----------------------- Cut ----------------------- Restart the zarafa gaterway (to free port 110). /etc/init.d/zarafa-gateway restart Install the inet daemon (if you don't like inetd, you can also use xinetd, see the xinetd section below). apt-get install inetutils-inetd This will install hotway, which allows you to read hotmail e-mails by simulating a POP3 server. apt-get install hotway Edit the config file and change the port. The "-r" at the end of the line will remove the poped mail from your hotmail box. Chage the "pop3" to another port that don't interfear with Zarafa, I have selected "1100". nano /etc/inetd.conf ----------------------- Cut ----------------------- 1100 stream tcp nowait nobody /usr/sbin/tcpd /usr/bin/hotwayd -r ----------------------- Cut ----------------------- Restart the hotwayd service /etc/init.d/inetutils-inetd restart Edit the gateway.cfg to start up Zarafa pop3 service again. nano /etc/zarafa/gateway.cfg change the pop3_enable to yes Restart the service /etc/init.d/zarafa-gateway restart Now you configure a cron job for each hotmail account, login to Webmin, go to "System" and click "Scheduled Cron Jobs". This is basically the same as you did for the pop mail boxes. Click "Create a new scheduled cron Job.". Select the user that shall "run" the job. (Not root). Activate "Yes". Command "getmail_fetch --delete --timeout=60 --p=1100 127.0.0.1 '| /usr/bin/zarafa-dagent -s '" Description "The hotmail account that is beeing popped..." Click "Times and dates selected below..." And click Save. Now you can "Clone" this cron job for more hotmail mailboxes. -- Use xinetd instead of inetd ------------------------------------------------------------------------------------------ Install xinetd apt-get install xinetd Create the file /etc/xinetd.d/hotwayd nano /etc/xinetd.d/hotwayd Enter the folliwing in the file: service hotwayd { #only_from = 192.168.1.0/8 disable = no type = unlisted socket_type = stream protocol = tcp wait = no user = nobody groups = yes server = /usr/bin/hotwayd #server_args = -p http://proxy:8080 port = 1100 } Save and exit. Now, restart xinetd to update the settings: sudo /etc/init.d/xinetd restart -- End of use xinetd instead of inetd ----------------------------------------------------------------------------------- To try if you have a working pop server now, telnet to the server: If your hotmail account is not "DAV" enebeld you will se an error messages when trying to connect. telnet 127.0.0.1 1100 Connected to 127.0.0.1. Escape character is '^]'. +OK POP3 hotwayd v0.8.2 -> The POP3-HTTPMail Gateway. Server on ubuntu active. user yourmail@hotmail.com +OK Username validated, Password requierd pass yourhotmailpassword +OK x xxxx #(x this will display number of messages in the mailbox and xxxx how much space they use.) list 1 xxxx 2 xxxx ... quit +OK see you later! Your "local" pop3 server is working. :) -- Setting up https ------------------------------------------------------------------------------------------------------- Start with the download of a working certificate generator. cd /tmp wget http://librarian.launchpad.net/7477840/apache2-ssl.tar.gz Unpack the file. tar zxvf apache2-ssl.tar.gz Copy the unpackes files to the correct locations. cp ssleay.cnf /usr/share/apache2/ cp apache2-ssl-certificate /usr/sbin/ Create a folder for the cets cd /etc/apache2 mkdir zarafa-ssl mkdir ssl Create a certificate (this example lasts for 10 years). Answer the questions... apache2-ssl-certificate -days 3650 Now lets move the new cert to the zarafa-ssl. mv ssl/* zarafa-ssl Login to webmin and go to "Servers" then "Apache Webserver" then click "Global configuration". In there click "Configure Apache Modules" and then find the module "ssl" and enable it. If you don't have an entry for Zarafa in your Webmin Webserver config you can either edit the "second one" (virtual server, not the default one). To be Zarafas Vitrual server, or of course create a new Vitrual server. What you need to do is to set the "Document root" to "/var/www/webaccess". Then go to the "SSL Options" and set "Enable SSL" to Yes, Select "/etc/apache2/zarafa-ssl/apache.pem" on the "Certificate/private key file" and save. Restart apache2: /etc/init.d/apache2 restart Surf to https://yourserversip You will get an "warning" about the certificate. Select to "accept" and you are up and running.